[jboss-cvs] JBoss Messaging SVN: r2122 - in trunk: src/main/org/jboss/jms/client/container and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Feb 1 07:51:32 EST 2007
Author: timfox
Date: 2007-02-01 07:51:32 -0500 (Thu, 01 Feb 2007)
New Revision: 2122
Added:
trunk/src/main/org/jboss/jms/util/MessagingNetworkFailureException.java
Modified:
trunk/src/main/org/jboss/jms/client/FailoverCommandCenter.java
trunk/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java
trunk/src/main/org/jboss/jms/client/delegate/ClientBrowserDelegate.java
trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java
trunk/src/main/org/jboss/jms/client/delegate/ClientConsumerDelegate.java
trunk/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java
trunk/src/main/org/jboss/jms/client/delegate/DelegateSupport.java
trunk/src/main/org/jboss/jms/delegate/ConnectionDelegate.java
trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
trunk/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java
trunk/src/main/org/jboss/jms/wireformat/ConnectionFactoryUpdate.java
trunk/src/main/org/jboss/jms/wireformat/PacketSupport.java
trunk/src/main/org/jboss/jms/wireformat/SerializedPacket.java
trunk/src/main/org/jboss/jms/wireformat/SessionAcknowledgeDeliveriesRequest.java
trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
Log:
Get clustering tests running
Modified: trunk/src/main/org/jboss/jms/client/FailoverCommandCenter.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/FailoverCommandCenter.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/client/FailoverCommandCenter.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -56,7 +56,7 @@
/**
* Method called by failure detection components (FailoverValveInterceptors and
- * ConnectionListeners) when they have reasons to belive that a server failure occured.
+ * ConnectionListeners) when they have reasons to believe that a server failure occured.
*/
public void failureDetected(Throwable reason, FailureDetector source,
JMSRemotingConnection remotingConnection)
Modified: trunk/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -9,19 +9,17 @@
import org.jboss.aop.advice.Interceptor;
import org.jboss.aop.joinpoint.Invocation;
import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.jms.client.delegate.DelegateSupport;
-import org.jboss.jms.client.delegate.ClientConsumerDelegate;
-import org.jboss.jms.client.state.HierarchicalState;
-import org.jboss.jms.client.state.ConnectionState;
import org.jboss.jms.client.FailoverCommandCenter;
import org.jboss.jms.client.FailoverValve;
import org.jboss.jms.client.FailureDetector;
+import org.jboss.jms.client.delegate.ClientConsumerDelegate;
+import org.jboss.jms.client.delegate.DelegateSupport;
import org.jboss.jms.client.remoting.JMSRemotingConnection;
-import org.jboss.remoting.CannotConnectException;
+import org.jboss.jms.client.state.ConnectionState;
+import org.jboss.jms.client.state.HierarchicalState;
+import org.jboss.jms.util.MessagingNetworkFailureException;
import org.jboss.logging.Logger;
-import java.io.IOException;
-
/**
* An interceptor that acts as a failover valve: it allows all invocations to go through as long
* as there is no failover in progress (valve is open), and holds all invocations while client-side
@@ -118,24 +116,35 @@
remotingConnection = fcc.getRemotingConnection();
return invocation.invokeNext();
}
- catch (CannotConnectException e)
+// catch (CannotConnectException e)
+// {
+// log.debug(this + " putting " + methodName + "() on hold until failover completes");
+//
+// fcc.failureDetected(e, this, remotingConnection);
+//
+// log.debug(this + " resuming " + methodName + "()");
+// return invocation.invokeNext();
+// }
+// catch (IOException e)
+// {
+// log.debug(this + " putting " + methodName + "() on hold until failover completes");
+//
+// fcc.failureDetected(e, this, remotingConnection);
+//
+// log.debug(this + " resuming " + methodName + "()");
+// return invocation.invokeNext();
+// }
+ catch (MessagingNetworkFailureException e)
{
log.debug(this + " putting " + methodName + "() on hold until failover completes");
-
+
+ log.info("********** CAUGHT NETWOEK FAILURE");
+
fcc.failureDetected(e, this, remotingConnection);
-
+
log.debug(this + " resuming " + methodName + "()");
return invocation.invokeNext();
- }
- catch (IOException e)
- {
- log.debug(this + " putting " + methodName + "() on hold until failover completes");
-
- fcc.failureDetected(e, this, remotingConnection);
-
- log.debug(this + " resuming " + methodName + "()");
- return invocation.invokeNext();
- }
+ }
catch (Throwable e)
{
// not failover-triggering, rethrow
Modified: trunk/src/main/org/jboss/jms/client/delegate/ClientBrowserDelegate.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/delegate/ClientBrowserDelegate.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/client/delegate/ClientBrowserDelegate.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -82,6 +82,9 @@
// synchronize (recursively) the client-side state
state.synchronizeWith(newDelegate.getState());
+
+ client = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
+ getRemotingClient();
}
public void setState(HierarchicalState state)
@@ -89,9 +92,10 @@
super.setState(state);
client = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
- getRemotingClient();
+ getRemotingClient();
}
+
// Closeable implementation ---------------------------------------------------------------------
public void close() throws JMSException
Modified: trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -122,6 +122,8 @@
// There is one RM per server, so we need to merge the rms if necessary
ResourceManagerFactory.instance.handleFailover(serverID, newDelegate.getServerID());
+
+ client = thisState.getRemotingConnection().getRemotingClient();
// start the connection again on the serverEndpoint if necessary
if (thisState.isStarted())
@@ -134,7 +136,7 @@
{
super.setState(state);
- client = ((ConnectionState)state).getRemotingConnection(). getRemotingClient();
+ client = ((ConnectionState)state).getRemotingConnection().getRemotingClient();
}
// Closeable implementation ---------------------------------------------------------------------
Modified: trunk/src/main/org/jboss/jms/client/delegate/ClientConsumerDelegate.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/delegate/ClientConsumerDelegate.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/client/delegate/ClientConsumerDelegate.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -95,6 +95,9 @@
maxDeliveries = newDelegate.getMaxDeliveries();
channelID = newDelegate.getChannelID();
+ client = ((ConnectionState)state.getParent().getParent()).getRemotingConnection().
+ getRemotingClient();
+
}
public void setState(HierarchicalState state)
Modified: trunk/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/client/delegate/ClientSessionDelegate.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -112,6 +112,9 @@
// synchronize (recursively) the client-side state
state.synchronizeWith(newDelegate.getState());
+
+ client = ((ConnectionState)state.getParent()).getRemotingConnection().
+ getRemotingClient();
}
public void setState(HierarchicalState state)
Modified: trunk/src/main/org/jboss/jms/client/delegate/DelegateSupport.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/delegate/DelegateSupport.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/client/delegate/DelegateSupport.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -23,16 +23,19 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
+import java.io.IOException;
import java.io.Serializable;
import javax.jms.JMSException;
import org.jboss.jms.client.state.HierarchicalState;
import org.jboss.jms.util.MessagingJMSException;
+import org.jboss.jms.util.MessagingNetworkFailureException;
import org.jboss.jms.wireformat.RequestSupport;
import org.jboss.jms.wireformat.ResponseSupport;
import org.jboss.logging.Logger;
import org.jboss.messaging.util.Streamable;
+import org.jboss.remoting.CannotConnectException;
import org.jboss.remoting.Client;
/**
@@ -190,12 +193,18 @@
public JMSException handleThrowable(Throwable t)
{
+ log.info("******** HANDLING THROWABLE", t);
+
if (t instanceof JMSException)
{
return (JMSException)t;
}
- else
+ else if ((t instanceof CannotConnectException) || (t instanceof IOException))
{
+ return new MessagingNetworkFailureException((Exception)t);
+ }
+ else
+ {
log.error("Failed", t);
return new MessagingJMSException("Failed to invoke", t);
}
Modified: trunk/src/main/org/jboss/jms/delegate/ConnectionDelegate.java
===================================================================
--- trunk/src/main/org/jboss/jms/delegate/ConnectionDelegate.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/delegate/ConnectionDelegate.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -56,6 +56,6 @@
int maxMessages) throws JMSException;
void registerFailoverListener(FailoverListener failoverListener);
+
boolean unregisterFailoverListener(FailoverListener failoverListener);
-
}
Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionFactoryEndpoint.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -283,7 +283,7 @@
try
{
- connEndpoint.getCallbackHandler().handleCallback(callback);
+ connEndpoint.getCallbackHandler().handleCallbackOneway(callback);
}
catch (Exception e)
{
Modified: trunk/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/server/remoting/JMSWireFormat.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -33,6 +33,7 @@
import java.util.Map;
import org.jboss.jms.wireformat.ClientDelivery;
+import org.jboss.jms.wireformat.ConnectionFactoryUpdate;
import org.jboss.jms.wireformat.PacketSupport;
import org.jboss.jms.wireformat.PolledCallbacksDelivery;
import org.jboss.jms.wireformat.RequestSupport;
@@ -198,6 +199,14 @@
if (trace) { log.trace("Message delivery callback"); }
}
+ else if (callback.getParameter() instanceof ConnectionFactoryUpdate)
+ {
+ packet = (ConnectionFactoryUpdate)callback.getParameter();
+
+ ((ConnectionFactoryUpdate)packet).setRemotingSessionID(req.getSessionId());
+
+ if (trace) { log.trace("Connection factory update callback"); }
+ }
}
}
else
Added: trunk/src/main/org/jboss/jms/util/MessagingNetworkFailureException.java
===================================================================
--- trunk/src/main/org/jboss/jms/util/MessagingNetworkFailureException.java (rev 0)
+++ trunk/src/main/org/jboss/jms/util/MessagingNetworkFailureException.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jms.util;
+
+/**
+ * A MessagingNetworkFailureException
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ *
+ * $Id$
+ *
+ */
+public class MessagingNetworkFailureException extends MessagingJMSException
+{
+ private static final long serialVersionUID = 1255764532063281353L;
+
+ public MessagingNetworkFailureException(Exception cause)
+ {
+ super(cause);
+ }
+
+ public MessagingNetworkFailureException(String reason, String errorCode, Throwable cause)
+ {
+ super(reason, errorCode, cause);
+ }
+
+ public MessagingNetworkFailureException(String reason, String errorCode)
+ {
+ super(reason, errorCode);
+ }
+
+ public MessagingNetworkFailureException(String reason, Throwable cause)
+ {
+ super(reason, cause);
+ }
+
+ public MessagingNetworkFailureException(String reason)
+ {
+ super(reason);
+ }
+
+}
Modified: trunk/src/main/org/jboss/jms/wireformat/ConnectionFactoryUpdate.java
===================================================================
--- trunk/src/main/org/jboss/jms/wireformat/ConnectionFactoryUpdate.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/wireformat/ConnectionFactoryUpdate.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -96,12 +96,15 @@
{
StringBuffer sb = new StringBuffer("ConnectionFactoryUpdateMessage[");
- for(int i = 0; i < delegates.length; i++)
+ if (delegates != null)
{
- sb.append(delegates[i]);
- if (i < delegates.length - 1)
+ for(int i = 0; i < delegates.length; i++)
{
- sb.append(',');
+ sb.append(delegates[i]);
+ if (i < delegates.length - 1)
+ {
+ sb.append(',');
+ }
}
}
Modified: trunk/src/main/org/jboss/jms/wireformat/PacketSupport.java
===================================================================
--- trunk/src/main/org/jboss/jms/wireformat/PacketSupport.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/wireformat/PacketSupport.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -26,7 +26,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.jboss.logging.Logger;
import org.jboss.messaging.util.Streamable;
import org.jboss.remoting.Client;
@@ -41,8 +40,6 @@
*/
public abstract class PacketSupport implements Streamable
{
- private static final Logger log = Logger.getLogger(PacketSupport.class);
-
private static final int NULL = 0;
private static final int NOT_NULL = 1;
Modified: trunk/src/main/org/jboss/jms/wireformat/SerializedPacket.java
===================================================================
--- trunk/src/main/org/jboss/jms/wireformat/SerializedPacket.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/wireformat/SerializedPacket.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -21,15 +21,11 @@
*/
package org.jboss.jms.wireformat;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import org.jboss.logging.Logger;
-
/**
* For carrying a remoting non JBM invocation across the wire
*
@@ -45,9 +41,6 @@
*/
public class SerializedPacket extends PacketSupport
{
- private static final Logger log = Logger.getLogger(SerializedPacket.class);
-
-
private Object payload;
public SerializedPacket()
Modified: trunk/src/main/org/jboss/jms/wireformat/SessionAcknowledgeDeliveriesRequest.java
===================================================================
--- trunk/src/main/org/jboss/jms/wireformat/SessionAcknowledgeDeliveriesRequest.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/src/main/org/jboss/jms/wireformat/SessionAcknowledgeDeliveriesRequest.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -29,11 +29,9 @@
import java.util.List;
import org.jboss.jms.server.endpoint.Ack;
-import org.jboss.jms.server.endpoint.ConsumerEndpoint;
import org.jboss.jms.server.endpoint.DefaultAck;
import org.jboss.jms.server.endpoint.SessionEndpoint;
-
/**
*
* A SessionAcknowledgeDeliveriesRequest
Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java 2007-02-01 07:39:36 UTC (rev 2121)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java 2007-02-01 12:51:32 UTC (rev 2122)
@@ -1514,7 +1514,6 @@
jca = true;
remoting = true;
security = true;
- multiplexer = true;
}
else if ("transaction".equals(tok))
{
More information about the jboss-cvs-commits
mailing list