I am writing a plugin to allow users to be created, deleted, and updated programatically from a JSP application residing on a web server on the same machine as Jive Messenger.
I used the Presence plugin as a guide and have created a simple plugin which recieves requests via the plugin’'s servlet and then processes them.
My servlets init method looks like this.
private UserAdminPlugin plugin;
public void init(ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);
plugin = (UserAdminPlugin) XMPPServer.getInstance().getPluginManager().getPlugin(“userAdmin”);
}
Since the plugin manager can’'t find my userAdmin plugin, my plugin object is set to null.
The presence plugin uses the same logic, and fetches the plugin like this
plugin =
(PresencePlugin) XMPPServer.getInstance().getPluginManager().getPlugin(“presence”);
However there seems to be no place where I can map the string “userAdmin” to the UserAdminPlugin plugin. Presumably the folder name which contains the plugin in the plugins directory performs this function, but in my case it doesn’'t seem to work.
The servlet mapping works correctly so my plugin seems to be loaded OK.
So my question is how can I get the reference to my plugin from within my servlet?
(I suppose it is a bit unlikely, but if my application resides on the same server as Jive Messenger, is it possible just to call
XMPPServer.getInstance()
from within my app and bypass the need to create a special plugin? I read somewhere about only one instance of XMPPServer being created per JVM)
Thanks