作用:演讲点评初始化时在控制台打印测试消息。
开发环境:winxp/myeclip6.5/jdk1.5&1.6/mysql5.0/openfire3.6.3
QQ群:28588322 (openfire专题研究小组)
开发步骤:
1. 布署openfire3.6.3源码(请参考openfire3.6.3导入eclip项目实现方法)
结构如下:
2. src/plugins目录下新建文件夹itvi。并按下图的目录结构新建对应的文件。
l文件代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<class>org.jivesoftware.openfire.plugin.Itvi</class>
<name>Itvi</name>
<description>Broadcasts messages to urs.</description>
<author>openfireteam</author>
<version>1.7.0</version>
<date>2/19/2009</date>
<url>openfireteam.blogjava</url>
<minServerVersion>3.6.3</minServerVersion>
</plugin>
Itvi.java文件代码如下:
package org.jivesoftware.openfire.plugin;
import org.dom4j.Element;
import org.jivesoftware.openfire.IQHandlerInfo;好地址
pp.packet.*;好看电视剧推荐
import org.jivesoftware.openfire.handler.IQHandler;普宁美食
import org.jivesoftware.openfire.auth.UnauthorizedException;
/**
* 处理客户端发来的IQ,并回送结果IQ
*
* @author Phoenix
*
* Mar 14, 2008 4:55:33 PM
*
* version 0.1
*/
企业战略分析
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.QName;
import org.jivesoftware.openfire.XMPPServer;
import org.ainer.Plugin;
import org.ainer.PluginManager;
import org.jivesoftware.openfire.disco.IQDiscoInfoHandler;
import org.jivesoftware.openfire.disco.IQDiscoItemsHandler;
import org.jivesoftware.openfire.forms.DataForm;
import org.jivesoftware.openfire.forms.FormField;
季子挂剑import org.jivesoftware.openfire.forms.spi.XDataFormImpl;
import org.jivesoftware.openfire.forms.spi.XFormFieldImpl;
import org.sulttmanager.ResultSet;
import org.sulttmanager.ResultSetImpl;
import org.jivesoftware.openfire.ur.Ur;
import org.jivesoftware.openfire.ur.UrManager;
import org.jivesoftware.openfire.ur.UrNotFoundException;
import org.jivesoftware.util.*;
pp.component.Component;
pp.component.ComponentException;
pp.component.ComponentManager;
pp.component.ComponentManagerFactory;
pp.packet.IQ;
pp.packet.IQ.Type;
pp.packet.JID;
pp.packet.Packet;
pp.packet.PacketError;
pp.packet.PacketError.Condition;
import java.io.File;
import java.util.*;
import java.util.Map.Entry;
public class Itvi implements Plugin
{
private XMPPServer rver;
/*
* (non-Javadoc)
*
* @e org.ainer.Plugin#destroyPlugin()
*/
public void destroyPlugin()
{
}
/*
* (non-Javadoc)
*
* @e org.ainer.Plugin#initializePlugin(org.ainer.PluginManager,
* java.io.File)
*/
public void initializePlugin(PluginManager manager, File pluginDirectory)
{
rver = Instance();
IQRouter().addHandler(new ItviIQHander()); //
System.out.println("测试插件启动成功");
}
}
ItviIQHander.java文件代码如下:
package org.jivesoftware.openfire.plugin;
import org.dom4j.Element;
一竿风月import org.jivesoftware.openfire.IQHandlerInfo;
苍老的反义词pp.packet.*;
import org.jivesoftware.openfire.handler.IQHandler;
import org.jivesoftware.openfire.auth.UnauthorizedException;