Commit 74d9a007 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Provide access to PluginManager.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1013 b35dd754-fafc-0310-a699-88a17e54d16e
parent e9d3e8ae
......@@ -671,7 +671,7 @@ public class XMPPServer {
* @return the <code>OfflineMessageStrategy</code> registered with this server.
*/
public OfflineMessageStrategy getOfflineMessageStrategy() {
return (OfflineMessageStrategy) modules.get(OfflineMessageStrategy.class);
return (OfflineMessageStrategy)modules.get(OfflineMessageStrategy.class);
}
/**
......@@ -682,7 +682,7 @@ public class XMPPServer {
* @return the <code>PacketRouter</code> registered with this server.
*/
public PacketRouter getPacketRouter() {
return (PacketRouter) modules.get(PacketRouter.class);
return (PacketRouter)modules.get(PacketRouter.class);
}
/**
......@@ -693,7 +693,16 @@ public class XMPPServer {
* @return the <code>IQRegisterHandler</code> registered with this server.
*/
public IQRegisterHandler getIQRegisterHandler() {
return (IQRegisterHandler) modules.get(IQRegisterHandler.class);
return (IQRegisterHandler)modules.get(IQRegisterHandler.class);
}
/**
* Returns the <code>PluginManager</code> instance registered with this server.
*
* @return the PluginManager instance.
*/
public PluginManager getPluginManager() {
return pluginManager;
}
/**
......
......@@ -56,12 +56,16 @@ import java.util.concurrent.TimeUnit;
/**
* Loads and manages plugins. The <tt>plugins</tt> directory is monitored for any
* new plugins, and they are dynamically loaded.
* new plugins, and they are dynamically loaded.<p>
*
* An instance of this class can be obtained using:
*
* <tt>XMPPServer.getInstance().getPluginManager()</tt>
*
* @see Plugin
* @see org.jivesoftware.messenger.XMPPServer#getPluginManager()
* @author Matt Tucker
*/
public class PluginManager {
private File pluginDirectory;
......@@ -117,6 +121,18 @@ public class PluginManager {
return Collections.unmodifiableCollection(plugins.values());
}
/**
* Returns a plugin by name or <tt>null</tt> if a plugin with that name does not
* exist.. The name is the name of the directory that the plugin is in such as
* "broadcast".
*
* @param name the name of the plugin.
* @return the plugin.
*/
public Plugin getPlugin(String name) {
return plugins.get(name);
}
/**
* Loads a plug-in module into the container. Loading consists of the
* following steps:<ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment