|
||||||||||
| 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 java.lang.String |
HANDLER_LEVEL_PROPERTY
The handler priority. |
static java.lang.String |
HANDLER_NAME_PROPERTY
The handler name property. |
static java.lang.String |
HANDLER_NAMESPACE_PROPERTY
The handler namespace property. |
static java.lang.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,
java.util.Dictionary configuration)
Configures the handler. |
void |
debug(java.lang.String message)
Log method (debug). |
void |
error(java.lang.String message)
Log method (error). |
void |
error(java.lang.String message,
java.lang.Throwable exception)
Log method (error). |
HandlerDescription |
getDescription()
Returns the current handler description. |
abstract Handler |
getHandler(java.lang.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(java.lang.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(java.util.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(java.lang.String message)
Log method (warning). |
void |
warn(java.lang.String message,
java.lang.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 java.lang.String HANDLER_NAMESPACE_PROPERTY
public static final java.lang.String HANDLER_NAME_PROPERTY
public static final java.lang.String HANDLER_TYPE_PROPERTY
public static final java.lang.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(java.lang.String message)
message - the message to logpublic final void error(java.lang.String message)
message - the message to logpublic final void info(java.lang.String message)
message - the message to logpublic final void debug(java.lang.String message)
message - the message to log
public final void warn(java.lang.String message,
java.lang.Throwable exception)
message - the message to logexception - the exception to attach with the message
public final void error(java.lang.String message,
java.lang.Throwable exception)
message - the message to logexception - the exception to attach to the messagepublic abstract Handler getHandler(java.lang.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,
java.util.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 ComponentInstancepublic HandlerDescription getDescription()
public void reconfigure(java.util.Dictionary configuration)
configuration - the new instance configuration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||