[jdev] Re: how to implement my plugin as a component to be startedwithin the start of wildfire !

Gaston Dombiak gaston at jivesoftware.com
Thu Jan 5 12:33:32 CST 2006


Hey Abdicative,

You may want to ask this question in our forums so you can get a faster 
answer. :)

You can take a look at the SearchPlugin to see how to register a new 
component using a plugin. As you will see there is no need to get the 
InternalComponentManager instance and ask it to start. Basically, you just 
need to register the new component/s provided by your plugin. The following 
code should give you an idea on how to achieve that. Oh, and remember to 
unregister the component when the plugin is being destroyed/removed.

        componentManager = ComponentManagerFactory.getComponentManager();
        componentManager.addComponent(serviceName, this);

Regards,

  -- Gato

"Abdeltif Nouqrat" <nouqrat at cs.tu-berlin.de> wrote in message 
news:Pine.GSO.4.60.0601031808150.6904 at basta...
>
> Hi all,
> in order to implement my plugin as internal component of wildfire, I
> implemented the "Component-interface" and the "Plugin-Interface".
>
> I want that my component will be started at start of wildfire. Such as " 
> multi user chat service".
>
>
> My plugin-initialization shows as follows:
>
> public void initializePlugin(PluginManager manager, File pluginDirectory) 
> {
>
>  XMPPServer server = XMPPServer.getInstance();
>  initialize(server);
>  hostname = server.getServerInfo().getName();
>  userManager = server.getUserManager();
>         presenceManager = server.getPresenceManager();
>
>           componentName = "presence";
>           internalComponentMgr = InternalComponentManager.getInstance();
>           setServiceName(componentName);
>           start();
>       try {
>
>      internalComponentMgr.addComponent(componentName,this);
>  componentLog = internalComponentMgr.getLog();//To log information sent 
> and received from/into component
>
>       } catch (ComponentException e) {
>  e.printStackTrace();
>  }
>
>  }
>
> where:
> public void setServiceName(String name) {
>         JiveGlobals.setProperty("xmpp.ipresence.service", name);
>     }
>
> public void start() {
>  internalComponentMgr.start();
>     }
>
>
>
> PLEASE correct me if I am at wrong way. Additional hints are welcome.
>
> Best regards
>
> Abdelatif
>
>
>
> 






More information about the JDev mailing list