Implements the Spark Plugin framework to display the different possibilities using
Spark.
*/
public class ExamplePlugin implements Plugin {
/**
Called after Spark is loaded to initialize the new plugin.
*/
public void initialize() {
System.out.println("Welcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To SparkWelcome To Spark");
}
/**
Called when Spark is shutting down to allow for persistence of information
or releasing of resources.
*/
public void shutdown() {
}
/**
Return true if the Spark can shutdown on users request.
@return true if Spark can shutdown on users request.
*/
public boolean canShutDown() {
return true;
}
/**
Is called when a user explicitly asked to uninstall this plugin.
The plugin owner is responsible to clean up any resources and
remove any components install in Spark.
*/
public void uninstall() {
// Remove all resources belonging to this plugin.
}
}
8、 进入build目录,运行ant打包。在根目录找到myplugin.jar。放入spark测试程序下的plugin目录,在bin目录下运行start.bat即可看到测试成功的结果。
9、 关于更新spark插件注意事项,spark插件除去放在spark\plugin目录下以外,还会解压到C:\Users\you_name\AppData\Roaming\Spark\plugins目录下。
Spark是一款类似RTX和lycn的泛联系人及时聊天软件。本文档主要介绍如何搭载一个开发Spark插件的环境和简要基本配置。
首先,需要去 1、 http://www.igniterealtime.org/downloads/index.jsp 地址下载最新的openfire(Spark服务器),和Spark软件(聊天软件本体) 2、 http://www.igniterealtime.org/projects/spark/sparkplug-kit.jsp 下载sparkplug-kit,插件开发环境,这里面包括开发文档和开发指南 3、 svn co http://svn.igniterealtime.org/svn/repos/spark/trunk spark 利用SVN下载最新版本的源码,用作测试环境。 4、 编译需要ANT,需要去http://ant.apache.org/bindownload.cgi 下载最新版本的ANT作为编译工具。解压后配置ANT_HOME等环境(配置手册ANT目录下有) 5、 解压sparkplug-kit,拷贝sparkplug到开发目录,开发根目录是sparkplug\builder。其中需要添加的lib包都在sparkplug-kit\spark\lib下。 6、 新版本(2013年8月14日)的plugin.xml格式如下
其中class是编写的类的名称。Java是里面是java版本号。 7、 编写完成ExamplePlugin,例如如下 import org.jivesoftware.spark.plugin.Plugin;
/**
Spark. */ public class ExamplePlugin implements Plugin {
/**
}
/**
}
/**
/**