activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1508923 - in /activemq/activemq-apollo/trunk: apollo-amqp/src/main/scala/org/apache/activemq/apollo/amqp/ apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protoc...
Date Wed, 31 Jul 2013 15:30:52 GMT
Author: chirino
Date: Wed Jul 31 15:30:51 2013
New Revision: 1508923

URL: http://svn.apache.org/r1508923
Log:
Pass the connector object to the createProtocolHandler method so that a protocol can use config
details to control the creation the protocol handler instance.

Modified:
    activemq/activemq-apollo/trunk/apollo-amqp/src/main/scala/org/apache/activemq/apollo/amqp/AmqpProtocol.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/protocol/AnyProtocol.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/Protocol.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/SslProtocol.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/UdpProtocol.scala
    activemq/activemq-apollo/trunk/apollo-mqtt/src/main/java/org/apache/activemq/apollo/mqtt/MqttProtocol.java
    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-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala

Modified: activemq/activemq-apollo/trunk/apollo-amqp/src/main/scala/org/apache/activemq/apollo/amqp/AmqpProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-amqp/src/main/scala/org/apache/activemq/apollo/amqp/AmqpProtocol.scala?rev=1508923&r1=1508922&r2=1508923&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-amqp/src/main/scala/org/apache/activemq/apollo/amqp/AmqpProtocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-amqp/src/main/scala/org/apache/activemq/apollo/amqp/AmqpProtocol.scala
Wed Jul 31 15:30:51 2013
@@ -44,7 +44,7 @@ object AmqpProtocol extends Protocol {
     }
   }
 
-  def createProtocolHandler = new AmqpProtocolHandler
+  def createProtocolHandler(connector:Connector) = new AmqpProtocolHandler
 }
 
 //object AmqpMessageCodecFactory extends MessageCodecFactory.Provider {

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=1508923&r1=1508922&r2=1508923&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
Wed Jul 31 15:30:51 2013
@@ -184,7 +184,7 @@ class AcceptingConnector(val broker:Brok
       connected.incrementAndGet()
       var connection = new BrokerConnection(AcceptingConnector.this, broker.connection_id_counter.incrementAndGet)
       connection.dispatch_queue.setLabel("connection %d to %s".format(connection.id, transport.getRemoteAddress))
-      connection.protocol_handler = protocol.createProtocolHandler
+      connection.protocol_handler = protocol.createProtocolHandler(AcceptingConnector.this)
       connection.transport = transport
 
       broker.connections.put(connection.id, connection)

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=1508923&r1=1508922&r2=1508923&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
Wed Jul 31 15:30:51 2013
@@ -40,7 +40,7 @@ object AnyProtocol extends BaseProtocol 
 
   def createProtocolCodec(connector:Connector) = new AnyProtocolCodec(connector)
 
-  def createProtocolHandler = new AnyProtocolHandler
+  def createProtocolHandler(connector:Connector) = new AnyProtocolHandler
 
   def change_protocol_codec(transport:Transport, codec:ProtocolCodec) = {
     var current = transport.getProtocolCodec
@@ -148,7 +148,7 @@ class AnyProtocolHandler extends Protoco
 
     var protocol: ProtocolDetected = command.asInstanceOf[ProtocolDetected];
     val protocol_handler = ProtocolFactory.get(protocol.id) match {
-      case Some(x) => x.createProtocolHandler
+      case Some(x) => x.createProtocolHandler(connection.connector)
       case None =>
         throw new ProtocolException("No protocol handler available for protocol: " + protocol.id);
     }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/Protocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/Protocol.scala?rev=1508923&r1=1508922&r2=1508923&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/Protocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/Protocol.scala
Wed Jul 31 15:30:51 2013
@@ -20,13 +20,14 @@ import java.io.IOException
 import org.apache.activemq.apollo.broker.store.MessageRecord
 import org.fusesource.hawtdispatch._
 import org.apache.activemq.apollo.util.{Log, ClassFinder}
-import org.apache.activemq.apollo.broker.{Broker, Message, BrokerConnection}
+import org.apache.activemq.apollo.broker.{Connector, Broker, Message, BrokerConnection}
 import org.apache.activemq.apollo.dto.{SimpleProtocolFilterDTO, ProtocolFilterDTO, ConnectionStatusDTO}
 import org.fusesource.hawtbuf.Buffer
 import scala.collection.mutable.ListBuffer
+import org.fusesource.hawtdispatch.transport.ProtocolCodec
 
 trait Protocol extends ProtocolCodecFactory.Provider {
-  def createProtocolHandler:ProtocolHandler
+  def createProtocolHandler(connector: Connector):ProtocolHandler
 }
 
 abstract class BaseProtocol extends Protocol {

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/SslProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/SslProtocol.scala?rev=1508923&r1=1508922&r2=1508923&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/SslProtocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/SslProtocol.scala
Wed Jul 31 15:30:51 2013
@@ -88,5 +88,5 @@ class SslProtocol extends Protocol {
     rc
   }
 
-  def createProtocolHandler = new AnyProtocolHandler
+  def createProtocolHandler(connector:Connector) = new AnyProtocolHandler
 }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/UdpProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/UdpProtocol.scala?rev=1508923&r1=1508922&r2=1508923&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/UdpProtocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/UdpProtocol.scala
Wed Jul 31 15:30:51 2013
@@ -294,7 +294,7 @@ class UdpProtocol extends BaseProtocol {
   def id = "udp"
   def createProtocolCodec(connector:Connector):ProtocolCodec = new UdpProtocolCodec()
 
-  def createProtocolHandler:ProtocolHandler = new UdpProtocolHandler {
+  def createProtocolHandler(connector:Connector):ProtocolHandler = new UdpProtocolHandler
{
     type ConfigTypeDTO = UdpDTO
     def configClass = classOf[ConfigTypeDTO]
 

Modified: activemq/activemq-apollo/trunk/apollo-mqtt/src/main/java/org/apache/activemq/apollo/mqtt/MqttProtocol.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-mqtt/src/main/java/org/apache/activemq/apollo/mqtt/MqttProtocol.java?rev=1508923&r1=1508922&r2=1508923&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-mqtt/src/main/java/org/apache/activemq/apollo/mqtt/MqttProtocol.java
(original)
+++ activemq/activemq-apollo/trunk/apollo-mqtt/src/main/java/org/apache/activemq/apollo/mqtt/MqttProtocol.java
Wed Jul 31 15:30:51 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.apollo.mqtt;
 
+import org.apache.activemq.apollo.broker.Connector;
 import org.apache.activemq.apollo.broker.DestinationParser;
 import org.apache.activemq.apollo.broker.protocol.Protocol;
 import org.apache.activemq.apollo.broker.protocol.ProtocolHandler;
@@ -45,7 +46,7 @@ public class MqttProtocol extends MqttPr
 
 
     @Override
-    public ProtocolHandler createProtocolHandler() {
+    public ProtocolHandler createProtocolHandler(Connector connector) {
         return new MqttProtocolHandler();
     }
 }

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=1508923&r1=1508922&r2=1508923&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
Wed Jul 31 15:30:51 2013
@@ -31,7 +31,7 @@ import org.apache.activemq.apollo.util.L
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 object OpenwireProtocol extends OpenwireProtocolCodecFactory with Protocol with Log {
-  def createProtocolHandler = new OpenwireProtocolHandler
+  def createProtocolHandler(connector:Connector) = new OpenwireProtocolHandler
 }
 
 object OpenwireMessageCodecFactory extends MessageCodecFactory.Provider {

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=1508923&r1=1508922&r2=1508923&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
Wed Jul 31 15:30:51 2013
@@ -53,7 +53,7 @@ class StompProtocolCodecFactory extends 
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 object StompProtocol extends StompProtocolCodecFactory with Protocol {
-  def createProtocolHandler = new StompProtocolHandler
+  def createProtocolHandler(connector:Connector) = new StompProtocolHandler
 }
 
 object StompMessageCodecFactory extends MessageCodecFactory.Provider {

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala?rev=1508923&r1=1508922&r2=1508923&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
Wed Jul 31 15:30:51 2013
@@ -33,7 +33,7 @@ class StompUdpProtocol extends UdpProtoc
 
   override def id = "stomp-udp"
 
-  override def createProtocolHandler = new UdpProtocolHandler {
+  override def createProtocolHandler(connector:Connector) = new UdpProtocolHandler {
 
     type ConfigTypeDTO = StompDTO
     def configClass = classOf[ConfigTypeDTO]



Mime
View raw message