[jboss-cvs] JBoss Messaging SVN: r1789 - in trunk: src/main/org/jboss/jms/client/container src/main/org/jboss/jms/client/state tests/src/org/jboss/test/messaging/jms/clustering
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Dec 14 01:47:24 EST 2006
Author: ovidiu.feodorov at jboss.com
Date: 2006-12-14 01:47:18 -0500 (Thu, 14 Dec 2006)
New Revision: 1789
Modified:
trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java
trunk/src/main/org/jboss/jms/client/container/HAAspect.java
trunk/src/main/org/jboss/jms/client/state/ConnectionState.java
trunk/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java
Log:
More reformatting
Modified: trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java 2006-12-14 06:26:45 UTC (rev 1788)
+++ trunk/src/main/org/jboss/jms/client/container/ConnectionAspect.java 2006-12-14 06:47:18 UTC (rev 1789)
@@ -184,7 +184,7 @@
{
Object ret = invocation.invokeNext();
- //Remove any exception listener
+ // Remove any exception listener
ConnectionState currentState = getConnectionState(invocation);
Client client = getConnectionState(invocation).getRemotingConnection().getInvokingClient();
Modified: trunk/src/main/org/jboss/jms/client/container/HAAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/HAAspect.java 2006-12-14 06:26:45 UTC (rev 1788)
+++ trunk/src/main/org/jboss/jms/client/container/HAAspect.java 2006-12-14 06:47:18 UTC (rev 1789)
@@ -154,7 +154,7 @@
if(trace) { log.trace(this + " registering " + listener + " on " + cd); }
state.getRemotingConnection().getInvokingClient().addConnectionListener(listener);
- return new CreateConnectionResult(cd);
+ return new CreateConnectionResult(cd);
}
public String toString()
@@ -241,15 +241,16 @@
return null;
}
- private void handleFailure(ClientConnectionDelegate failedConnDelegate) throws Exception
+ private void handleConnectionFailure(ClientConnectionDelegate failedConnDelegate)
+ throws Exception
{
+ log.debug(this + " handling failed connection " + failedConnDelegate);
+
ConnectionState failedConnState =
(ConnectionState)((DelegateSupport)failedConnDelegate).getState();
int failedServerID = failedConnState.getServerID();
- log.debug(this + " handling failed connection to node " + failedServerID);
-
// Get the default connection factory delegate we are going to failover onto
ClientConnectionFactoryDelegate failoverDelegate = getFailoverDelegate(failedServerID);
@@ -589,7 +590,7 @@
try
{
log.debug(this + " is being notified of connection failure: " + throwable);
- handleFailure(cd);
+ handleConnectionFailure(cd);
}
catch (Throwable e)
{
@@ -599,7 +600,7 @@
public String toString()
{
- return "ConnectionFailureListener[" + Integer.toHexString(hashCode()) + "]";
+ return "ConnectionFailureListener[" + cd + "]";
}
}
}
Modified: trunk/src/main/org/jboss/jms/client/state/ConnectionState.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/state/ConnectionState.java 2006-12-14 06:26:45 UTC (rev 1788)
+++ trunk/src/main/org/jboss/jms/client/state/ConnectionState.java 2006-12-14 06:47:18 UTC (rev 1789)
@@ -136,7 +136,6 @@
return serverID;
}
-
public DelegateSupport getDelegate()
{
return (DelegateSupport) delegate;
@@ -164,7 +163,6 @@
this.started = started;
}
-
public String getPassword()
{
return password;
@@ -186,66 +184,62 @@
}
public String getClientID()
- {
- return clientID;
- }
+ {
+ return clientID;
+ }
- public void setClientID(String clientID)
- {
- this.clientID = clientID;
- }
+ public void setClientID(String clientID)
+ {
+ this.clientID = clientID;
+ }
- public ExceptionListener getExceptionListener()
- {
- return exceptionListener;
- }
+ public ExceptionListener getExceptionListener()
+ {
+ return exceptionListener;
+ }
- public void setExceptionListener(ExceptionListener exceptionListener)
- {
- this.exceptionListener = exceptionListener;
- }
+ public void setExceptionListener(ExceptionListener exceptionListener)
+ {
+ this.exceptionListener = exceptionListener;
+ }
- public boolean isJustCreated()
- {
- return justCreated;
- }
+ public boolean isJustCreated()
+ {
+ return justCreated;
+ }
- public void setJustCreated(boolean justCreated)
- {
- this.justCreated = justCreated;
- }
+ public void setJustCreated(boolean justCreated)
+ {
+ this.justCreated = justCreated;
+ }
- public boolean isListenerAdded()
- {
- return listenerAdded;
- }
+ public boolean isListenerAdded()
+ {
+ return listenerAdded;
+ }
- public void setListenerAdded(boolean listenerAdded)
- {
- this.listenerAdded = listenerAdded;
- }
+ public void setListenerAdded(boolean listenerAdded)
+ {
+ this.listenerAdded = listenerAdded;
+ }
- /** Connection doesn't have a parent */
- public HierarchicalState getParent()
- {
- return null;
- }
-
- //When failing over a connection, we keep the old connection's state but there are certain fields
- //we need to update
- public void copyState(ConnectionState newState)
- {
- this.remotingConnection = newState.remotingConnection;
-
- this.idGenerator = newState.idGenerator;
-
- this.serverID = newState.serverID;
-
- this.versionToUse = newState.versionToUse;
-
- this.delegate = newState.delegate;
- }
+ /** Connection doesn't have a parent */
+ public HierarchicalState getParent()
+ {
+ return null;
+ }
+ //When failing over a connection, we keep the old connection's state but there are certain fields
+ //we need to update
+ public void copyState(ConnectionState newState)
+ {
+ this.remotingConnection = newState.remotingConnection;
+ this.idGenerator = newState.idGenerator;
+ this.serverID = newState.serverID;
+ this.versionToUse = newState.versionToUse;
+ this.delegate = newState.delegate;
+ }
+
public String toString()
{
return "ConnectionState[" + ((ClientConnectionDelegate)delegate).getID() + "]";
Modified: trunk/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java 2006-12-14 06:26:45 UTC (rev 1788)
+++ trunk/tests/src/org/jboss/test/messaging/jms/clustering/FailoverTest.java 2006-12-14 06:47:18 UTC (rev 1789)
@@ -86,7 +86,7 @@
// TODO - this shouldn't be necessary if we have the client valve in place
log.info("Sleeping for 1 min");
- Thread.sleep(20000);
+ Thread.sleep(15000);
// we must receive the message
More information about the jboss-cvs-commits
mailing list