|
||||||||||
| 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
public abstract class PrimitiveHandler
This class defines common mechanisms of primitive handlers. Primitive handlers are handler composing the container of primitive component instances (declared by the 'component' element inside the iPOJO descriptor). Note that this class also defines default method implementation. Classes overriding this class can change the behavior of those methods.
| Field Summary | |
|---|---|
static java.lang.String |
HANDLER_TYPE
The "Primitive" Handler type (value). |
private ComponentFactory |
m_factory
The factory of the instance manager. |
private InstanceManager |
m_manager
The reference on the instance manager. |
| 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 | |
|---|---|
PrimitiveHandler()
|
|
| Method Summary | |
|---|---|
protected void |
attach(ComponentInstance manager)
Attaches the current handler to the given instance. |
ComponentFactory |
getFactory()
Gets the factory which creates the managed instance. |
Handler |
getHandler(java.lang.String name)
Gets a plugged handler of the same container. |
InstanceManager |
getInstanceManager()
Gets the instance manager managing the instance. |
Logger |
getLogger()
gets the logger of the managed instance. |
PojoMetadata |
getPojoMetadata()
Gets the PojoMetadata of the content of the managed instance. |
void |
onCreation(java.lang.Object instance)
Callback method called when an instance of the component is created, but before someone can use it. |
void |
onEntry(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.Object[] args)
Callback method called when a method will be invoked. |
void |
onError(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.Throwable throwable)
Callback method called when an error occurs. |
void |
onExit(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.Object returnedObj)
Callback method called when a method ends. |
void |
onFinally(java.lang.Object pojo,
java.lang.reflect.Method method)
Callback method called when the execution of a method will terminate : just before to throw an exception or before to return. |
java.lang.Object |
onGet(java.lang.Object pojo,
java.lang.String fieldName,
java.lang.Object value)
Callback method called when a managed field asks for a value. |
void |
onSet(java.lang.Object pojo,
java.lang.String fieldName,
java.lang.Object value)
Callback method called when a managed field receives a new value. |
void |
setFactory(Factory factory)
Sets the factory of the managed instance. |
| Methods inherited from class org.apache.felix.ipojo.Handler |
|---|
configure, debug, error, error, getDescription, getHandlerManager, getValidity, info, initializeComponentFactory, isValid, reconfigure, setValidity, start, stateChanged, stop, warn, warn |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String HANDLER_TYPE
private InstanceManager m_manager
private ComponentFactory m_factory
| Constructor Detail |
|---|
public PrimitiveHandler()
| Method Detail |
|---|
protected final void attach(ComponentInstance manager)
attach in class Handlermanager - the instance on which the current handler will be attached.Handler.attach(org.apache.felix.ipojo.ComponentInstance)public final void setFactory(Factory factory)
setFactory in class Handlerfactory - the factoryHandler.setFactory(org.apache.felix.ipojo.Factory)public Logger getLogger()
getLogger in class HandlerHandler.getLogger()public InstanceManager getInstanceManager()
public ComponentFactory getFactory()
public PojoMetadata getPojoMetadata()
public final Handler getHandler(java.lang.String name)
getHandler in class Handlername - the name of the handler to find (class name or qualified
handler name (ns:name)).
null if the handler is not found.
public void onSet(java.lang.Object pojo,
java.lang.String fieldName,
java.lang.Object value)
onSet in interface FieldInterceptorpojo - the pojo object setting the valuefieldName - the field namevalue - the value received by the fieldFieldInterceptor.onSet(Object, String, Object)
public java.lang.Object onGet(java.lang.Object pojo,
java.lang.String fieldName,
java.lang.Object value)
onGet in interface FieldInterceptorpojo - the pojo object requiring the valuefieldName - the field namevalue - the value passed to the field (by the previous call)
FieldInterceptor.onGet(Object, String, Object)
public void onEntry(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.Object[] args)
onEntry in interface MethodInterceptorpojo - the pojo on which the method is called.method - the method invoked.args - the arguments array.MethodInterceptor.onEntry(Object, Method, Object[])
public void onExit(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.Object returnedObj)
null, either the method is
void, or it returns null.
You must not modified the returned object.
The default implementation does nothing.
onExit in interface MethodInterceptorpojo - the pojo on which the method exits.method - the exiting method.returnedObj - the returned object (boxed for primitive type)MethodInterceptor.onExit(Object, Method, Object)
public void onError(java.lang.Object pojo,
java.lang.reflect.Method method,
java.lang.Throwable throwable)
onError in interface MethodInterceptorpojo - the pojo on which the method was accessed.method - the invoked method.throwable - the thrown exceptionMethodInterceptor.onError(java.lang.Object, java.lang.reflect.Method, java.lang.Throwable)
public void onFinally(java.lang.Object pojo,
java.lang.reflect.Method method)
MethodInterceptor.onExit(Object, Method, Object) or
MethodInterceptor.onError(Object, Method, Throwable)
were already called.
This default implementation does nothing.
onFinally in interface MethodInterceptorpojo - the pojo on which the method was accessed.method - the invoked method.public void onCreation(java.lang.Object instance)
instance - the created instance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||