activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1329253 - /activemq/activemq-apollo/trunk/apollo-website/src/documentation/extending-guide.md
Date Mon, 23 Apr 2012 14:26:23 GMT
Author: chirino
Date: Mon Apr 23 14:26:22 2012
New Revision: 1329253

URL: http://svn.apache.org/viewvc?rev=1329253&view=rev
Log:
Adding list of extension points of the broker.

Modified:
    activemq/activemq-apollo/trunk/apollo-website/src/documentation/extending-guide.md

Modified: activemq/activemq-apollo/trunk/apollo-website/src/documentation/extending-guide.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-website/src/documentation/extending-guide.md?rev=1329253&r1=1329252&r2=1329253&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-website/src/documentation/extending-guide.md (original)
+++ activemq/activemq-apollo/trunk/apollo-website/src/documentation/extending-guide.md Mon
Apr 23 14:26:22 2012
@@ -12,28 +12,82 @@ all the supported extension points.
 Just create a `.jar` out of out code and add it to the `${apollo.home}/lib`
 directory.  When Apollo restarts it will add the new jar to it's class path.
 
-### Extending the JAXB model with new Objects
+### Extension Discovery
+
+Apollo discovers your extensions by looking for extension resource files in
+all the jar files in it's classpath.  For example, the `apollo-broker` jar
+file contains the following a resource file `META-INF/services/org.apache.activemq.apollo/protocol-codec-factory.index`
+It contains the class names of the protocol codec factories that are implemented
+in the `broker-core` module.  It's contents are:
+
+    org.apache.activemq.apollo.broker.protocol.AnyProtocolFactory
+    org.apache.activemq.apollo.broker.protocol.UdpProtocolFactory
+    org.apache.activemq.apollo.broker.protocol.RawProtocolFactory
+
+All three of the the listed classes implement the `ProtocolFactory` interface.
+Here's a list of extension points supported by Apollo:
+
+* Data Model: `META-INF/services/org.apache.activemq.apollo/dto-module.index` ->
+  `org.apache.activemq.apollo.util.DtoModule`
+
+* Transports: `META-INF/services/org.apache.activemq.apollo/transport-factory.index` ->
+  `org.apache.activemq.apollo.broker.transport.TransportFactory.Provider`
+
+* Protocols: `META-INF/services/org.apache.activemq.apollo/protocol-factory.index` ->
+  `org.apache.activemq.apollo.broker.protocol.ProtocolFactory`
+
+* Broker Factories: `META-INF/services/org.apache.activemq.apollo/broker-factory.index` ->
+  `org.apache.activemq.apollo.broker.BrokerFactoryTrait`
+
+* Connectors: `META-INF/services/org.apache.activemq.apollo/connector-factory.index` ->
+  `org.apache.activemq.apollo.broker.ConnectorFactory`
+
+* Virtual Hosts: `META-INF/services/org.apache.activemq.apollo/virtual-host-factory.index`
->
+  `org.apache.activemq.apollo.broker.VirtualHostFactory`
+
+* Route Listeners: `META-INF/services/org.apache.activemq.apollo/router-listener-factory.index`
->
+  `org.apache.activemq.apollo.broker.RouterListenerFactory`
+
+* Stores: `META-INF/services/org.apache.activemq.apollo/store-factory.index` ->
+  `org.apache.activemq.apollo.broker.store.StoreFactory`
+
+* Web Admin Components: `META-INF/services/org.apache.activemq.apollo/web-module.index` ->
+  `org.apache.activemq.apollo.web.WebModule`
+
+* Web Servers -> `META-INF/services/org.apache.activemq.apollo/web-server-factory.index`->
+  `org.apache.activemq.apollo.broker.web.WebServerFactory`
+
+<!-- These might go away...
+* `META-INF/services/org.apache.activemq.apollo/binding-factory.index`:
+  `org.apache.activemq.apollo.broker.BindingFactory` 
+* `META-INF/services/org.apache.activemq.apollo/protocol-codec-factory.index` : 
+  `org.apache.activemq.apollo.broker.protocol.ProtocolCodecFactory.Provider`
+-->
+
+### Extending the Data/Configuraiton model with new Objects
 
 If you want to extend the Apollo xml configuration model to understand some
 custom JAXB object you have defined in your own packages, then you need
-to implement a `Module` class and then create a `META-INF/services/org.apache.activemq.apollo/modules.index`

+to implement a `Module` class and then create a `META-INF/services/org.apache.activemq.apollo/dto-module.index`

 resource file in which you list it's class name.
 
 Example module class:
 
 {pygmentize:: scala}
 package org.example
-import org.apache.activemq.apollo.util.JaxbModule
+import org.apache.activemq.apollo.util.DtoModule
+
+class Module extends DtoModule {
+
+  def dto_package = "org.apache.activemq.apollo.broker.store.leveldb.dto"
+  def extension_classes = Array(classOf[LevelDBStoreDTO], classOf[LevelDBStoreStatusDTO])
 
-class ExtensionJaxbModule extends JaxbModule {
-  def xml_package = "org.example.dto"
 }
 {pygmentize}
 
+Example `META-INF/services/org.apache.activemq.apollo/dto-module.index` resource:
 
-Example `META-INF/services/org.apache.activemq.apollo/jaxb-module.index` resource:
-
-    org.example.ExtensionJaxbModule
+    org.example.Module
 
 ### Plugging into the Broker Lifecycle
 



Mime
View raw message