|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttigase.server.BasicComponent
tigase.server.AbstractComponentRegistrator<E>
E
- public abstract class AbstractComponentRegistrator<E extends ServerComponent>
This is an archetype of a special types of classes which collect some data
from Tigase components or provide these data to components. They normally
do not process normall packets and are usually accessed by admins via ad-hoc
commands. Good examples of such components are StatisticsCollector
or Configurator
.
processPacket(Packet packet, Queue<Packet> results)
method.
Alternatively scripting API can be used via ad-hoc commands.
The class does not have any queues buffering packets or separate threads for
packets processing. All packets are processed from MessageRouter
threads via processPacket(Packet packet, Queue<Packet> results)
method. Hence this is important that processing implemented in extensions to the
class does not take long time. In particular no DB processing is expected.
Created: Tue Nov 22 22:57:44 2005
Field Summary | |
---|---|
protected Map<String,E> |
components
A collection of server components which implement special interface, related to the functionality provided by extension of the class. |
Fields inherited from class tigase.server.BasicComponent |
---|
admins, SCRIPTS_DIR_PROP_DEF, SCRIPTS_DIR_PROP_KEY, vHostManager |
Fields inherited from interface tigase.disco.XMPPService |
---|
CMD_FEATURES, DEF_FEATURES, INFO_XMLNS, ITEMS_XMLNS |
Constructor Summary | |
---|---|
AbstractComponentRegistrator()
Creates a new AbstractComponentRegistrator instance. |
Method Summary | |
---|---|
boolean |
addComponent(ServerComponent component)
Method checks whether the component is of a correct type, adds it to the internal components collection and calls componentAdded(...) callback. |
abstract void |
componentAdded(E component)
Method provides a callback mechanism signaling that a new component implementing special interface has been added to the internal components collection. |
abstract void |
componentRemoved(E component)
Method provides a callback mechanism signaling that a component implementing special interface has been removed from the internal components
collection. |
boolean |
deleteComponent(ServerComponent component)
Method removes specified component from the internal components
collection and calls componentRemoved(...) callback method. |
E |
getComponent(String name)
Method returns a component for a specified component name from internal components collection or null of there is no such
component in the collection. |
abstract boolean |
isCorrectType(ServerComponent component)
Method checks whether the component provides as method parameter is correct type that is implements special interface or extends special class. |
String |
newPacketId(String prefix)
Method generates and returns an unique packet ID. |
void |
release()
Method is called when the component is being stopped and potentially removed from the system to release all resources associated with the component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface tigase.server.ServerComponent |
---|
getComponentId, getName, initializationCompleted, processPacket, setName |
Field Detail |
---|
protected Map<String,E extends ServerComponent> components
Constructor Detail |
---|
public AbstractComponentRegistrator()
AbstractComponentRegistrator
instance.
Method Detail |
---|
public abstract void componentAdded(E component)
components
collection.
component
- is a reference to the component just added to the collection.public abstract void componentRemoved(E component)
components
collection.
component
- is a reference to the component removed from the collection.public abstract boolean isCorrectType(ServerComponent component)
components
collection.
component
- is a reference to the component being checked.
boolean
value of true
if the component is of a
correct type and false
otherwise.public boolean addComponent(ServerComponent component)
components
collection and calls componentAdded(...)
callback.
addComponent
in interface ComponentRegistrator
component
- a reference to the component which is being added to the intenal
collection.
boolean
value of true
if the component
has been added to the internal collection and false
otherwise.public boolean deleteComponent(ServerComponent component)
components
collection and calls componentRemoved(...)
callback method.
deleteComponent
in interface ComponentRegistrator
component
- is a reference to the component being removed.
boolean
value of true
if the component
has been removed from the internal collection and false
otherwise.public E getComponent(String name)
components
collection or null
of there is no such
component in the collection.
name
- is a String
value of the component name.
null
if no component has been found.public String newPacketId(String prefix)
prefix
- is a String
value of the ID profix or null
if no prefix is necessary.
String
instance of a new packet ID.public void release()
processPacket
or any
ad-hoc commands is expected.
release
in interface ServerComponent
release
in class BasicComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |