activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r427507 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker: AbstractConnection.java ConnectionContext.java
Date Tue, 01 Aug 2006 09:50:46 GMT
Author: jstrachan
Date: Tue Aug  1 02:50:46 2006
New Revision: 427507

URL: http://svn.apache.org/viewvc?rev=427507&view=rev
Log:
a minor refactor to make it easier to extend ConnectionInfo/ConnectionContext without having
to change code in the AbstractConnection in the future - such as to support new certificate
or security token mechanisms. For background see thread: http://www.nabble.com/Certificate-login-tf2029724.html#a5583011

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java?rev=427507&r1=427506&r2=427507&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
Tue Aug  1 02:50:46 2006
@@ -541,19 +541,15 @@
     
     public Response processAddConnection(ConnectionInfo info) throws Exception {
         // Setup the context.
-        String clientId = info.getClientId();
-        ConnectionContext context = new ConnectionContext();
+        ConnectionContext context = new ConnectionContext(info);
         context.setConnection(this);
         context.setBroker(broker);
         context.setConnector(connector);
         context.setTransactions(new ConcurrentHashMap());
-        context.setClientId(clientId);
-        context.setUserName(info.getUserName());
-        context.setConnectionId(info.getConnectionId());
         context.setWireFormatInfo(wireFormatInfo);
         this.manageable = info.isManageable();
         connectionStates.put(info.getConnectionId(), new ConnectionState(info, context));
-       
+        
         
         broker.addConnection(context, info);
         if (info.isManageable() && broker.isFaultTolerantConfiguration()){

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java?rev=427507&r1=427506&r2=427507&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java
Tue Aug  1 02:50:46 2006
@@ -21,6 +21,7 @@
 
 import org.apache.activemq.broker.region.MessageReference;
 import org.apache.activemq.command.ConnectionId;
+import org.apache.activemq.command.ConnectionInfo;
 import org.apache.activemq.command.WireFormatInfo;
 import org.apache.activemq.filter.MessageEvaluationContext;
 import org.apache.activemq.security.MessageAuthorizationPolicy;
@@ -54,6 +55,15 @@
     
     private final MessageEvaluationContext messageEvaluationContext = new MessageEvaluationContext();
     
+    public ConnectionContext() {
+    }
+    
+    public ConnectionContext(ConnectionInfo info) {
+        setClientId(info.getClientId());
+        setUserName(info.getUserName());
+        setConnectionId(info.getConnectionId());
+    }
+
     public SecurityContext getSecurityContext() {
         return securityContext;
     }



Mime
View raw message