activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1160087 - in /activemq/activemq-apollo/trunk: apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/ apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ apollo-broker/src/main/scala/org/apache/active...
Date Mon, 22 Aug 2011 00:34:15 GMT
Author: chirino
Date: Mon Aug 22 00:34:13 2011
New Revision: 1160087

URL: http://svn.apache.org/viewvc?rev=1160087&view=rev
Log:
Simplified all and standardized the way extension points are found.

Added:
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ExtensionJaxbModule.scala
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ExtensionModule.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Binding.scala
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueBinding.scala
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/PrimaryJaxbModule.java
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-selector/src/main/java/org/apache/activemq/apollo/filter/ExtensionModule.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-web/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/ExtensionJaxbModule.scala
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/ExtensionModule.scala
    activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/ExtensionJaxbModule.scala
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/ExtensionModule.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionJaxbModule.scala
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionModule.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/JaxbModule.scala
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-transport/src/main/java/org/apache/activemq/apollo/transport/ExtensionModule.java
    activemq/activemq-apollo/trunk/apollo-web/src/main/resources/META-INF/services/org.apache.activemq.apollo/web-module.index
      - copied, changed from r1159803, activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala
Removed:
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ExtensionModule.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueBinding.scala
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ExtensionModule.java
    activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/ExtensionModule.scala
    activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/ExtensionModule.scala
    activemq/activemq-apollo/trunk/apollo-selector/src/main/java/org/apache/activemq/apollo/filter/ExtensionModule.java
    activemq/activemq-apollo/trunk/apollo-selector/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionModule.scala
    activemq/activemq-apollo/trunk/apollo-tcp/src/main/java/org/apache/activemq/apollo/transport/tcp/ExtensionModule.java
    activemq/activemq-apollo/trunk/apollo-tcp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-transport/src/main/java/org/apache/activemq/apollo/transport/ExtensionModule.java
    activemq/activemq-apollo/trunk/apollo-transport/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Module.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/ExtensionModule.scala
Modified:
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStoreFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/CustomServiceFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/AnyProtocol.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/ProtocolFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/StoreFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala
    activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/XmlCodec.java
    activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStoreFactory.scala
    activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2StoreFactory.scala
    activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationAdvisoryRouterListener.scala
    activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolFactory.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocol.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/META-INF/services/org.apache.activemq.apollo/modules.index
    activemq/activemq-apollo/trunk/apollo-website/src/documentation/extending-guide.md

