activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r631241 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker: Connection.java ConnectionContext.java TransportConnection.java
Date Tue, 26 Feb 2008 14:56:32 GMT
Author: rajdavies
Date: Tue Feb 26 06:56:31 2008
New Revision: 631241

URL: http://svn.apache.org/viewvc?rev=631241&view=rev
Log:
Added network and fault tolerant flags to ConnectionContext

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Connection.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Connection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Connection.java?rev=631241&r1=631240&r2=631241&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Connection.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/Connection.java
Tue Feb 26 06:56:31 2008
@@ -104,5 +104,11 @@
     void serviceExceptionAsync(IOException e);
 
     String getConnectionId();
+    
+    /**
+     * return true if a network connection
+     * @return
+     */
+    boolean isNetworkConnection();
 
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java?rev=631241&r1=631240&r2=631241&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConnectionContext.java
Tue Feb 26 06:56:31 2008
@@ -53,6 +53,7 @@
     private boolean producerFlowControl = true;
     private MessageAuthorizationPolicy messageAuthorizationPolicy;
     private boolean networkConnection;
+    private boolean faultTolerant;
     private final AtomicBoolean stopping = new AtomicBoolean();
     private final MessageEvaluationContext messageEvaluationContext = new MessageEvaluationContext();
     private boolean dontSendReponse;
@@ -277,5 +278,13 @@
      */
     public void setClientMaster(boolean clientMaster) {
         this.clientMaster = clientMaster;
+    }
+
+    public boolean isFaultTolerant() {
+        return faultTolerant;
+    }
+
+    public void setFaultTolerant(boolean faultTolerant) {
+        this.faultTolerant = faultTolerant;
     }
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?rev=631241&r1=631240&r2=631241&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Tue Feb 26 06:56:31 2008
@@ -146,6 +146,7 @@
     private CountDownLatch dispatchStoppedLatch = new CountDownLatch(1);
     private ConnectionContext context;
     private boolean networkConnection;
+    private boolean faultTolerantConnection;
     private AtomicInteger protocolVersion = new AtomicInteger(CommandTypes.PROTOCOL_VERSION);
     private DemandForwardingBridge duplexBridge;
     private final TaskRunnerFactory taskRunnerFactory;
@@ -647,6 +648,7 @@
         context.setConnector(connector);
         context.setMessageAuthorizationPolicy(getMessageAuthorizationPolicy());
         context.setNetworkConnection(networkConnection);
+        context.setFaultTolerant(faultTolerantConnection);
         context.setTransactions(new ConcurrentHashMap<TransactionId, Transaction>());
         context.setUserName(info.getUserName());
         context.setWireFormatInfo(wireFormatInfo);
@@ -1076,6 +1078,10 @@
     public synchronized boolean isStarting() {
         return starting;
     }
+    
+    public synchronized boolean isNetworkConnection() {
+        return networkConnection;
+    }
 
     protected synchronized void setStarting(boolean starting) {
         this.starting = starting;
@@ -1255,6 +1261,9 @@
     }
 
     public Response processConnectionControl(ConnectionControl control) throws Exception
{
+        if(control != null) {
+            faultTolerantConnection=control.isFaultTolerant();
+        }
         return null;
     }
 



Mime
View raw message