activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r961221 - in /activemq/sandbox/activemq-apollo-actor: activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/ activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/ activemq-brok...
Date Wed, 07 Jul 2010 04:28:01 GMT
Author: chirino
Date: Wed Jul  7 04:28:00 2010
New Revision: 961221

URL: http://svn.apache.org/viewvc?rev=961221&view=rev
Log:
moving more stuff into the activemq.apollo namespace.

Added:
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/brokers
      - copied, changed from r961220, activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/apollo/broker/xml
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/ssl
      - copied, changed from r961220, activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/resources/META-INF/services/org/apache/activemq/transport/ssl
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/tcp
      - copied, changed from r961220, activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/resources/META-INF/services/org/apache/activemq/transport/tcp
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/vm
      - copied, changed from r961220, activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/transport/vm
Removed:
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/apollo/broker/xml
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/transport/vm
    activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/resources/META-INF/services/org/apache/activemq/transport/ssl
    activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/resources/META-INF/services/org/apache/activemq/transport/tcp
Modified:
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
    activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
    activemq/sandbox/activemq-apollo-actor/activemq-transport/src/main/java/org/apache/activemq/apollo/transport/TransportFactory.java

Copied: activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/brokers
(from r961220, activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/apollo/broker/xml)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/brokers?p2=activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/brokers&p1=activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/apollo/broker/xml&r1=961220&r2=961221&rev=961221&view=diff
==============================================================================
    (empty)

Copied: activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/ssl
(from r961220, activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/resources/META-INF/services/org/apache/activemq/transport/ssl)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/ssl?p2=activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/ssl&p1=activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/resources/META-INF/services/org/apache/activemq/transport/ssl&r1=961220&r2=961221&rev=961221&view=diff
==============================================================================
    (empty)

Copied: activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/tcp
(from r961220, activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/resources/META-INF/services/org/apache/activemq/transport/tcp)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/tcp?p2=activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/tcp&p1=activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/resources/META-INF/services/org/apache/activemq/transport/tcp&r1=961220&r2=961221&rev=961221&view=diff
==============================================================================
    (empty)

Copied: activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/vm
(from r961220, activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/transport/vm)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/vm?p2=activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org.apache.activemq.apollo/transports/vm&p1=activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/resources/META-INF/services/org/apache/activemq/transport/vm&r1=961220&r2=961221&rev=961221&view=diff
==============================================================================
    (empty)

Modified: activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala?rev=961221&r1=961220&r2=961221&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
(original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
Wed Jul  7 04:28:00 2010
@@ -30,7 +30,6 @@ import java.util.concurrent.ConcurrentHa
 import org.apache.activemq.apollo.util._
 import ReporterLevel._
 
-
 /**
  * <p>
  * The BrokerFactory creates Broker objects from a URI.
@@ -40,39 +39,36 @@ import ReporterLevel._
  */
 object BrokerFactory {
 
-    val BROKER_FACTORY_HANDLER_FINDER = new FactoryFinder("META-INF/services/org/apache/activemq/apollo/broker/");
-
-    trait Handler {
-        def createBroker(brokerURI:String):Broker
-    }
+  val finder = ClassFinder[SPI]("META-INF/services/org.apache.activemq.apollo/brokers")
+  var spis = List[SPI]()
 
+  trait SPI {
+    def createBroker(brokerURI:String):Broker
+  }
 
-    def createHandler(name:String):Handler = {
-      BROKER_FACTORY_HANDLER_FINDER.newInstance(name).asInstanceOf[Handler]
+  finder.find.foreach{ clazz =>
+    try {
+      spis ::= clazz.newInstance.asInstanceOf[SPI]
+    } catch {
+      case e:Throwable => e.printStackTrace
     }
+  }
 
-    /**
-     * Creates a broker from a URI configuration
-     *
-     * @param brokerURI the URI scheme to configure the broker
-     * @param startBroker whether or not the broker should have its
-     *                {@link Broker#start()} method called after
-     *                construction
-     * @throws Exception
-     */
-    def createBroker(brokerURI:String, startBroker:Boolean=false):Broker = {
-      var scheme = FactoryFinder.getScheme(brokerURI)
-      if (scheme==null ) {
-          throw new IllegalArgumentException("Invalid broker URI, no scheme specified: "
+ brokerURI)
-      }
-      var handler = createHandler(scheme)
-      var broker = handler.createBroker(brokerURI)
-      if (startBroker) {
+  def createBroker(uri:String, start:Boolean=false):Broker = {
+    if( uri == null ) {
+      return null
+    }
+    spis.foreach { spi=>
+      val broker = spi.createBroker(uri)
+      if( broker!=null ) {
+        if (start) {
           broker.start();
+        }
+        return broker
       }
-      return broker;
     }
-
+    throw new IllegalArgumentException("Uknonwn broker uri: "+uri)
+  }
 }
 
 

Modified: activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala?rev=961221&r1=961220&r2=961221&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
(original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-broker/src/main/scala/org/apache/activemq/apollo/broker/jaxb/XmlBrokerFactory.scala
Wed Jul  7 04:28:00 2010
@@ -17,17 +17,14 @@
 package org.apache.activemq.apollo.jaxb
 
 import java.io.IOException
-import javax.xml.bind.JAXBContext
-import javax.xml.stream.XMLInputFactory
 import java.net.{URL, URI}
 import org.apache.activemq.apollo.broker._
-import jaxb.PropertiesReader
 import org.apache.activemq.apollo.dto._
 import java.lang.String
 import XmlEncoderDecoder._
 import org.apache.activemq.apollo.util._
 
-class XmlBrokerFactory extends BrokerFactory.Handler {
+class XmlBrokerFactory extends BrokerFactory.SPI {
 
   def createBroker(value: String): Broker = {
     try {

Modified: activemq/sandbox/activemq-apollo-actor/activemq-transport/src/main/java/org/apache/activemq/apollo/transport/TransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-transport/src/main/java/org/apache/activemq/apollo/transport/TransportFactory.java?rev=961221&r1=961220&r2=961221&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-transport/src/main/java/org/apache/activemq/apollo/transport/TransportFactory.java
(original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-transport/src/main/java/org/apache/activemq/apollo/transport/TransportFactory.java
Wed Jul  7 04:28:00 2010
@@ -28,7 +28,7 @@ import java.util.concurrent.ConcurrentHa
  */
 public class TransportFactory {
 
-    private static final FactoryFinder TRANSPORT_FACTORY_FINDER = new FactoryFinder("META-INF/services/org/apache/activemq/transport/");
+    private static final FactoryFinder TRANSPORT_FACTORY_FINDER = new FactoryFinder("META-INF/services/org.apache.activemq.apollo/transports/");
     private static final ConcurrentHashMap<String, TransportFactorySPI> TRANSPORT_FACTORYS
= new ConcurrentHashMap<String, TransportFactorySPI>();
 
     public interface TransportFactorySPI {



Mime
View raw message