Copied: activemq/activemq-apollo/trunk/apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index (from r1159803, activemq/activemq-apollo/trunk/apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index?p2=activemq/activemq-apollo/trunk/apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index&p1=activemq/activemq-apollo/trunk/apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index (original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index Mon Aug 22 00:34:13 2011
@@ -14,4 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-org.apache.activemq.apollo.broker.store.bdb.ExtensionModule
\ No newline at end of file
+org.apache.activemq.apollo.broker.store.bdb.ExtensionJaxbModule
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStoreFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStoreFactory.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStoreFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStoreFactory.scala Mon Aug 22 00:34:13 2011
@@ -33,7 +33,7 @@ import org.apache.activemq.apollo.util._
  * 
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class BDBStoreFactory extends StoreFactory.Provider {
+class BDBStoreFactory extends StoreFactory {
 
   def create(config: StoreDTO) =  config match {
     case config:BDBStoreDTO => new BDBStore(config)

Copied: activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ExtensionJaxbModule.scala (from r1159803, activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ExtensionModule.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ExtensionJaxbModule.scala?p2=activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ExtensionJaxbModule.scala&p1=activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ExtensionModule.scala&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ExtensionModule.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ExtensionJaxbModule.scala Mon Aug 22 00:34:13 2011
@@ -1,5 +1,3 @@
-package org.apache.activemq.apollo.broker.store.bdb
-
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -16,11 +14,13 @@ package org.apache.activemq.apollo.broke
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import org.apache.activemq.apollo.util.Module
+package org.apache.activemq.apollo.broker.store.bdb
+
+import org.apache.activemq.apollo.util.JaxbModule
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class ExtensionModule extends Module {
-  override def xml_packages = Array("org.apache.activemq.apollo.broker.store.bdb.dto")
+class ExtensionJaxbModule extends JaxbModule {
+  def xml_package = "org.apache.activemq.apollo.broker.store.bdb.dto"
 }
\ No newline at end of file

Copied: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Binding.scala (from r1159803, activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueBinding.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Binding.scala?p2=activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Binding.scala&p1=activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueBinding.scala&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/QueueBinding.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Binding.scala Mon Aug 22 00:34:13 2011
@@ -24,7 +24,11 @@ import org.apache.activemq.apollo.util.p
 import java.lang.String
 import org.fusesource.hawtbuf.{Buffer, AsciiBuffer}
 import Buffer._
-import javax.management.remote.rmi._RMIConnection_Stub
+
+trait BindingFactory {
+  def create(binding_kind:AsciiBuffer, binding_data:Buffer):Binding
+  def create(binding_dto:DestinationDTO):Binding
+}
 
 /**
  * <p>
@@ -32,17 +36,12 @@ import javax.management.remote.rmi._RMIC
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-object QueueBinding {
-
-  trait Provider {
-    def create(binding_kind:AsciiBuffer, binding_data:Buffer):QueueBinding
-    def create(binding_dto:DestinationDTO):QueueBinding
-  }
+object BindingFactory {
 
-  val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/binding-factory.index",classOf[Provider])
+  val finder = new ClassFinder[BindingFactory]("META-INF/services/org.apache.activemq.apollo/binding-factory.index",classOf[BindingFactory])
 
-  def create(binding_kind:AsciiBuffer, binding_data:Buffer):QueueBinding = {
-    providers.singletons.foreach { provider=>
+  def create(binding_kind:AsciiBuffer, binding_data:Buffer):Binding = {
+    finder.singletons.foreach { provider=>
       val rc = provider.create(binding_kind, binding_data)
       if( rc!=null ) {
         return rc
@@ -50,8 +49,8 @@ object QueueBinding {
     }
     throw new IllegalArgumentException("Invalid binding type: "+binding_kind);
   }
-  def create(binding_dto:DestinationDTO):QueueBinding = {
-    providers.singletons.foreach { provider=>
+  def create(binding_dto:DestinationDTO):Binding = {
+    finder.singletons.foreach { provider=>
       val rc = provider.create(binding_dto)
       if( rc!=null ) {
         return rc
@@ -68,7 +67,7 @@ object QueueBinding {
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-trait QueueBinding {
+trait Binding {
 
   /**
    * The name of the queue (could be the queue name or a subscription id etc)
@@ -98,7 +97,7 @@ trait QueueBinding {
   override def toString: String = id
 }
 
-object QueueDomainQueueBinding extends QueueBinding.Provider {
+object QueueDomainQueueBinding extends BindingFactory {
 
   val POINT_TO_POINT_KIND = new AsciiBuffer("ptp")
   val DESTINATION_PATH = new AsciiBuffer("default");
@@ -137,7 +136,7 @@ object QueueDomainQueueBinding extends Q
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class QueueDomainQueueBinding(val binding_data:Buffer, val binding_dto:QueueDestinationDTO) extends QueueBinding {
+class QueueDomainQueueBinding(val binding_data:Buffer, val binding_dto:QueueDestinationDTO) extends Binding {
 
   import QueueDomainQueueBinding._
 
@@ -167,7 +166,7 @@ class QueueDomainQueueBinding(val bindin
 }
 
 
-object DurableSubscriptionQueueBinding extends QueueBinding.Provider {
+object DurableSubscriptionQueueBinding extends BindingFactory {
 
   val DURABLE_SUB_KIND = new AsciiBuffer("ds")
 
@@ -213,7 +212,7 @@ object DurableSubscriptionQueueBinding e
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class DurableSubscriptionQueueBinding(val binding_data:Buffer, val binding_dto:DurableSubscriptionDestinationDTO) extends QueueBinding {
+class DurableSubscriptionQueueBinding(val binding_data:Buffer, val binding_dto:DurableSubscriptionDestinationDTO) extends Binding {
   import DurableSubscriptionQueueBinding._
 
   val destination = LocalRouter.destination_parser.decode_path(binding_dto.path)
@@ -251,7 +250,7 @@ class DurableSubscriptionQueueBinding(va
 }
 
 
-object TempQueueBinding extends QueueBinding.Provider {
+object TempQueueBinding extends BindingFactory {
   val TEMP_DATA = new AsciiBuffer("")
   val TEMP_KIND = new AsciiBuffer("tmp")
   val TEMP_DTO = null
@@ -273,7 +272,7 @@ object TempQueueBinding extends QueueBin
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class TempQueueBinding(val key:AnyRef, val id:String) extends QueueBinding {
+class TempQueueBinding(val key:AnyRef, val id:String) extends Binding {
   import TempQueueBinding._
 
   def this(c:DeliveryConsumer) = this(c, c.connection.map(_.transport.getRemoteAddress.toString).getOrElse("known") )

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala Mon Aug 22 00:34:13 2011
@@ -42,19 +42,26 @@ import org.fusesource.hawtdispatch.TaskT
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-object BrokerFactory {
+trait BrokerFactory {
+  def createBroker(brokerURI:String):Broker
+}
 
-  trait Provider {
-    def createBroker(brokerURI:String):Broker
-  }
+/**
+ * <p>
+ * The BrokerFactory creates Broker objects from a URI.
+ * </p>
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+object BrokerFactory {
 
-  val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/broker-factory.index",classOf[Provider])
+  val finder = new ClassFinder[BrokerFactory]("META-INF/services/org.apache.activemq.apollo/broker-factory.index",classOf[BrokerFactory])
 
   def createBroker(uri:String):Broker = {
     if( uri == null ) {
       return null
     }
-    providers.singletons.foreach { provider=>
+    finder.singletons.foreach { provider=>
       val broker = provider.createBroker(uri)
       if( broker!=null ) {
         return broker;

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Connector.scala Mon Aug 22 00:34:13 2011
@@ -48,6 +48,10 @@ trait Connector extends BaseService {
   def status:ServiceStatusDTO
 }
 
+trait ConnectorFactory {
+  def create(broker:Broker, dto:ConnectorTypeDTO):Connector
+}
+
 /**
  * <p>
  * </p>
@@ -56,17 +60,13 @@ trait Connector extends BaseService {
  */
 object ConnectorFactory {
 
-  trait Provider {
-    def create(broker:Broker, dto:ConnectorTypeDTO):Connector
-  }
-
-  val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/connector-factory.index",classOf[Provider])
+  val finder = new ClassFinder[ConnectorFactory]("META-INF/services/org.apache.activemq.apollo/connector-factory.index",classOf[ConnectorFactory])
 
   def create(broker:Broker, dto:ConnectorTypeDTO):Connector = {
     if( dto == null ) {
       return null
     }
-    providers.singletons.foreach { provider=>
+    finder.singletons.foreach { provider=>
       val connector = provider.create(broker, dto)
       if( connector!=null ) {
         return connector;
@@ -76,7 +76,7 @@ object ConnectorFactory {
   }
 }
 
-object AcceptingConnectorFactory extends ConnectorFactory.Provider with Log {
+object AcceptingConnectorFactory extends ConnectorFactory with Log {
 
   def create(broker: Broker, dto: ConnectorTypeDTO): Connector = dto match {
     case dto:AcceptingConnectorDTO =>

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/CustomServiceFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/CustomServiceFactory.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/CustomServiceFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/CustomServiceFactory.scala Mon Aug 22 00:34:13 2011
@@ -19,6 +19,10 @@ package org.apache.activemq.apollo.broke
 import org.apache.activemq.apollo.dto.CustomServiceDTO
 import org.apache.activemq.apollo.util.{Log, Service, ClassFinder}
 
+trait CustomServiceFactory {
+  def create(broker:Broker, dto:CustomServiceDTO):Service
+}
+
 /**
  * <p>
  * </p>
@@ -27,17 +31,13 @@ import org.apache.activemq.apollo.util.{
  */
 object CustomServiceFactory {
 
-  trait Provider {
-    def create(broker:Broker, dto:CustomServiceDTO):Service
-  }
-
-  val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/custom-service-factory.index",classOf[Provider])
+  val finder = new ClassFinder[CustomServiceFactory]("META-INF/services/org.apache.activemq.apollo/custom-service-factory.index",classOf[CustomServiceFactory])
 
   def create(broker:Broker, dto:CustomServiceDTO):Service = {
     if( dto == null ) {
       return null
     }
-    providers.singletons.foreach { provider=>
+    finder.singletons.foreach { provider=>
       val service = provider.create(broker, dto)
       if( service!=null ) {
         return service;
@@ -48,7 +48,7 @@ object CustomServiceFactory {
 
 }
 
-object ReflectiveCustomServiceFactory extends CustomServiceFactory.Provider with Log {
+object ReflectiveCustomServiceFactory extends CustomServiceFactory with Log {
 
   def create(broker: Broker, dto: CustomServiceDTO): Service = {
     if( dto.getClass != classOf[CustomServiceDTO] ) {

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala Mon Aug 22 00:34:13 2011
@@ -47,6 +47,11 @@ trait RouterListener {
 
   def close
 }
+
+trait RouterListenerFactory {
+  def create(router:Router):RouterListener
+}
+
 /**
  * <p>
  * </p>
@@ -55,14 +60,10 @@ trait RouterListener {
  */
 object RouterListenerFactory {
 
-  trait Provider {
-    def create(router:Router):RouterListener
-  }
-
-  val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/router-listener-factory.index",classOf[Provider])
+  val finder = new ClassFinder[RouterListenerFactory]("META-INF/services/org.apache.activemq.apollo/router-listener-factory.index",classOf[RouterListenerFactory])
 
   def create(router:Router):List[RouterListener] = {
-    providers.singletons.map(_.create(router))
+    finder.singletons.map(_.create(router))
   }
 }
 
@@ -361,7 +362,7 @@ class LocalRouter(val virtual_host:Virtu
     def get_or_create_durable_subscription(destination:DurableSubscriptionDestinationDTO):Queue = {
       val key = destination.subscription_id
       durable_subscriptions_by_id.get( key ).getOrElse {
-        val queue = _create_queue(QueueBinding.create(destination))
+        val queue = _create_queue(BindingFactory.create(destination))
         durable_subscriptions_by_id.put(key, queue)
         queue
       }
@@ -562,7 +563,7 @@ class LocalRouter(val virtual_host:Virtu
               // We may need to update the bindings...
               if( queue.destination_dto != destination) {
 
-                val binding = QueueBinding.create(destination)
+                val binding = BindingFactory.create(destination)
                 if( queue.tune_persistent && queue.store_id == -1 ) {
 
                   val record = new QueueRecord
@@ -586,7 +587,7 @@ class LocalRouter(val virtual_host:Virtu
               }
               queue
             case None =>
-              _create_queue(QueueBinding.create(destination))
+              _create_queue(BindingFactory.create(destination))
           }
 
 
@@ -865,7 +866,7 @@ class LocalRouter(val virtual_host:Virtu
           destination.subscription_id = dto.id
           destination.path = Arrays.asList(destination_parser.parts(dto.topic) : _ *)
           destination.selector = dto.selector
-          _create_queue(QueueBinding.create(destination))
+          _create_queue(BindingFactory.create(destination))
         }
 
       }
@@ -890,7 +891,7 @@ class LocalRouter(val virtual_host:Virtu
                     // avoid blocking producers.
                     virtual_host.store.remove_queue(queue_key){x=> task.run}
                   } else {
-                    var binding = QueueBinding.create(record.binding_kind, record.binding_data)
+                    var binding = BindingFactory.create(record.binding_kind, record.binding_data)
                     if( binding.binding_dto.temp_owner != null ) {
                       // These are the temp queues clients create.
                       virtual_host.store.remove_queue(queue_key){x=> task.run}
@@ -1116,14 +1117,14 @@ class LocalRouter(val virtual_host:Virtu
   //
   /////////////////////////////////////////////////////////////////////////////
 
-  var queues_by_binding = LinkedHashMap[QueueBinding, Queue]()
+  var queues_by_binding = LinkedHashMap[Binding, Queue]()
   var queues_by_id = LinkedHashMap[String, Queue]()
 
   /**
    * Gets an existing queue.
    */
   def get_queue(dto:DestinationDTO) = dispatch_queue ! {
-    queues_by_binding.get(QueueBinding.create(dto))
+    queues_by_binding.get(BindingFactory.create(dto))
   }
 
   /**
@@ -1134,7 +1135,7 @@ class LocalRouter(val virtual_host:Virtu
   }
 
 
-  def _create_queue(binding:QueueBinding, id:Long= -1):Queue = {
+  def _create_queue(binding:Binding, id:Long= -1):Queue = {
 
     var qid = id
     if( qid == -1 ) {
@@ -1175,7 +1176,7 @@ class LocalRouter(val virtual_host:Virtu
   def destroy_queue(dto:DestinationDTO, security:SecurityContext) = dispatch_queue ! { _destroy_queue(dto, security) }
 
   def _destroy_queue(dto:DestinationDTO, security:SecurityContext):Option[String] = {
-    queues_by_binding.get(QueueBinding.create(dto)) match {
+    queues_by_binding.get(BindingFactory.create(dto)) match {
       case Some(queue) =>
         _destroy_queue(queue, security)
       case None =>

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala Mon Aug 22 00:34:13 2011
@@ -44,7 +44,7 @@ import Queue._
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class Queue(val router: LocalRouter, val store_id:Long, var binding:QueueBinding, var config:QueueDTO) extends BaseRetained with BindableDeliveryProducer with DeliveryConsumer with BaseService with DomainDestination with Dispatched {
+class Queue(val router: LocalRouter, val store_id:Long, var binding:Binding, var config:QueueDTO) extends BaseRetained with BindableDeliveryProducer with DeliveryConsumer with BaseService with DomainDestination with Dispatched {
 
   def id = binding.id
 

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala Mon Aug 22 00:34:13 2011
@@ -33,6 +33,10 @@ import security.{AclAuthorizer, JaasAuth
 import org.apache.activemq.apollo.dto._
 import store.{PersistentLongCounter, ZeroCopyBufferAllocator, Store, StoreFactory}
 
+trait VirtualHostFactory {
+  def create(broker:Broker, dto:VirtualHostDTO):VirtualHost
+}
+
 /**
  * <p>
  * </p>
@@ -41,17 +45,13 @@ import store.{PersistentLongCounter, Zer
  */
 object VirtualHostFactory {
 
-  trait Provider {
-    def create(broker:Broker, dto:VirtualHostDTO):VirtualHost
-  }
-
-  val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/virtual-host-factory.index",classOf[Provider])
+  val finder = new ClassFinder[VirtualHostFactory]("META-INF/services/org.apache.activemq.apollo/virtual-host-factory.index",classOf[VirtualHostFactory])
 
   def create(broker:Broker, dto:VirtualHostDTO):VirtualHost = {
     if( dto == null ) {
       return null
     }
-    providers.singletons.foreach { provider=>
+    finder.singletons.foreach { provider=>
       val connector = provider.create(broker, dto)
       if( connector!=null ) {
         return connector;
@@ -61,7 +61,7 @@ object VirtualHostFactory {
   }
 }
 
-object DefaultVirtualHostFactory extends VirtualHostFactory.Provider with Log {
+object DefaultVirtualHostFactory extends VirtualHostFactory with Log {
 
   def create(broker: Broker, dto: VirtualHostDTO): VirtualHost = dto match {
     case dto:VirtualHostDTO =>

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala Mon Aug 22 00:34:13 2011
@@ -25,7 +25,7 @@ import java.lang.String
 import XmlCodec._
 import org.apache.activemq.apollo.util._
 
-class XmlBrokerFactory extends BrokerFactory.Provider {
+class XmlBrokerFactory extends BrokerFactory {
 
   def createBroker(value: String): Broker = {
     try {

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala Mon Aug 22 00:34:13 2011
@@ -40,7 +40,7 @@ import java.lang.String
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-object JettyWebServerFactory extends WebServerFactory.Provider {
+object JettyWebServerFactory extends WebServerFactory {
 
   // Enabled this factory if we can load the jetty classes.
   val enabled = try {

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/AnyProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/AnyProtocol.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/AnyProtocol.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/AnyProtocol.scala Mon Aug 22 00:34:13 2011
@@ -34,9 +34,9 @@ import org.apache.activemq.apollo.transp
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class AnyProtocolFactory extends ProtocolFactory.Provider {
+class AnyProtocolFactory extends ProtocolFactory {
 
-  def all_protocols: Array[Protocol] = ((ProtocolFactory.provider.singletons.map(_.create())).filter(_.isIdentifiable)).toArray
+  def all_protocols: Array[Protocol] = ((ProtocolFactory.finder.singletons.map(_.create())).filter(_.isIdentifiable)).toArray
 
   def create() = {
     new AnyProtocol(()=>all_protocols)

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/ProtocolFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/ProtocolFactory.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/ProtocolFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/ProtocolFactory.scala Mon Aug 22 00:34:13 2011
@@ -23,6 +23,11 @@ import org.apache.activemq.apollo.dto.Co
 import org.apache.activemq.apollo.util.{Log, ClassFinder}
 import org.apache.activemq.apollo.broker.{Broker, Message, BrokerConnection}
 
+trait ProtocolFactory {
+  def create():Protocol
+  def create(config:String):Protocol
+}
+
 /**
  * <p>
  * </p>
@@ -31,15 +36,10 @@ import org.apache.activemq.apollo.broker
  */
 object ProtocolFactory {
 
-  trait Provider {
-    def create():Protocol
-    def create(config:String):Protocol
-  }
-
-  val provider = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/protocol-factory.index",classOf[Provider])
+  val finder = new ClassFinder[ProtocolFactory]("META-INF/services/org.apache.activemq.apollo/protocol-factory.index",classOf[ProtocolFactory])
 
   def get(name:String):Option[Protocol] = {
-    provider.singletons.foreach { provider=>
+    finder.singletons.foreach { provider=>
       val rc = provider.create(name)
       if( rc!=null ) {
         return Some(rc)

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/StoreFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/StoreFactory.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/StoreFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/StoreFactory.scala Mon Aug 22 00:34:13 2011
@@ -19,6 +19,10 @@ package org.apache.activemq.apollo.broke
 import org.apache.activemq.apollo.util._
 import org.apache.activemq.apollo.dto.{NullStoreDTO, StoreDTO}
 
+trait StoreFactory {
+  def create(config:StoreDTO):Store
+}
+
 /**
  * <p>
  * </p>
@@ -27,17 +31,13 @@ import org.apache.activemq.apollo.dto.{N
  */
 object StoreFactory {
 
-  trait Provider {
-    def create(config:StoreDTO):Store
-  }
-
-  val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/store-factory.index", classOf[Provider])
+  val finder = new ClassFinder[StoreFactory]("META-INF/services/org.apache.activemq.apollo/store-factory.index", classOf[StoreFactory])
 
   def create(config:StoreDTO):Store = config match {
     case null => null
     case config:NullStoreDTO => null
     case _ =>
-      providers.singletons.foreach { provider=>
+      finder.singletons.foreach { provider=>
         val rc = provider.create(config)
         if( rc!=null ) {
           return rc

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/web/WebServerFactory.scala Mon Aug 22 00:34:13 2011
@@ -29,6 +29,10 @@ trait WebServer extends Service {
   def update(on_complete:Runnable):Unit
 }
 
+trait WebServerFactory {
+  def create(broker:Broker):WebServer
+}
+
 /**
  * <p>
  * </p>
@@ -37,17 +41,13 @@ trait WebServer extends Service {
  */
 object WebServerFactory {
 
-  trait Provider {
-    def create(broker:Broker):WebServer
-  }
-
-  val providers = new ClassFinder[Provider]("META-INF/services/org.apache.activemq.apollo/web-server-factory.index",classOf[Provider])
+  val finder = new ClassFinder[WebServerFactory]("META-INF/services/org.apache.activemq.apollo/web-server-factory.index",classOf[WebServerFactory])
 
   def create(broker:Broker):WebServer = {
     if( broker == null ) {
       return null
     }
-    providers.singletons.foreach { provider=>
+    finder.singletons.foreach { provider=>
       val rc = provider.create(broker)
       if( rc!=null ) {
         return rc

Modified: activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index (original)
+++ activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index Mon Aug 22 00:34:13 2011
@@ -14,4 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-org.apache.activemq.apollo.broker.store.cassandra.ExtensionModule
\ No newline at end of file
+org.apache.activemq.apollo.broker.store.cassandra.ExtensionJaxbModule
\ No newline at end of file

Copied: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/PrimaryJaxbModule.java (from r1159803, activemq/activemq-apollo/trunk/apollo-selector/src/main/java/org/apache/activemq/apollo/filter/ExtensionModule.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/PrimaryJaxbModule.java?p2=activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/PrimaryJaxbModule.java&p1=activemq/activemq-apollo/trunk/apollo-selector/src/main/java/org/apache/activemq/apollo/filter/ExtensionModule.java&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-selector/src/main/java/org/apache/activemq/apollo/filter/ExtensionModule.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/PrimaryJaxbModule.java Mon Aug 22 00:34:13 2011
@@ -14,9 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.filter;
+package org.apache.activemq.apollo.dto;
 
-import org.apache.activemq.apollo.util.Module;
+import org.apache.activemq.apollo.util.JaxbModule;
 
 /**
  * <p>
@@ -24,10 +24,8 @@ import org.apache.activemq.apollo.util.M
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-public class ExtensionModule extends Module {
-
-    public String name() {
-        return "apollo-selector";
+public class PrimaryJaxbModule implements JaxbModule {
+    public String xml_package() {
+        return "org.apache.activemq.apollo.dto";
     }
-
 }

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/XmlCodec.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/XmlCodec.java?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/XmlCodec.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/XmlCodec.java Mon Aug 22 00:34:13 2011
@@ -17,8 +17,7 @@
 package org.apache.activemq.apollo.dto;
 
 import org.apache.activemq.apollo.util.ClassFinder;
-import org.apache.activemq.apollo.util.Module;
-import org.apache.activemq.apollo.util.ModuleRegistry;
+import org.apache.activemq.apollo.util.JaxbModule$;
 import org.xml.sax.SAXException;
 
 import javax.xml.XMLConstants;
@@ -90,15 +89,8 @@ public class XmlCodec {
     }
 
     private static JAXBContext createContext() throws JAXBException {
-        HashSet<String> names = new HashSet<String>();
-        for( Module m: ModuleRegistry.jsingletons()) {
-            for( String p:m.xml_packages() ) {
-                names.add(p);
-            }
-        }
-
         String packages = "";
-        for ( String p : names) {
+        for ( String p : JaxbModule$.MODULE$.packages()) {
             if( packages.length() !=0 ) {
                 packages += ":";
             }

Copied: activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index (from r1159803, activemq/activemq-apollo/trunk/apollo-web/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index?p2=activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index&p1=activemq/activemq-apollo/trunk/apollo-web/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index Mon Aug 22 00:34:13 2011
@@ -14,4 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-org.apache.activemq.apollo.web.ExtensionModule
\ No newline at end of file
+org.apache.activemq.apollo.dto.PrimaryJaxbModule
\ No newline at end of file

Copied: activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index (from r1159803, activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index?p2=activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index&p1=activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cassandra/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index (original)
+++ activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index Mon Aug 22 00:34:13 2011
@@ -14,4 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-org.apache.activemq.apollo.broker.store.cassandra.ExtensionModule
\ No newline at end of file
+org.apache.activemq.apollo.broker.store.hawtdb.ExtensionJaxbModule
\ No newline at end of file

Copied: activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/ExtensionJaxbModule.scala (from r1159803, activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/ExtensionModule.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/ExtensionJaxbModule.scala?p2=activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/ExtensionJaxbModule.scala&p1=activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/ExtensionModule.scala&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/ExtensionModule.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/ExtensionJaxbModule.scala Mon Aug 22 00:34:13 2011
@@ -1,5 +1,3 @@
-package org.apache.activemq.apollo.broker.store.hawtdb
-
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -16,11 +14,13 @@ package org.apache.activemq.apollo.broke
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import org.apache.activemq.apollo.util.Module
+package org.apache.activemq.apollo.broker.store.hawtdb
+
+import org.apache.activemq.apollo.util.JaxbModule
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class ExtensionModule extends Module {
-  override def xml_packages = Array("org.apache.activemq.apollo.broker.store.hawtdb.dto")
+class ExtensionJaxbModule extends JaxbModule {
+  def xml_package = "org.apache.activemq.apollo.broker.store.hawtdb.dto"
 }
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStoreFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStoreFactory.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStoreFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/scala/org/apache/activemq/apollo/broker/store/hawtdb/HawtDBStoreFactory.scala Mon Aug 22 00:34:13 2011
@@ -33,7 +33,7 @@ import org.apache.activemq.apollo.util._
  * 
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class HawtDBStoreFactory extends StoreFactory.Provider {
+class HawtDBStoreFactory extends StoreFactory {
 
   def create(config: StoreDTO) = config match {
     case config:HawtDBStoreDTO => new HawtDBStore(config)

Copied: activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index (from r1159803, activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index?p2=activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index&p1=activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-hawtdb/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index (original)
+++ activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index Mon Aug 22 00:34:13 2011
@@ -14,4 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-org.apache.activemq.apollo.broker.store.hawtdb.ExtensionModule
\ No newline at end of file
+org.apache.activemq.apollo.broker.store.jdbm2.ExtensionJaxbModule
\ No newline at end of file

Copied: activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/ExtensionJaxbModule.scala (from r1159803, activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/ExtensionModule.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/ExtensionJaxbModule.scala?p2=activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/ExtensionJaxbModule.scala&p1=activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/ExtensionModule.scala&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/ExtensionModule.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/ExtensionJaxbModule.scala Mon Aug 22 00:34:13 2011
@@ -1,5 +1,3 @@
-package org.apache.activemq.apollo.broker.store.jdbm2
-
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -16,11 +14,13 @@ package org.apache.activemq.apollo.broke
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import org.apache.activemq.apollo.util.Module
+package org.apache.activemq.apollo.broker.store.jdbm2
+
+import org.apache.activemq.apollo.util.JaxbModule
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class ExtensionModule extends Module {
-  override def xml_packages = Array("org.apache.activemq.apollo.broker.store.jdbm2.dto")
+class ExtensionJaxbModule extends JaxbModule {
+  def xml_package = "org.apache.activemq.apollo.broker.store.jdbm2.dto"
 }
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2StoreFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2StoreFactory.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2StoreFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-jdbm2/src/main/scala/org/apache/activemq/apollo/broker/store/jdbm2/JDBM2StoreFactory.scala Mon Aug 22 00:34:13 2011
@@ -29,7 +29,7 @@ import org.apache.activemq.apollo.util._
  * 
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class JDBM2StoreFactory extends StoreFactory.Provider {
+class JDBM2StoreFactory extends StoreFactory {
 
   def create(config: StoreDTO) = config match {
     case config:JDBM2StoreDTO =>

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationAdvisoryRouterListener.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationAdvisoryRouterListener.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationAdvisoryRouterListener.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/DestinationAdvisoryRouterListener.scala Mon Aug 22 00:34:13 2011
@@ -34,7 +34,7 @@ import org.fusesource.hawtdispatch._
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-object DestinationAdvisoryRouterListenerFactory extends RouterListenerFactory.Provider {
+object DestinationAdvisoryRouterListenerFactory extends RouterListenerFactory {
   def create(router: Router) = new DestinationAdvisoryRouterListener(router)
 }
 

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolFactory.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolFactory.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireProtocolFactory.scala Mon Aug 22 00:34:13 2011
@@ -30,7 +30,7 @@ import org.fusesource.hawtbuf.Buffer
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-object OpenwireProtocolFactory extends ProtocolFactory.Provider {
+object OpenwireProtocolFactory extends ProtocolFactory {
 
   def create() = OpenwireProtocol
 

Copied: activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index (from r1159803, activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index?p2=activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index&p1=activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/resources/META-INF/services/org.apache.activemq.apollo/jaxb-module.index Mon Aug 22 00:34:13 2011
@@ -14,4 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-org.apache.activemq.apollo.stomp.ExtensionModule
\ No newline at end of file
+org.apache.activemq.apollo.stomp.ExtensionJaxbModule
\ No newline at end of file

Copied: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionJaxbModule.scala (from r1159803, activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionModule.scala)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionJaxbModule.scala?p2=activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionJaxbModule.scala&p1=activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionModule.scala&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionModule.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/ExtensionJaxbModule.scala Mon Aug 22 00:34:13 2011
@@ -1,5 +1,3 @@
-package org.apache.activemq.apollo.stomp
-
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -16,11 +14,13 @@ package org.apache.activemq.apollo.stomp
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import org.apache.activemq.apollo.util.Module
+package org.apache.activemq.apollo.stomp
+
+import org.apache.activemq.apollo.util.JaxbModule
 
 /**
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-class ExtensionModule extends Module {
-  override def xml_packages = Array("org.apache.activemq.apollo.stomp.dto")
+class ExtensionJaxbModule extends JaxbModule {
+  def xml_package = "org.apache.activemq.apollo.stomp.dto"
 }
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocol.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocol.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocol.scala Mon Aug 22 00:34:13 2011
@@ -51,7 +51,7 @@ class StompProtocolCodecFactory extends 
   }
 }
 
-class StompProtocolFactory extends ProtocolFactory.Provider {
+class StompProtocolFactory extends ProtocolFactory {
 
   def create() = StompProtocol
 

Copied: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/JaxbModule.scala (from r1159803, activemq/activemq-apollo/trunk/apollo-transport/src/main/java/org/apache/activemq/apollo/transport/ExtensionModule.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/JaxbModule.scala?p2=activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/JaxbModule.scala&p1=activemq/activemq-apollo/trunk/apollo-transport/src/main/java/org/apache/activemq/apollo/transport/ExtensionModule.java&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-transport/src/main/java/org/apache/activemq/apollo/transport/ExtensionModule.java (original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/JaxbModule.scala Mon Aug 22 00:34:13 2011
@@ -14,9 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activemq.apollo.transport;
+package org.apache.activemq.apollo.util
 
-import org.apache.activemq.apollo.util.Module;
+/**
+ * <p>
+ * </p>
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+trait JaxbModule {
+  def xml_package:String
+}
 
 /**
  * <p>
@@ -24,10 +32,10 @@ import org.apache.activemq.apollo.util.M
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-public class ExtensionModule extends Module {
+object JaxbModule {
 
-    public String name() {
-        return "apollo-transport";
-    }
+  val finder = new ClassFinder[JaxbModule]("META-INF/services/org.apache.activemq.apollo/jaxb-module.index",classOf[JaxbModule])
+  val packages = finder.singletons.map(_.xml_package).toArray
 
 }
+

Copied: activemq/activemq-apollo/trunk/apollo-web/src/main/resources/META-INF/services/org.apache.activemq.apollo/web-module.index (from r1159803, activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index)
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/resources/META-INF/services/org.apache.activemq.apollo/web-module.index?p2=activemq/activemq-apollo/trunk/apollo-web/src/main/resources/META-INF/services/org.apache.activemq.apollo/web-module.index&p1=activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index&r1=1159803&r2=1160087&rev=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/resources/META-INF/services/org.apache.activemq.apollo/modules.index (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/resources/META-INF/services/org.apache.activemq.apollo/web-module.index Mon Aug 22 00:34:13 2011
@@ -14,4 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-org.apache.activemq.apollo.dto.ExtensionModule
\ No newline at end of file
+org.apache.activemq.apollo.web.DefaultWebModule
\ No newline at end of file

Added: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala?rev=1160087&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala (added)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/WebModule.scala Mon Aug 22 00:34:13 2011
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.apollo.web
+
+import org.apache.activemq.apollo.util.ClassFinder
+import resources.BrokerResource
+import collection.immutable.TreeMap
+
+trait WebModule {
+  def priority:Int
+  def web_resources: Map[String, ()=>AnyRef]
+  def root_redirect:String
+}
+
+/**
+ * <p>
+ * </p>
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+object WebModule {
+
+  val finder = new ClassFinder[WebModule]("META-INF/services/org.apache.activemq.apollo/web-module.index",classOf[WebModule])
+
+  val (root_redirect, web_resources) = {
+
+    // sort by priority.  Highest priority wins.
+    val sorted = TreeMap(finder.singletons.map(x=> x.priority -> x): _*).values
+    val web_resources = sorted.foldLeft(Map[String, ()=>AnyRef]()) { case (map, provider) =>
+      map ++ provider.web_resources
+    }
+    (sorted.last.root_redirect, web_resources)
+  }
+
+
+}
+
+object DefaultWebModule extends WebModule {
+
+  def priority: Int = 100
+
+  def create_broker_resource() = new BrokerResource
+  override def web_resources = Map("broker" -> create_broker_resource _ )
+
+  def root_redirect: String = "broker"
+
+}
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/RootResource.scala Mon Aug 22 00:34:13 2011
@@ -18,39 +18,23 @@ package org.apache.activemq.apollo.web.r
 
 import javax.ws.rs._
 import core.Response.Status._
-import core.{Response, UriInfo, Context}
-import org.apache.activemq.apollo.util.ModuleRegistry
-import collection.mutable.HashMap
+import core.Response
 import javax.servlet.http.HttpServletRequest
 import com.sun.jersey.server.impl.ThreadLocalInvoker
+import org.apache.activemq.apollo.web.WebModule
 
-object RootResource {
-
-  // Load up all extension module web resources..
-  val web_resources:Map[String, ()=>AnyRef] = {
-    val rc = HashMap[String, ()=>AnyRef]()
-    for (m <- ModuleRegistry.singletons ) {
-      m.web_resources.foreach { case (key,value) =>
-        rc.put(key, value)
-      }
-    }
-    rc.toMap
-  }
-
-}
 /**
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 @Path("/")
 case class RootResource() extends Resource() {
-
-  import RootResource._
+  import WebModule._
 
   @GET
   @Produces(Array("application/json", "application/xml","text/xml","text/html"))
   def post_connection_shutdown_and_redirect() = {
-    Response.seeOther(strip_resolve("broker")).build
+    Response.seeOther(strip_resolve(root_redirect)).build
   }
 
   @Path("{name}")

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/META-INF/services/org.apache.activemq.apollo/modules.index
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/META-INF/services/org.apache.activemq.apollo/modules.index?rev=1160087&r1=1160086&r2=1160087&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/META-INF/services/org.apache.activemq.apollo/modules.index (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/META-INF/services/org.apache.activemq.apollo/modules.index Mon Aug 22 00:34:13 2011
@@ -14,4 +14,4 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
-org.apache.activemq.apollo.web.ExtensionModule
\ No newline at end of file
+org.apache.activemq.apollo.web.ExtensionJaxbModule
\ No newline at end of file

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=1160087&r1=1160086&r2=1160087&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 Aug 22 00:34:13 2011
@@ -23,17 +23,17 @@ Example module class:
 
 {pygmentize:: scala}
 package org.example
-import org.apache.activemq.apollo.util.Module
+import org.apache.activemq.apollo.util.JaxbModule
 
-class ExtensionModule extends Module {
-  override def xml_packages = Array("org.example.dto")
+class ExtensionJaxbModule extends JaxbModule {
+  def xml_package = "org.example.dto"
 }
 {pygmentize}
 
 
-Example `META-INF/services/org.apache.activemq.apollo/modules.index` resource:
+Example `META-INF/services/org.apache.activemq.apollo/jaxb-module.index` resource:
 
-    org.example.ExtensionModule
+    org.example.ExtensionJaxbModule
 
 ### Plugging into the Broker Lifecycle
 



Mime
View raw message