public class ComponentFinder extends Object
Component
,
ServerContainer.start()
Constructor and Description |
---|
ComponentFinder(ServerContainer server,
File componentDir)
Constructs a new component manager.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public ComponentFinder(ServerContainer server, File componentDir)
componentDir
- the component directory.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
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.Copyright © 2004–2015 Ignite Realtime. All rights reserved.