activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/3] activemq-artemis git commit: ARTEMIS-898 - Adding documentation for Plugin support
Date Mon, 08 May 2017 16:06:33 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 117d92bc9 -> 890e38137


ARTEMIS-898 - Adding documentation for Plugin support

Started a new chapter in the user manual for plugin support


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3bfbaf41
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3bfbaf41
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3bfbaf41

Branch: refs/heads/master
Commit: 3bfbaf419c2f4e577b810d9cf1c33c065bc5ce4d
Parents: 117d92b
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Mon May 8 09:27:08 2017 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon May 8 12:03:05 2017 -0400

----------------------------------------------------------------------
 docs/user-manual/en/SUMMARY.md        |  1 +
 docs/user-manual/en/broker-plugins.md | 46 ++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3bfbaf41/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index 9f1304a..f87793d 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -37,6 +37,7 @@
 * [Extra Acknowledge Modes](pre-acknowledge.md)
 * [Management](management.md)
 * [Security](security.md)
+* [Broker Plugins](broker-plugins.md)
 * [Resource Limits](resource-limits.md)
 * [The JMS Bridge](jms-bridge.md)
 * [Client Reconnection and Session Reattachment](client-reconnection.md)

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3bfbaf41/docs/user-manual/en/broker-plugins.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/broker-plugins.md b/docs/user-manual/en/broker-plugins.md
new file mode 100644
index 0000000..7166aca
--- /dev/null
+++ b/docs/user-manual/en/broker-plugins.md
@@ -0,0 +1,46 @@
+# Apache ActiveMQ Artemis Plugin Support
+
+Apache ActiveMQ Artemis is designed to allow extra functionality to be added by
+creating a plugin. Multiple plugins can be registered at the same time and they will be chained
+together and executed in the order they are registered.  (i.e. the first plugin registered

+is always executed first).
+
+Creating a plugin is very simple. It requires implementing the [`ActiveMQServerPlugin`](../../../artemis-server/src/main/java/org/apache/activemq/artemis/core/server/plugin/ActiveMQServerPlugin.java)
+interface, making sure the plugin is on the classpath, and registering it with the broker.
 Only the methods that you want to add behavior for need to be implemented as all of the interface
methods are default methods.
+
+## Registering a Plugin
+
+To register a plugin with by XML you need to add the `broker-plugins` element.
+
+`broker.xml` in your classpath:
+
+```xml
+<configuration ...>
+
+...
+    <broker-plugins>
+        <broker-plugin class-name="some.plugin.UserPlugin" />
+    </broker-plugins>
+...
+
+</configuration>
+```
+
+## Registering a Plugin Programmatically
+
+For registering a plugin programmatically you need to call the
+registerBrokerPlugin() method and pass in a new instance of your plugin.  In the example
below
+assuming your plugin is called `UserPlugin`, registering it looks like the following:
+
+
+``` java
+
+...
+
+Configuration config = new ConfigurationImpl();
+...
+
+config.registerBrokerPlugin(new UserPlugin());
+```
+
+


Mime
View raw message