[jboss-cvs] JBoss Messaging SVN: r3426 - in branches/Branch_JBMESSAGING-544/src/main/org/jboss: jms/client/remoting and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Dec 6 08:14:27 EST 2007
Author: jmesnil
Date: 2007-12-06 08:14:26 -0500 (Thu, 06 Dec 2007)
New Revision: 3426
Removed:
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/CountingOutputStream.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/DirectThreadPool.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java
Modified:
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/container/ConnectionFailureListener.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/CallbackManager.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/ConsolidatedRemotingConnectionListener.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java
branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Client.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-544 Replace client-server transport with NIO based transport
* removed unused classes specific to JBoss Remoting
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/container/ConnectionFailureListener.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/container/ConnectionFailureListener.java 2007-12-06 11:18:08 UTC (rev 3425)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/container/ConnectionFailureListener.java 2007-12-06 13:14:26 UTC (rev 3426)
@@ -53,7 +53,7 @@
* Returns false if failover was unable to handle the exception and it should be passed
* on to any JMS exception listener
*/
- public boolean handleConnectionException(Throwable throwable, Client client)
+ public boolean handleConnectionException(Throwable throwable)
{
try
{
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/CallbackManager.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/CallbackManager.java 2007-12-06 11:18:08 UTC (rev 3425)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/CallbackManager.java 2007-12-06 13:14:26 UTC (rev 3426)
@@ -25,9 +25,6 @@
import org.jboss.jms.client.container.ClientConsumer;
import org.jboss.logging.Logger;
-import org.jboss.remoting.callback.Callback;
-import org.jboss.remoting.callback.HandleCallbackException;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
@@ -38,13 +35,16 @@
* There is one instance of this class per remoting connection - which is to a unique server -
* therefore there is no need to add the server id to the key when doing look ups.
*
+ * TODO this class should be merged with use of PacketDispatcher.client instance and
+ * ClientConsumerPacketHandler should wrap ClientConsumer class
+ *
* @author <a href="tim.fox at jboss.com">Tim Fox</a>
* @author <a href="ovidiu at feodorov.com">Ovidiu Feodorov</a>
* @version <tt>$Revision$</tt>
*
* $Id$
*/
-public class CallbackManager implements InvokerCallbackHandler
+public class CallbackManager
{
// Constants ------------------------------------------------------------------------------------
@@ -67,13 +67,6 @@
callbackHandlers = new ConcurrentReaderHashMap();
}
- // InvokerCallbackHandler implementation --------------------------------------------------------
-
- public void handleCallback(Callback callback) throws HandleCallbackException
- {
- throw new IllegalStateException("JBoss Remoting must no longer be used");
- }
-
// Public ---------------------------------------------------------------------------------------
public void registerHandler(String consumerID, ClientConsumer handler)
@@ -83,7 +76,7 @@
public ClientConsumer unregisterHandler(String consumerID)
{
- return (ClientConsumer)callbackHandlers.remove(consumerID);
+ return callbackHandlers.remove(consumerID);
}
public String toString()
Deleted: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java 2007-12-06 11:18:08 UTC (rev 3425)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java 2007-12-06 13:14:26 UTC (rev 3426)
@@ -1,152 +0,0 @@
-/*
-* 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.client.remoting;
-
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.util.Map;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.transport.socket.OpenConnectionChecker;
-import org.jboss.remoting.transport.socket.SocketWrapper;
-
-/**
- * @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
- * @author <a href="mailto:tom.fox at jboss.com">Tim Fox</a>
- *
- * $Id$
- */
-public class ClientSocketWrapper extends SocketWrapper implements OpenConnectionChecker
-{
- // Constants ------------------------------------------------------------------------------------
- final static private Logger log = Logger.getLogger(ClientSocketWrapper.class);
- final static protected int CLOSING = 1;
-
- // Static ---------------------------------------------------------------------------------------
-
- // Attributes -----------------------------------------------------------------------------------
-
- private DataInputStream in;
- private DataOutputStream out;
-
- // Constructors ---------------------------------------------------------------------------------
-
- public ClientSocketWrapper(Socket socket) throws IOException
- {
- super(socket);
- createStreams(socket, null);
- }
-
- public ClientSocketWrapper(Socket socket, Map metadata, Integer timeout) throws Exception
- {
- super(socket, timeout);
- createStreams(socket, metadata);
- }
-
- // SocketWrapper overrides ----------------------------------------------------------------------
-
- public OutputStream getOutputStream()
- {
- return out;
- }
-
- public InputStream getInputStream()
- {
- return in;
- }
-
- public void checkConnection() throws IOException
- {
- // Test to see if socket is alive by send ACK message
- final byte ACK = 1;
-
- out.writeByte(ACK);
- out.flush();
- in.readByte();
- }
- // OpenConnectionChecker implementation ---------------------------------------------------------
-
- public void checkOpenConnection() throws IOException
- {
- if (in.available() > 0)
- {
- log.trace("remote endpoint has closed");
- throw new IOException("remote endpoint has closed");
- }
- }
-
- // Public ---------------------------------------------------------------------------------------
-
- public String toString()
- {
- Socket socket = getSocket();
- return "ClientSocketWrapper[" + socket + "." +
- Integer.toHexString(System.identityHashCode(socket)) + "]";
- }
-
- // Package protected ----------------------------------------------------------------------------
-
- // Protected ------------------------------------------------------------------------------------
-
- protected void createStreams(Socket socket, Map metadata) throws IOException
- {
- out = createOutputStream(socket);
- in = createInputStream(socket);
- }
-
- protected DataInputStream createInputStream(Socket socket)
- throws IOException
- {
- // We make sure the buffer is big (default is 8192)- remember we flush after every request
- // or response so this is ok. We want to avoid flushes at other times.
- //TODO this could be made configurable
-
- BufferedInputStream bin = new BufferedInputStream(socket.getInputStream(), 65536);
-
- return new DataInputStream(bin);
- }
-
- protected DataOutputStream createOutputStream(Socket socket)
- throws IOException
- {
- // We make sure the buffer is big (default is 8192)- remember we flush after every request
- // or response so this is ok. We want to avoid flushes at other times.
- //TODO this could be made configurable
-
- BufferedOutputStream bout = new BufferedOutputStream(socket.getOutputStream(), 65536);
-
- return new DataOutputStream(bout);
- }
-
- // Private --------------------------------------------------------------------------------------
-
- // Inner classes --------------------------------------------------------------------------------
-
-}
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/ConsolidatedRemotingConnectionListener.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/ConsolidatedRemotingConnectionListener.java 2007-12-06 11:18:08 UTC (rev 3425)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/client/remoting/ConsolidatedRemotingConnectionListener.java 2007-12-06 13:14:26 UTC (rev 3426)
@@ -12,8 +12,6 @@
import org.jboss.jms.client.container.ConnectionFailureListener;
import org.jboss.jms.client.state.ConnectionState;
import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.ConnectionListener;
/**
* The ONLY remoting connection listener for a JMS connection's underlying remoting connection.
@@ -27,7 +25,7 @@
*
* $Id$
*/
-public class ConsolidatedRemotingConnectionListener implements ConnectionListener
+public class ConsolidatedRemotingConnectionListener
{
// Constants ------------------------------------------------------------------------------------
@@ -51,7 +49,7 @@
// ConnectionListener implementation ------------------------------------------------------------
- public void handleConnectionException(Throwable throwable, Client client)
+ public void handleConnectionException(Throwable throwable)
{
// forward the exception to delegate listener and JMS ExceptionListeners; synchronize
// to avoid race conditions
@@ -78,7 +76,7 @@
//We only forward to the JMS listener if failover did not successfully handle the exception
//If failover handled the exception transparently then there is effectively no problem
//with the logical connection that the client needs to be aware of
- forwardToJMSListener = !remotingListenerCopy.handleConnectionException(throwable, client);
+ forwardToJMSListener = !remotingListenerCopy.handleConnectionException(throwable);
}
catch(Exception e)
{
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java 2007-12-06 11:18:08 UTC (rev 3425)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/ServerPeer.java 2007-12-06 13:14:26 UTC (rev 3426)
@@ -52,7 +52,6 @@
import org.jboss.jms.server.messagecounter.MessageCounter;
import org.jboss.jms.server.messagecounter.MessageCounterManager;
import org.jboss.jms.server.plugin.contract.JMSUserManager;
-import org.jboss.jms.server.remoting.JMSServerInvocationHandler;
import org.jboss.jms.server.security.SecurityMetadataStore;
import org.jboss.jms.wireformat.JMSWireFormat;
import org.jboss.logging.Logger;
@@ -303,10 +302,6 @@
JMSWireFormat wf = new JMSWireFormat();
MarshalFactory.addMarshaller("jms", wf, wf);
- //Now everything is started we can tell the invocation handler to start handling invocations
- //We do this right at the end otherwise it can start handling invocations before we are properly started
- JMSServerInvocationHandler.setClosed(false);
-
started = true;
log.info("JBoss Messaging " + getVersion().getProviderVersion() + " server [" +
@@ -331,11 +326,6 @@
started = false;
- //Tell the invocation handler we are closed - this is so we don't attempt to handle
- //any invocations when we are in a partial closing down state - which can give strange
- //"object not found with id" exceptions and stuff like that
- JMSServerInvocationHandler.setClosed(true);
-
// Stop the wired components
messageIDManager.stop();
Deleted: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/CountingOutputStream.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/CountingOutputStream.java 2007-12-06 11:18:08 UTC (rev 3425)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/CountingOutputStream.java 2007-12-06 13:14:26 UTC (rev 3426)
@@ -1,85 +0,0 @@
-/*
- * 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.server.remoting;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import org.jboss.logging.Logger;
-
-/**
- *
- * A CountingOutputStream.
- *
- * Counts how many bytes written, used as a diagnostic tool
- * during development when we want to see exactly what's being written,
- * typically to socket output streams.
- *
- * @author <a href="tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class CountingOutputStream extends OutputStream
-{
- private static final Logger log = Logger.getLogger(CountingOutputStream.class);
-
- private OutputStream os;
-
- private int count;
-
- private boolean trace;
-
- public CountingOutputStream(OutputStream os)
- {
- //trace = log.isTraceEnabled();
-
- trace = true;
-
- this.os = os;
- }
-
- public void write(int b) throws IOException
- {
- os.write(b);
-
- if (trace)
- {
- log.trace(this + "Wrote byte " + count + ": " + b);
- }
-
- count++;
- }
-
- public void flush() throws IOException
- {
- os.flush();
-
- if (trace)
- {
- log.trace(this + "Flushed stream");
-
- count = 0;
- }
- }
-
-}
Deleted: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/DirectThreadPool.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/DirectThreadPool.java 2007-12-06 11:18:08 UTC (rev 3425)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/DirectThreadPool.java 2007-12-06 13:14:26 UTC (rev 3426)
@@ -1,81 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.jms.server.remoting;
-
-import org.jboss.util.threadpool.Task;
-import org.jboss.util.threadpool.TaskWrapper;
-import org.jboss.util.threadpool.ThreadPool;
-
-/**
- * A "noop" thread pool that just forwards the invocations, without doing any kind of pooling.
- * We use it for the "socket" remoting callback server.
- *
- * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- * $Id$
- */
-public class DirectThreadPool implements ThreadPool
-{
- // Constants ------------------------------------------------------------------------------------
-
- // Static ---------------------------------------------------------------------------------------
-
- // Attributes -----------------------------------------------------------------------------------
-
- // Constructors ---------------------------------------------------------------------------------
-
- public DirectThreadPool()
- {
- }
-
- // ThreadPool implementation --------------------------------------------------------------------
-
- public void stop(boolean immediate)
- {
- }
-
- public void waitForTasks() throws InterruptedException
- {
- throw new RuntimeException("NOT YET IMPLEMENTED!");
- }
-
- public void waitForTasks(long maxWaitTime) throws InterruptedException
- {
- throw new RuntimeException("NOT YET IMPLEMENTED!");
- }
-
- public void runTaskWrapper(TaskWrapper wrapper)
- {
- throw new RuntimeException("NOT YET IMPLEMENTED!");
- }
-
- public void runTask(Task task)
- {
- throw new RuntimeException("NOT YET IMPLEMENTED!");
- }
-
- public void run(Runnable runnable)
- {
- runnable.run();
- }
-
- public void run(Runnable runnable, long startTimeout, long completeTimeout)
- {
- throw new RuntimeException("NOT YET IMPLEMENTED!");
- }
-
- // Public ---------------------------------------------------------------------------------------
-
- // Package protected ----------------------------------------------------------------------------
-
- // Protected ------------------------------------------------------------------------------------
-
- // Private --------------------------------------------------------------------------------------
-
- // Inner classes --------------------------------------------------------------------------------
-
-}
Deleted: branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java 2007-12-06 11:18:08 UTC (rev 3425)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java 2007-12-06 13:14:26 UTC (rev 3426)
@@ -1,133 +0,0 @@
-/*
-* 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.server.remoting;
-
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.EOFException;
-import java.io.IOException;
-import java.net.Socket;
-import java.util.Map;
-
-import org.jboss.jms.client.remoting.ClientSocketWrapper;
-import org.jboss.logging.Logger;
-
-/**
- * @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
- * @author <a href="mailto:tom.fox at jboss.com">Tim Fox</a>
- *
- * $Id$
- */
-public class ServerSocketWrapper extends ClientSocketWrapper
-{
- // Constants -----------------------------------------------------
-
- final static private Logger log = Logger.getLogger(ServerSocketWrapper.class);
-
- // Static --------------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private boolean trace = log.isTraceEnabled();
-
- // Constructors --------------------------------------------------
-
- public ServerSocketWrapper(Socket socket) throws Exception
- {
- super(socket);
- }
-
- public ServerSocketWrapper(Socket socket, Map metadata, Integer timeout) throws Exception
- {
- super(socket, metadata, timeout);
- }
-
- // SocketWrapper overrides ----------------------------------------------------------------------
-
- public void close() throws IOException
- {
- if(getSocket() != null)
- {
- try
- {
- getOutputStream().write(CLOSING);
- getOutputStream().flush();
- log.debug("wrote CLOSING byte");
- }
- catch (IOException e)
- {
- log.debug("cannot write CLOSING byte", e);
- }
- super.close();
- }
- }
-
- // Public --------------------------------------------------------
-
- public void checkConnection() throws IOException
- {
- // Perform acknowledgement to convince client that the socket is still active
- byte ACK = 0;
-
- try
- {
- ACK = ((DataInputStream)getInputStream()).readByte();
- }
- catch(EOFException eof)
- {
- if (trace)
- {
- log.trace("socket timeout is set to: " + getTimeout());
- log.trace("EOFException waiting on ACK in readByte().");
- }
- throw eof;
- }
- catch(IOException e)
- {
- log.trace("IOException when reading in ACK", e);
- throw e;
- }
-
- if (trace) { log.trace("acknowledge read byte " + Thread.currentThread()); }
-
- DataOutputStream out = (DataOutputStream)getOutputStream();
- out.writeByte(ACK);
- out.flush();
- }
-
- public String toString()
- {
- Socket socket = getSocket();
- return "ServerSocketWrapper[" + socket + "." +
- Integer.toHexString(System.identityHashCode(socket)) + "]";
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Modified: branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Client.java
===================================================================
--- branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Client.java 2007-12-06 11:18:08 UTC (rev 3425)
+++ branches/Branch_JBMESSAGING-544/src/main/org/jboss/messaging/core/remoting/Client.java 2007-12-06 13:14:26 UTC (rev 3426)
@@ -33,13 +33,13 @@
import org.apache.mina.filter.reqres.RequestResponseFilter;
import org.apache.mina.filter.reqres.Response;
import org.apache.mina.transport.socket.nio.NioSocketConnector;
+import org.jboss.jms.client.remoting.ConsolidatedRemotingConnectionListener;
import org.jboss.jms.exception.MessagingNetworkFailureException;
import org.jboss.logging.Logger;
import org.jboss.messaging.core.remoting.codec.PacketCodecFactory;
import org.jboss.messaging.core.remoting.internal.MinaHandler;
import org.jboss.messaging.core.remoting.internal.MinaInspector;
import org.jboss.messaging.core.remoting.wireformat.AbstractPacket;
-import org.jboss.remoting.ConnectionListener;
/**
* @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>.
@@ -62,7 +62,7 @@
private NioSocketConnector connector;
private ScheduledExecutorService blockingScheduler;
- private Map<ConnectionListener, IoServiceListener> listeners = new HashMap<ConnectionListener, IoServiceListener>();
+ private Map<ConsolidatedRemotingConnectionListener, IoServiceListener> listeners = new HashMap<ConsolidatedRemotingConnectionListener, IoServiceListener>();
// Static --------------------------------------------------------
@@ -105,7 +105,7 @@
InetSocketAddress address = new InetSocketAddress(host, port);
ConnectFuture future = connector.connect(address);
connector.setDefaultRemoteAddress(address);
-
+
future.awaitUninterruptibly();
if (!future.isConnected())
{
@@ -186,7 +186,8 @@
this.blockingRequestTimeUnit = unit;
}
- public void addConnectionListener(final ConnectionListener listener)
+ public void addConnectionListener(
+ final ConsolidatedRemotingConnectionListener listener)
{
assert listener != null;
assert connector != null;
@@ -196,17 +197,17 @@
listeners.put(listener, ioListener);
if (log.isTraceEnabled())
- log.trace("added listener " + listener + " to " + this);
+ log.trace("added listener " + listener + " to " + this);
}
- public void removeConnectionListener(ConnectionListener listener)
+ public void removeConnectionListener(ConsolidatedRemotingConnectionListener listener)
{
assert listener != null;
assert connector != null;
-
+
connector.removeListener(listeners.get(listener));
listeners.remove(listener);
-
+
if (log.isTraceEnabled())
log.trace("removed listener " + listener + " from " + this);
}
@@ -232,7 +233,7 @@
{
return "Client[session=" + session + "]";
}
-
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@@ -252,23 +253,27 @@
{
if (session == null)
{
- throw new IllegalStateException("Client " + this + " is not connected.");
+ throw new IllegalStateException("Client " + this
+ + " is not connected.");
}
- if (!session.isConnected()) {
- throw new MessagingNetworkFailureException("Client " + this + " is not connected.");
+ if (!session.isConnected())
+ {
+ throw new MessagingNetworkFailureException("Client " + this
+ + " is not connected.");
}
}
// Inner classes -------------------------------------------------
- private final class IoServiceListenerAdapter implements
- IoServiceListener
+ private final class IoServiceListenerAdapter implements IoServiceListener
{
- private final Logger log = Logger.getLogger(IoServiceListenerAdapter.class);
+ private final Logger log = Logger
+ .getLogger(IoServiceListenerAdapter.class);
- private final ConnectionListener listener;
+ private final ConsolidatedRemotingConnectionListener listener;
- private IoServiceListenerAdapter(ConnectionListener listener)
+ private IoServiceListenerAdapter(
+ ConsolidatedRemotingConnectionListener listener)
{
this.listener = listener;
}
@@ -302,7 +307,7 @@
log.warn("destroyed session " + session);
Throwable t = new Throwable("MINA session has been destroyed");
- listener.handleConnectionException(t, null);
+ listener.handleConnectionException(t);
}
}
}
More information about the jboss-cvs-commits
mailing list