Author: buildbot Date: Mon Nov 30 21:21:44 2015 New Revision: 974067 Log: Production update by buildbot for activemq
Modified: websites/production/activemq/content/cache/main.pageCache websites/production/activemq/content/developing-plugins.html Modified: websites/production/activemq/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/activemq/content/developing-plugins.html ============================================================================== --- websites/production/activemq/content/developing-plugins.html (original) +++ websites/production/activemq/content/developing-plugins.html Mon Nov 30 21:21:44 2015 @@ -81,43 +81,16 @@ <tbody> <tr> <td valign="top" width="100%"> -<div class="wiki-content maincontent"><p>Apache ActiveMQ is based on the model of POJOs and <em>Dependency Injection</em>. If you are developing <a shape="rect" href="interceptors.html">Interceptors</a> or additional components or plugins for ActiveMQ then the first thing you should do is develop the code as if you are writing any other Spring component, using dependency injection. </p> - -<h3 id="DevelopingPlugins-DependencyInjection">Dependency Injection</h3> - -<p>Some folks favour using constructor based injection as it removes the need to have a separate lifecycle <em>start()</em> method - others find using property based injection is a little more flexible and easier to map to XML configuration files. We'll leave that choice up to you. For complex to create objects you could consider writing a FactoryBean. For more details on writing POJOs with Spring see their <a shape="rect" class="external-link" href="http://www.springframework.org/documentation" rel="nofollow">documentation</a>.</p> - -<h3 id="DevelopingPlugins-CustomXML">Custom XML</h3> - -<p>With ActiveMQ you can use regular Spring.xml syntax to configure things. However to produce neater XML that is easier to read and edit we use <a shape="rect" class="external-link" href="http://geronimo.apache.org/xbean/">XBean</a> to autogenerate support for <a shape="rect" class="external-link" href="http://geronimo.apache.org/xbean/custom-xml.html">Custom XML</a>.</p> - -<p>If you wish your POJO to have its own custom XML you may wish to follow the following source examples for working nicely with XBean. Basically you add an XBean annotation in the javadoc comments to tell XBean how to map the POJO to custom XML. This should look something like</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"> -/** +<div class="wiki-content maincontent"><p>Apache ActiveMQ is based on the model of POJOs and <em>Dependency Injection</em>. If you are developing <a shape="rect" href="interceptors.html">Interceptors</a> or additional components or plugins for ActiveMQ then the first thing you should do is develop the code as if you are writing any other Spring component, using dependency injection.</p><h3 id="DevelopingPlugins-DependencyInjection">Dependency Injection</h3><p>Some folks favour using constructor based injection as it removes the need to have a separate lifecycle <em>start()</em> method - others find using property based injection is a little more flexible and easier to map to XML configuration files. We'll leave that choice up to you. For complex to create objects you could consider writing a FactoryBean. For more details on writing POJOs with Spring see their <a shape="rect" class="external-link" href="http://www.springframework.org/documentation" rel="nofollow">documentation</a>.</p ><h3 id="DevelopingPlugins-CustomXML">Custom XML</h3><p>With ActiveMQ you can >use regular Spring.xml syntax to configure things. However to produce neater >XML that is easier to read and edit we use <a shape="rect" >class="external-link" href="http://geronimo.apache.org/xbean/">XBean</a> to >autogenerate support for <a shape="rect" class="external-link" >href="http://geronimo.apache.org/xbean/custom-xml.html">Custom >XML</a>.</p><p>If you wish your POJO to have its own custom XML you may wish >to follow the following source examples for working nicely with XBean. >Basically you add an XBean annotation in the javadoc comments to tell XBean >how to map the POJO to custom XML. This should look something like</p><div >class="code panel pdl" style="border-width: 1px;"><div class="codeContent >panelContent pdl"> +<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">/** * @org.apache.xbean.XBean element="foo" */ public class MyExtension { ... } </pre> -</div></div> - -<p>You can omit the element configuration. For more details on the available annotation options see <a shape="rect" class="external-link" href="http://geronimo.apache.org/xbean/xbean-ant-task.html">here</a></p> - -<p>If you are submitting your plugin to the ActiveMQ project then it will end up being included in the maven build step to create the XBean artifacts as part of the jar (in the META-INF/services area). </p> - -<p>However if you are writing an external plugin to ActiveMQ then you will need to add the maven-xbean-plugin to your Maven 2 build. Refer to the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/pom.xml">activemq-core/pom.xml</a> as an example of using this plugin.</p> - -<h3 id="DevelopingPlugins-ConfiguringpluginswithoutcustomXML">Configuring plugins without custom XML</h3> - -<p>If you want to configure plugins that does not implement custom XML, you can define plugins as "regular" Spring beans and reference them in broker's <code>plugins</code> attribute. For example,</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"> - -<broker useJmx="true" xmlns="http://activemq.apache.org/schema/core" plugins="#loggingPlugin"> +</div></div><p>You can omit the element configuration. For more details on the available annotation options see <a shape="rect" class="external-link" href="http://geronimo.apache.org/xbean/xbean-ant-task.html">here</a></p><p>If you are submitting your plugin to the ActiveMQ project then it will end up being included in the maven build step to create the XBean artifacts as part of the jar (in the META-INF/services area).</p><p>However if you are writing an external plugin to ActiveMQ then you will need to add the maven-xbean-plugin to your Maven 2 build. Refer to the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-spring/pom.xml">activemq-spring/pom.xml</a> as an example of using this plugin.</p><h3 id="DevelopingPlugins-ConfiguringpluginswithoutcustomXML">Configuring plugins without custom XML</h3><p>If you want to configure plugins that does not implement custom XML, you can define plugins as "regular" Spring beans and r eference them in broker's <code>plugins</code> attribute. For example,</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"><broker useJmx="true" xmlns="http://activemq.apache.org/schema/core" plugins="#loggingPlugin"> ... </broker> @@ -126,13 +99,8 @@ public class MyExtension { /> </pre> -</div></div> - -<p>Not that this mechanism will not work in case that you have some XBean plugins configured inside the <code><plugins/></code> tag. In that case you must define the plugin inside that tag as well (with the appropriate schema definition). For example,</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"> -<plugins> +</div></div><p>Not that this mechanism will not work in case that you have some XBean plugins configured inside the <code><plugins/></code> tag. In that case you must define the plugin inside that tag as well (with the appropriate schema definition). For example,</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;"><plugins> <simpleAuthenticationPlugin> <users> <authenticationUser username="system" password="manager" @@ -148,13 +116,7 @@ public class MyExtension { /> </plugins> </pre> -</div></div> - -<h3 id="DevelopingPlugins-Examples">Examples</h3> - -<p>The easiest way to get a feel for how to extend ActiveMQ is maybe to look at some concrete examples of features and how those are implemented and configured. Here are some examples</p> - -<ul><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java">XBeanBrokerService</a> deals with most of the core configuration of the <broker> tag in the XML</li><li><a shape="rect" href="security.html">Security</a> has an <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/security/jaas-broker.xml">example</a> XML configuration file using the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/security/AuthorizationPlugin.java">AuthorizationPlugin</a></li><li>The <a shape="rect" href="message-redelivery-and-dlq-handling.html">Discarding DLQ Plugin</a> is used to discard messages from the DLQ.</li></ul></div> +</div></div><h3 id="DevelopingPlugins-Examples">Examples</h3><p>The easiest way to get a feel for how to extend ActiveMQ is maybe to look at some concrete examples of features and how those are implemented and configured. Here are some examples</p><ul><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-spring/src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java">XBeanBrokerService</a> deals with most of the core configuration of the <broker> tag in the XML</li><li><a shape="rect" href="security.html">Security</a> has an <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-unit-tests/src/test/resources/org/apache/activemq/security/jaas-broker.xml">example</a> XML configuration file using the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/activemq/trunk/activemq-broker/src/main/java/org/apache/activemq/security/AuthorizationPlugin.java">Autho rizationPlugin</a></li><li>The <a shape="rect" href="message-redelivery-and-dlq-handling.html">Discarding DLQ Plugin</a> is used to discard messages from the DLQ.</li></ul></div> </td> <td valign="top"> <div class="navigation">