Author: jmesnil
Date: 2010-01-22 07:22:23 -0500 (Fri, 22 Jan 2010)
New Revision: 8838
Removed:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/protocol/stomp/
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ServerHolder.java
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/DummyServerHolder.java
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptorFactory.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptorFactory.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQBytesMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQMapMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQObjectMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQStreamMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQTextMessage.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/AcceptorFactory.java
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/BufferHandler.java
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/integration/http/NettyHttpTest.java
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-129: Implement STOMP v1.0
* updated code with trunk's refactoring of protocol support
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -23,7 +23,6 @@
import org.hornetq.core.logging.Logger;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.server.management.NotificationService;
-import org.hornetq.integration.transports.netty.ServerHolder;
import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.BufferHandler;
@@ -64,7 +63,6 @@
public InVMAcceptor(final Map<String, Object> configuration,
final BufferHandler handler,
- final ServerHolder holder,
final ConnectionLifeCycleListener listener,
final Executor threadPool)
{
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptorFactory.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptorFactory.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptorFactory.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -17,7 +17,6 @@
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
-import org.hornetq.integration.transports.netty.ServerHolder;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.AcceptorFactory;
import org.hornetq.spi.core.remoting.BufferHandler;
@@ -33,12 +32,11 @@
{
public Acceptor createAcceptor(final Map<String, Object> configuration,
final BufferHandler handler,
- final ServerHolder holder,
final ConnectionLifeCycleListener listener,
final Executor threadPool,
final ScheduledExecutorService scheduledThreadPool)
{
- return new InVMAcceptor(configuration, handler, holder, listener, threadPool);
+ return new InVMAcceptor(configuration, handler, listener, threadPool);
}
public Set<String> getAllowableProperties()
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -22,6 +22,8 @@
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
+import com.sun.corba.se.spi.activation.ServerHolder;
+
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Interceptor;
@@ -33,7 +35,6 @@
import org.hornetq.core.remoting.server.RemotingService;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.management.ManagementService;
-import org.hornetq.integration.transports.netty.ServerHolder;
import org.hornetq.spi.core.protocol.ConnectionEntry;
import org.hornetq.spi.core.protocol.ProtocolManager;
import org.hornetq.spi.core.protocol.ProtocolType;
@@ -170,27 +171,6 @@
Acceptor acceptor = factory.createAcceptor(info.getParams(),
new
DelegatingBufferHandler(manager),
- new ServerHolder()
- {
- public HornetQServer getServer()
- {
- return server;
- }
-
- public RemotingConnection getRemotingConnection(int connectionID)
- {
- ConnectionEntry conn = connections.get(connectionID);
-
- if (conn != null)
- {
- return conn.connection;
- }
- else
- {
- return null;
- }
- }
- },
this,
threadPool,
scheduledThreadPool);
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -16,6 +16,7 @@
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
+import org.hornetq.core.protocol.stomp.StompFrameDelimiter;
import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.BufferHandler;
import org.jboss.netty.channel.ChannelPipeline;
@@ -53,6 +54,10 @@
{
pipeline.addLast("decoder", new HornetQFrameDecoder2());
}
+ else if (protocol == ProtocolType.STOMP)
+ {
+ pipeline.addLast("delimiter", new StompFrameDelimiter());
+ }
else
{
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -35,9 +35,6 @@
import org.hornetq.core.remoting.impl.ssl.SSLSupport;
import org.hornetq.core.server.management.Notification;
import org.hornetq.core.server.management.NotificationService;
-import org.hornetq.integration.protocol.stomp.StompChannelHandler;
-import org.hornetq.integration.protocol.stomp.StompFrameDecoder;
-import org.hornetq.integration.protocol.stomp.StompFrameDelimiter;
import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.BufferHandler;
@@ -136,19 +133,14 @@
private boolean paused;
- private ServerHolder serverHolder;
-
public NettyAcceptor(final Map<String, Object> configuration,
final BufferHandler handler,
- final ServerHolder serverHandler,
final ConnectionLifeCycleListener listener,
final Executor threadPool,
final ScheduledExecutorService scheduledThreadPool)
{
this.handler = handler;
- this.serverHolder = serverHandler;
-
this.listener = listener;
sslEnabled =
ConfigurationHelper.getBooleanProperty(TransportConstants.SSL_ENABLED_PROP_NAME,
@@ -295,6 +287,7 @@
pipeline.addLast("httpResponseEncoder", new
HttpResponseEncoder());
pipeline.addLast("httphandler", new
HttpAcceptorHandler(httpKeepAliveRunnable, httpResponseTime));
}
+ /*
if (protocol == ProtocolType.STOMP)
{
pipeline.addLast("delimiter", new StompFrameDelimiter());
@@ -305,10 +298,10 @@
new Listener()));
}
else
- {
- ChannelPipelineSupport.addCodecFilter(ProtocolType.CORE, pipeline,
handler);
+ {*/
+ ChannelPipelineSupport.addCodecFilter(protocol, pipeline, handler);
pipeline.addLast("handler", new
HornetQServerChannelHandler(channelGroup, handler, new Listener()));
- }
+// }
return pipeline;
}
};
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptorFactory.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptorFactory.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/NettyAcceptorFactory.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -18,7 +18,6 @@
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
-import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.AcceptorFactory;
import org.hornetq.spi.core.remoting.BufferHandler;
@@ -33,12 +32,11 @@
{
public Acceptor createAcceptor(final Map<String, Object> configuration,
final BufferHandler handler,
- final ServerHolder serverHolder,
final ConnectionLifeCycleListener listener,
final Executor threadPool,
final ScheduledExecutorService scheduledThreadPool)
{
- return new NettyAcceptor(configuration, handler, serverHolder, listener,
threadPool, scheduledThreadPool);
+ return new NettyAcceptor(configuration, handler, listener, threadPool,
scheduledThreadPool);
}
public Set<String> getAllowableProperties()
Deleted:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ServerHolder.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ServerHolder.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/integration/transports/netty/ServerHolder.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -1,31 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.integration.transports.netty;
-
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.spi.core.protocol.RemotingConnection;
-
-/**
- * A ServerHolder
- *
- * @author jmesnil
- *
- *
- */
-public interface ServerHolder
-{
- HornetQServer getServer();
-
- RemotingConnection getRemotingConnection(int connectionID);
-}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQBytesMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQBytesMessage.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQBytesMessage.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -19,6 +19,7 @@
import javax.jms.MessageFormatException;
import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.Message;
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.core.logging.Logger;
@@ -42,7 +43,7 @@
private static final Logger log = Logger.getLogger(HornetQBytesMessage.class);
- public static final byte TYPE = 4;
+ public static final byte TYPE = Message.BYTES_TYPE;
// Attributes ----------------------------------------------------
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQMapMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQMapMessage.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQMapMessage.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -22,6 +22,7 @@
import javax.jms.MapMessage;
import javax.jms.MessageFormatException;
+import org.hornetq.api.core.Message;
import org.hornetq.api.core.PropertyConversionException;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.ClientMessage;
@@ -45,7 +46,7 @@
{
// Constants -----------------------------------------------------
- public static final byte TYPE = 5;
+ public static final byte TYPE = Message.MAP_TYPE;
// Attributes ----------------------------------------------------
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQMessage.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQMessage.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -83,7 +83,7 @@
private static final String JMSXGROUPID = "JMSXGroupID";
- public static final byte TYPE = 0;
+ public static final byte TYPE = org.hornetq.api.core.Message.DEFAULT_TYPE;
public static Map<String, Object> coreMaptoJMSMap(final Map<String,
Object> coreMessage)
{
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQObjectMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQObjectMessage.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQObjectMessage.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -22,6 +22,7 @@
import javax.jms.JMSException;
import javax.jms.ObjectMessage;
+import org.hornetq.api.core.Message;
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.api.core.client.ClientSession;
@@ -44,7 +45,7 @@
{
// Constants -----------------------------------------------------
- public static final byte TYPE = 2;
+ public static final byte TYPE = Message.OBJECT_TYPE;
// Attributes ----------------------------------------------------
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQStreamMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQStreamMessage.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQStreamMessage.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -19,6 +19,7 @@
import javax.jms.StreamMessage;
import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.Message;
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.core.client.impl.ClientMessageImpl;
@@ -48,7 +49,7 @@
private static final Logger log = Logger.getLogger(HornetQStreamMessage.class);
- public static final byte TYPE = 6;
+ public static final byte TYPE = Message.STREAM_TYPE;
// Attributes ----------------------------------------------------
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQTextMessage.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQTextMessage.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/jms/client/HornetQTextMessage.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -17,6 +17,7 @@
import javax.jms.TextMessage;
import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.Message;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.api.core.client.ClientSession;
@@ -42,7 +43,7 @@
{
// Constants -----------------------------------------------------
- public static final byte TYPE = 3;
+ public static final byte TYPE = Message.TEXT_TYPE;
public static final Logger log = Logger.getLogger(HornetQTextMessage.class);
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/protocol/ProtocolManager.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -14,7 +14,6 @@
package org.hornetq.spi.core.protocol;
import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
/**
@@ -24,11 +23,14 @@
*
*
*/
-public interface ProtocolManager extends BufferHandler
+public interface ProtocolManager
{
ConnectionEntry createConnectionEntry(Connection connection);
public void removeHandler(final String name);
public int isReadyToHandle(HornetQBuffer buffer);
+
+ void handleBuffer(RemotingConnection connection, HornetQBuffer buffer);
+
}
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/AcceptorFactory.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/AcceptorFactory.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/AcceptorFactory.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -18,12 +18,10 @@
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
-import org.hornetq.integration.transports.netty.ServerHolder;
-
/**
* A factory for creating acceptors.
* <p/>
- * An Acceptor is an endpoin that a {@link org.hornetq.spi.core.remoting.Connector} will
connect to and is used by the remoting service.
+ * An Acceptor is an endpoint that a {@link org.hornetq.spi.core.remoting.Connector} will
connect to and is used by the remoting service.
*
* @author <a href="ataylor(a)redhat.com">Andy Taylor</a>
* @author <a href="tim.fox(a)jboss.com">Tim Fox</a>
@@ -43,7 +41,6 @@
*/
Acceptor createAcceptor(final Map<String, Object> configuration,
BufferHandler handler,
- ServerHolder holder,
ConnectionLifeCycleListener listener,
Executor threadPool,
ScheduledExecutorService scheduledThreadPool);
Modified:
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/BufferHandler.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/BufferHandler.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/src/main/org/hornetq/spi/core/remoting/BufferHandler.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -24,9 +24,8 @@
public interface BufferHandler
{
/**
- * called by the remoting connection when a buffer is received.
+ * called when a buffer is received.
*
- * @param connectionID the connection the buffer was received on
* @param buffer the buffer to decode
*/
void bufferReceived(Object connectionID, HornetQBuffer buffer);
Modified:
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/integration/http/NettyHttpTest.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/integration/http/NettyHttpTest.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/integration/http/NettyHttpTest.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -32,7 +32,6 @@
import org.hornetq.spi.core.remoting.BufferHandler;
import org.hornetq.spi.core.remoting.Connection;
import org.hornetq.spi.core.remoting.ConnectionLifeCycleListener;
-import org.hornetq.tests.unit.core.remoting.impl.netty.DummyServerHolder;
import org.hornetq.tests.util.UnitTestCase;
/**
@@ -99,8 +98,7 @@
conf.put(TransportConstants.HTTP_CLIENT_IDLE_SCAN_PERIOD, -1l);
DummyConnectionLifeCycleListener acceptorListener = new
DummyConnectionLifeCycleListener(connCreatedLatch);
SimpleBufferHandler acceptorHandler = new SimpleBufferHandler(acceptorLatch);
- DummyServerHolder serverHolder = new DummyServerHolder();
- acceptor = new NettyAcceptor(conf, acceptorHandler, serverHolder, acceptorListener,
threadPool, scheduledThreadPool);
+ acceptor = new NettyAcceptor(conf, acceptorHandler, acceptorListener, threadPool,
scheduledThreadPool);
acceptor.start();
SimpleBufferHandler2 connectorHandler = new SimpleBufferHandler2(connectorLatch);
@@ -154,8 +152,7 @@
conf.put(TransportConstants.HTTP_CLIENT_IDLE_SCAN_PERIOD, -1l);
DummyConnectionLifeCycleListener acceptorListener = new
DummyConnectionLifeCycleListener(connCreatedLatch);
SimpleBufferHandler acceptorHandler = new SimpleBufferHandler(acceptorLatch);
- DummyServerHolder serverHolder = new DummyServerHolder();
- acceptor = new NettyAcceptor(conf, acceptorHandler, serverHolder, acceptorListener,
threadPool, scheduledThreadPool);
+ acceptor = new NettyAcceptor(conf, acceptorHandler, acceptorListener, threadPool,
scheduledThreadPool);
acceptor.start();
SimpleBufferHandler2 connectorHandler = new SimpleBufferHandler2(connectorLatch);
@@ -213,8 +210,7 @@
conf.put(TransportConstants.HTTP_CLIENT_IDLE_SCAN_PERIOD, -1l);
DummyConnectionLifeCycleListener acceptorListener = new
DummyConnectionLifeCycleListener(connCreatedLatch);
SimpleBufferHandler acceptorHandler = new SimpleBufferHandler(acceptorLatch);
- DummyServerHolder serverHolder = new DummyServerHolder();
- acceptor = new NettyAcceptor(conf, acceptorHandler, serverHolder, acceptorListener,
threadPool, scheduledThreadPool);
+ acceptor = new NettyAcceptor(conf, acceptorHandler, acceptorListener, threadPool,
scheduledThreadPool);
acceptor.start();
SimpleBufferHandler connectorHandler = new SimpleBufferHandler(connectorLatch);
@@ -273,8 +269,7 @@
conf.put(TransportConstants.HTTP_CLIENT_IDLE_SCAN_PERIOD, -1l);
DummyConnectionLifeCycleListener acceptorListener = new
DummyConnectionLifeCycleListener(connCreatedLatch);
SimpleBufferHandler acceptorHandler = new SimpleBufferHandler(acceptorLatch);
- DummyServerHolder serverHolder = new DummyServerHolder();
- acceptor = new NettyAcceptor(conf, acceptorHandler, serverHolder, acceptorListener,
threadPool, scheduledThreadPool);
+ acceptor = new NettyAcceptor(conf, acceptorHandler, acceptorListener, threadPool,
scheduledThreadPool);
acceptor.start();
SimpleBufferHandler connectorHandler = new SimpleBufferHandler(connectorLatch);
@@ -332,8 +327,7 @@
conf.put(TransportConstants.HTTP_CLIENT_IDLE_PROP_NAME, 500l);
DummyConnectionLifeCycleListener acceptorListener = new
DummyConnectionLifeCycleListener(connCreatedLatch);
SimpleBufferHandler acceptorHandler = new SimpleBufferHandler(acceptorLatch);
- DummyServerHolder serverHolder = new DummyServerHolder();
- acceptor = new NettyAcceptor(conf, acceptorHandler, serverHolder, acceptorListener,
threadPool, scheduledThreadPool);
+ acceptor = new NettyAcceptor(conf, acceptorHandler, acceptorListener, threadPool,
scheduledThreadPool);
acceptor.start();
SimpleBufferHandler connectorHandler = new SimpleBufferHandler(connectorLatch);
@@ -387,8 +381,7 @@
conf.put(TransportConstants.HTTP_SERVER_SCAN_PERIOD_PROP_NAME, 5000l);
DummyConnectionLifeCycleListener acceptorListener = new
DummyConnectionLifeCycleListener(connCreatedLatch);
SimpleBufferHandler acceptorHandler = new SimpleBufferHandler(acceptorLatch);
- DummyServerHolder serverHolder = new DummyServerHolder();
- acceptor = new NettyAcceptor(conf, acceptorHandler, serverHolder, acceptorListener,
threadPool, scheduledThreadPool);
+ acceptor = new NettyAcceptor(conf, acceptorHandler, acceptorListener, threadPool,
scheduledThreadPool);
acceptor.start();
BogusResponseHandler connectorHandler = new BogusResponseHandler(connectorLatch);
@@ -435,8 +428,7 @@
conf.put(TransportConstants.HTTP_SERVER_SCAN_PERIOD_PROP_NAME, 5000l);
DummyConnectionLifeCycleListener acceptorListener = new
DummyConnectionLifeCycleListener(connCreatedLatch);
SimpleBufferHandler2 acceptorHandler = new SimpleBufferHandler2(acceptorLatch);
- DummyServerHolder serverHolder = new DummyServerHolder();
- acceptor = new NettyAcceptor(conf, acceptorHandler, serverHolder, acceptorListener,
threadPool, scheduledThreadPool);
+ acceptor = new NettyAcceptor(conf, acceptorHandler, acceptorListener, threadPool,
scheduledThreadPool);
acceptor.start();
BogusResponseHandler connectorHandler = new BogusResponseHandler(connectorLatch);
Modified:
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/integration/stomp/StompTest.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/integration/stomp/StompTest.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -45,11 +45,11 @@
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.stomp.Stomp;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
-import org.hornetq.integration.protocol.stomp.Stomp;
import org.hornetq.integration.transports.netty.NettyAcceptorFactory;
import org.hornetq.integration.transports.netty.TransportConstants;
import org.hornetq.jms.client.HornetQConnectionFactory;
@@ -69,12 +69,12 @@
private Connection connection;
private Session session;
private Queue queue;
- private JMSServerManager server;
+ private JMSServerManager server;
public void testConnect() throws Exception {
- String connect_frame = "CONNECT\n" + "login: brianm\n" +
"passcode: wombats\n" + "request-id: 1\n" + "\n" +
Stomp.NULL;
- sendFrame(connect_frame);
+ String connect_frame = "CONNECT\n" + "login: brianm\n" +
"passcode: wombats\n" + "request-id: 1\n" + "\n" +
Stomp.NULL;
+ sendFrame(connect_frame);
String f = receiveFrame(10000);
Assert.assertTrue(f.startsWith("CONNECTED"));
Deleted:
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/DummyServerHolder.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/DummyServerHolder.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/DummyServerHolder.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -1,57 +0,0 @@
-/*
- * Copyright 2010 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.tests.unit.core.remoting.impl.netty;
-
-import org.hornetq.core.protocol.core.CoreRemotingConnection;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.integration.transports.netty.ServerHolder;
-
-/**
- * A DummyServerHolder
- *
- * @author jmesnil
- *
- *
- */
-public class DummyServerHolder implements ServerHolder
-{
- public HornetQServer getServer()
- {
- return null;
- }
-
- public CoreRemotingConnection getRemotingConnection(int connectionID)
- {
- return null;
- }
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Modified:
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/NettyAcceptorFactoryTest.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -23,7 +23,6 @@
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.integration.transports.netty.NettyAcceptor;
import org.hornetq.integration.transports.netty.NettyAcceptorFactory;
-import org.hornetq.integration.transports.netty.ServerHolder;
import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.Acceptor;
import org.hornetq.spi.core.remoting.BufferHandler;
@@ -68,10 +67,8 @@
{
}
};
- ServerHolder holder = new DummyServerHolder();
Acceptor acceptor = factory.createAcceptor(params,
handler,
- holder,
listener,
Executors.newCachedThreadPool(),
Executors.newScheduledThreadPool(ConfigurationImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE));
Modified:
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java
===================================================================
---
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java 2010-01-22
11:06:32 UTC (rev 8837)
+++
branches/HORNETQ-129_STOMP_protocol/tests/src/org/hornetq/tests/unit/core/remoting/impl/netty/NettyAcceptorTest.java 2010-01-22
12:22:23 UTC (rev 8838)
@@ -23,7 +23,6 @@
import org.hornetq.api.core.HornetQException;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.integration.transports.netty.NettyAcceptor;
-import org.hornetq.integration.transports.netty.ServerHolder;
import org.hornetq.integration.transports.netty.TransportConstants;
import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.BufferHandler;
@@ -82,11 +81,9 @@
{
}
};
- ServerHolder holder = new DummyServerHolder();
NettyAcceptor acceptor = new NettyAcceptor(params,
handler,
- holder,
listener,
Executors.newCachedThreadPool(),
Executors.newScheduledThreadPool(ConfigurationImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE));