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!)