|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.ipojo.Handler
public abstract class Handler
Handler Abstract Class. A handler is a 'piece' of
Field Summary | |
---|---|
static String |
HANDLER_LEVEL_PROPERTY
The handler priority. |
static String |
HANDLER_NAME_PROPERTY
The handler name property. |
static String |
HANDLER_NAMESPACE_PROPERTY
The handler namespace property. |
static String |
HANDLER_TYPE_PROPERTY
The handler type property. |
protected HandlerManager |
m_instance
The HandlerManager managing the current handler. |
protected boolean |
m_isValid
The current handler validity. |
Constructor Summary | |
---|---|
Handler()
|
Method Summary | |
---|---|
protected abstract void |
attach(ComponentInstance instance)
Attaches the current handler object to the given component instance. |
abstract void |
configure(Element metadata,
Dictionary configuration)
Configures the handler. |
void |
debug(String message)
Log method (debug). |
void |
error(String message)
Log method (error). |
void |
error(String message,
Throwable exception)
Log method (error). |
HandlerDescription |
getDescription()
Returns the current handler description. |
abstract Handler |
getHandler(String name)
Get a plugged handler of the same container. |
HandlerManager |
getHandlerManager()
Gets the component instance of the current handler. |
abstract Logger |
getLogger()
Gets the logger to use in the handler. |
boolean |
getValidity()
Is the current handler valid. |
void |
info(String message)
Log method (info). |
void |
initializeComponentFactory(ComponentTypeDescription typeDesc,
Element metadata)
Initializes the component factory. |
boolean |
isValid()
Checks if the current handler is valid. |
void |
reconfigure(Dictionary configuration)
Reconfigures the instance. |
abstract void |
setFactory(Factory factory)
Sets the factory attached to this handler object. |
void |
setValidity(boolean isValid)
Sets the validity of the current handler. |
abstract void |
start()
Starts the handler This method starts the management. |
void |
stateChanged(int state)
This method is called when the component state changed. |
abstract void |
stop()
Stops the handler This method stops the management. |
void |
warn(String message)
Log method (warning). |
void |
warn(String message,
Throwable exception)
Log method (warning). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String HANDLER_NAMESPACE_PROPERTY
public static final String HANDLER_NAME_PROPERTY
public static final String HANDLER_TYPE_PROPERTY
public static final String HANDLER_LEVEL_PROPERTY
protected boolean m_isValid
protected HandlerManager m_instance
Constructor Detail |
---|
public Handler()
Method Detail |
---|
public abstract void setFactory(Factory factory)
factory
- the factory to attach.public abstract Logger getLogger()
public final void warn(String message)
message
- the message to logpublic final void error(String message)
message
- the message to logpublic final void info(String message)
message
- the message to logpublic final void debug(String message)
message
- the message to logpublic final void warn(String message, Throwable exception)
message
- the message to logexception
- the exception to attach with the messagepublic final void error(String message, Throwable exception)
message
- the message to logexception
- the exception to attach to the messagepublic abstract Handler getHandler(String name)
name
- : name of the handler to find (class name or qualified handler name (ns:name)).
protected abstract void attach(ComponentInstance instance)
instance
- the component instance on which the current handler will be attached.public final boolean isValid()
true
if the handler is valid.public final void setValidity(boolean isValid)
isValid
- if true
the handler becomes valid, else it becomes invalid.public final boolean getValidity()
true
if the handler is valid, false
otherwise.public final HandlerManager getHandlerManager()
public void initializeComponentFactory(ComponentTypeDescription typeDesc, Element metadata) throws ConfigurationException
typeDesc
- the component description.metadata
- the component type metadata.
ConfigurationException
- if the metadata are not correct (early detection).public abstract void configure(Element metadata, Dictionary configuration) throws ConfigurationException
metadata
- the metadata of the componentconfiguration
- the instance configuration
ConfigurationException
- if the metadata are not correct.public abstract void stop()
public abstract void start()
public void stateChanged(int state)
state
- the new instance state ComponentInstance
public HandlerDescription getDescription()
public void reconfigure(Dictionary configuration)
configuration
- the new instance configuration.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |