|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.ipojo.Handler
org.apache.felix.ipojo.PrimitiveHandler
org.apache.felix.ipojo.handlers.lifecycle.controller.ControllerHandler
public class ControllerHandler
Lifecycle Controller handler. This handler allow a POJO to vote for the instance state. By setting a boolean field to true or false, the handler state changed.
Field Summary |
---|
Fields inherited from class org.apache.felix.ipojo.PrimitiveHandler |
---|
HANDLER_TYPE |
Fields inherited from class org.apache.felix.ipojo.Handler |
---|
HANDLER_LEVEL_PROPERTY, HANDLER_NAME_PROPERTY, HANDLER_NAMESPACE_PROPERTY, HANDLER_TYPE_PROPERTY, m_instance, m_isValid |
Constructor Summary | |
---|---|
ControllerHandler()
|
Method Summary | |
---|---|
void |
configure(Element metadata,
Dictionary configuration)
Configure method. |
void |
initializeComponentFactory(ComponentTypeDescription desc,
Element metadata)
Initialize the component factory. |
Object |
onGet(Object pojo,
String field,
Object value)
GetterCallback. |
void |
onSet(Object pojo,
String field,
Object value)
SetterCallback. |
void |
start()
Start method. |
void |
stop()
Stop method. |
Methods inherited from class org.apache.felix.ipojo.PrimitiveHandler |
---|
attach, getConstructorParameter, getConstructorParameterType, getFactory, getHandler, getInstanceManager, getLogger, getPojoMetadata, onCreation, onEntry, onError, onExit, onFinally, setFactory |
Methods inherited from class org.apache.felix.ipojo.Handler |
---|
debug, error, error, getDescription, getHandlerManager, getValidity, info, isValid, reconfigure, setValidity, stateChanged, warn, warn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ControllerHandler()
Method Detail |
---|
public void configure(Element metadata, Dictionary configuration) throws ConfigurationException
configure
in class Handler
metadata
- : metadataconfiguration
- : configuration
ConfigurationException
- : the field attribute is missing or does not exist in the class.org.apache.felix.ipojo.Handler#configure(org.apache.felix.ipojo.InstanceManager, org.apache.felix.ipojo.metadata.Element, java.util.Dictionary)
public void start()
start
in class Handler
Handler.start()
public void stop()
stop
in class Handler
Handler.stop()
public Object onGet(Object pojo, String field, Object value)
onGet
in interface FieldInterceptor
onGet
in class PrimitiveHandler
pojo
- : the pojo object on which the field is accessed
Return the stored value.field
- : field name.value
- : value given by the previous handler.
FieldInterceptor.onGet(Object, String, Object)
public void onSet(Object pojo, String field, Object value)
onSet
in interface FieldInterceptor
onSet
in class PrimitiveHandler
pojo
- : the pojo object on which the field is accessed
Store the new field value & invalidate / validate the handler is required.field
- : field name.value
- : new value.FieldInterceptor.onSet(Object, String, Object)
public void initializeComponentFactory(ComponentTypeDescription desc, Element metadata) throws ConfigurationException
initializeComponentFactory
in class Handler
desc
- : component descriptionmetadata
- : component type metadata
ConfigurationException
- : occurs if the controller field is not in the POJO class or is not a boolean.Handler.initializeComponentFactory(org.apache.felix.ipojo.architecture.ComponentTypeDescription, org.apache.felix.ipojo.metadata.Element)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |