org.apache.felix.ipojo
Interface FieldInterceptor

All Known Implementing Classes:
ArchitectureHandler, ConfigurationHandler, ControllerHandler, Dependency, DependencyHandler, EventAdminPublisherHandler, EventAdminSubscriberHandler, ExtenderModelHandler, LifecycleCallbackHandler, MBeanHandler, PrimitiveHandler, Property, ProvidedServiceHandler, TemporalDependency, TemporalHandler, WhiteBoardPatternHandler

public interface FieldInterceptor

A field interceptor is notified when a monitored field asks for a value or receives a new value. A class implementing this interface is able to be notified of field accesses, and is able to inject a value to this field. The listener needs to be register on the instance manager.

Author:
Felix Project Team

Method Summary
 java.lang.Object onGet(java.lang.Object pojo, java.lang.String fieldName, java.lang.Object value)
          This method is called when a GETFIELD operation is detected.
 void onSet(java.lang.Object pojo, java.lang.String fieldName, java.lang.Object value)
          This method is called when a PUTFIELD operation is detected, e.g.
 

Method Detail

onSet

void onSet(java.lang.Object pojo,
           java.lang.String fieldName,
           java.lang.Object value)
This method is called when a PUTFIELD operation is detected, e.g. an assignation.

Parameters:
pojo - the pojo object setting the value
fieldName - the field name
value - the value passed to the field

onGet

java.lang.Object onGet(java.lang.Object pojo,
                       java.lang.String fieldName,
                       java.lang.Object value)
This method is called when a GETFIELD operation is detected. This method allows to inject a value to the field.

Parameters:
pojo - the pojo object getting the value
fieldName - the field name
value - the value passed to the field (by the previous call)
Returns:
the managed value of the field


Copyright © 2006-2010 The Apache Software Foundation. All Rights Reserved.