|
Whack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.whack.container.ComponentFinder
public class ComponentFinder
Loads and manages components. The components directory is monitored for any new components, and they are dynamically loaded.
Component
,
ServerContainer.start()
Constructor Summary | |
---|---|
ComponentFinder(ServerContainer server,
File componentDir)
Constructs a new component manager. |
Method Summary | |
---|---|
String |
getAuthor(org.xmpp.component.Component component)
Returns the author of a component. |
org.xmpp.component.Component |
getComponent(String name)
Returns a component by name or null if a component with that name does not exist. |
File |
getComponentDirectory(org.xmpp.component.Component component)
Returns the component's directory. |
Collection<org.xmpp.component.Component> |
getComponents()
Returns a Collection of all found components. |
String |
getDescription(org.xmpp.component.Component component)
Returns the description of a component. |
String |
getName(org.xmpp.component.Component component)
Returns the name of a component. |
String |
getVersion(org.xmpp.component.Component component)
Returns the version of a component. |
Class |
loadClass(String className,
org.xmpp.component.Component component)
|
void |
shutdown()
Shuts down running components that were found by the service. |
void |
start()
Starts the service that looks for components. |
void |
unloadComponent(String componentName)
Unloads a component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComponentFinder(ServerContainer server, File componentDir)
componentDir
- the component directory.Method Detail |
---|
public void start()
public void shutdown()
public Collection<org.xmpp.component.Component> getComponents()
public org.xmpp.component.Component getComponent(String name)
name
- the name of the component.
public File getComponentDirectory(org.xmpp.component.Component component)
component
- the component.
public void unloadComponent(String componentName)
ComponentManager.removeComponent(String)
method will be
called and then any resources will be released. The name should be the name of the component
directory and not the name as given by the component meta-data. This method only removes
the component but does not delete the component JAR file. Therefore, if the component JAR
still exists after this method is called, the component will be started again the next
time the component monitor process runs. This is useful for "restarting" components.This method is called automatically when a component's JAR file is deleted.
componentName
- the name of the component to unload.public Class loadClass(String className, org.xmpp.component.Component component) throws ClassNotFoundException, IllegalAccessException, InstantiationException
ClassNotFoundException
IllegalAccessException
InstantiationException
public String getName(org.xmpp.component.Component component)
component
- the component.
public String getDescription(org.xmpp.component.Component component)
component
- the component.
public String getAuthor(org.xmpp.component.Component component)
component
- the component.
public String getVersion(org.xmpp.component.Component component)
component
- the component.
|
Whack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |