activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject [06/14] git commit: Adding a method to broker to get the socket address for a specific connector id.
Date Fri, 11 Oct 2013 19:14:10 GMT
Adding a method to broker to get the socket address for a specific connector id.

git-svn-id: https://svn.apache.org/repos/asf/activemq/activemq-apollo/trunk@1508926 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/activemq-apollo/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-apollo/commit/9090300c
Tree: http://git-wip-us.apache.org/repos/asf/activemq-apollo/tree/9090300c
Diff: http://git-wip-us.apache.org/repos/asf/activemq-apollo/diff/9090300c

Branch: refs/heads/trunk
Commit: 9090300c2067612a442479fc51330ec9c085fb1b
Parents: 29c60ea
Author: Hiram R. Chirino <chirino@apache.org>
Authored: Wed Jul 31 15:31:06 2013 +0000
Committer: Hiram R. Chirino <chirino@apache.org>
Committed: Wed Jul 31 15:31:06 2013 +0000

----------------------------------------------------------------------
 .../org/apache/activemq/apollo/broker/Broker.scala     | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-apollo/blob/9090300c/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
----------------------------------------------------------------------
diff --git a/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala b/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
index 851850a..2582ca5 100644
--- a/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
+++ b/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
@@ -719,12 +719,17 @@ class Broker() extends BaseService with SecuredResource with PluginStateSupport
     }
   }
 
-  def get_socket_address = {
-    first_accepting_connector.get.socket_address
-  }
-
+  def get_socket_address = first_accepting_connector.get.socket_address
   def first_accepting_connector = connectors.values.find(_.isInstanceOf[AcceptingConnector]).map(_.asInstanceOf[AcceptingConnector])
 
+  def get_socket_address(id:String) = accepting_connector(id).get.socket_address
+  def accepting_connector(id:String) = {
+    connectors.values.find( _ match {
+      case connector:AcceptingConnector => connector.id == id
+      case _ => false
+    }).map(_.asInstanceOf[AcceptingConnector])
+  }
+
   def ssl_context(protocol:String) = {
     val rc = SSLContext.getInstance(protocol);
     if( key_storage!=null ) {


Mime
View raw message