public abstract class Handler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Handler() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
attach(ComponentInstance instance)
Attaches the current handler object to the given component instance.
|
abstract void |
configure(org.apache.felix.ipojo.metadata.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,
org.apache.felix.ipojo.metadata.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).
|
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
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 logpublic final void warn(java.lang.String message, java.lang.Throwable exception)
message
- the message to logexception
- the exception to attach with the messagepublic 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, org.apache.felix.ipojo.metadata.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(org.apache.felix.ipojo.metadata.Element metadata, java.util.Dictionary configuration) throws ConfigurationException
metadata
- the metadata of the componentconfiguration
- the instance configurationConfigurationException
- 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(java.util.Dictionary configuration)
configuration
- the new instance configuration.Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.