Plugin non-automatic building

HI everyone!

I’'m trying to build a wildfire plugin, but i have some problem when i try to use it:

this is the plugin code:

package org.example;

import java.io.*;

import org.jivesoftware.wildfire.container.Plugin;

import org.jivesoftware.wildfire.container.PluginManager;

import org.jivesoftware.wildfire.interceptor.*;

import org.xmpp.packet.*;

import org.jivesoftware.wildfire.Session;

public class ExamplePlugin implements Plugin, PacketInterceptor {

private InterceptorManager interceptorManager;

public ExamplePlugin(){

this.interceptorManager = InterceptorManager.getInstance();

}

public void initializePlugin(PluginManager arg0, File arg1) {

// TODO Auto-generated method stub

this.interceptorManager.addInterceptor(this);

}

public void destroyPlugin() {

// TODO Auto-generated method stub

// unregister with interceptor manager

this.interceptorManager.removeInterceptor(this);

}

public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed) throws PacketRejectedException{

}

}[/i]

then i have created plugin.xml:

[/i]

and this is the directory i created under wildfire home directory:

/plugins/example

±—lib

i put plugin.xml[/b] in the example directory, and a plugin-example.jar[/b] file (that contains org/example/ExamplePlugin.class) in lib[/b] directory.

Is it the correct method?

When i try to run wildfire server, it deletes the example directory i created and this error message is generated in the log file:

2006.05.12 12:26:15 [org.jivesoftware.wildfire.container.PluginManager$PluginMonitor.run(PluginMana ger.java:646)

] Error unloading plugin example. Will attempt again momentarily.

That’'s all, thanks to everyone can help me! (i know my english is very bad, so…sorry!)

Hi Roberto,

Your english is fine.

Two suggestions:

  1. Download the url=http://www.jivesoftware.org/source.jspWildfire source[/url], that also contains the source to all the plugins which makes for a good point of reference.

  2. In your destroyPlugin() after you’'ve unregistered your PacketInterceptor you will want to null out interceptorManager, eg:

public void destroyPlugin() {

// unregister with interceptor manager

this.interceptorManager.removeInterceptor(this);

interceptorManager = null;

}

/code

This will allow your plugin to unload properly.

Hope that helps,

Ryan

Thx Ryan!

Now the plug in is up, and i can see it on the admin page.

Roberto

You’'re welcome. Be sure to mark this question/thread as having been answered and award any points as you see fit.

Urg, I think we need a moderator override. I would definitely have given you points.

Regards,

Matt

I’'m here for the simple joy I get by helping others and not for seeing a little yellow or green star next the subject line in one of replies. My entire being fills with pride and my heart…

Who am I kidding? I’'m here for the geek points! Gimme, gimme, gimme!

Hi Ryan,

for you nothing changes if you get 10 more points, but for me the legend will change.

I should apply for moderator so I can make sure to get the points

LG

Sorry, but i’‘m new to the forum, and only two minuts ago i seen the point’'s button :stuck_out_tongue:

Roberto

Hola Roberto,

you’'re welcome There are a lot of users which seem not to notice that one can spend points or mark a question as answered so one still needs an idea how to make these options more conspicuous.

LG