Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.net4j.jms/src/org')
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/BytesMessageImpl.java185
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionFactoryImpl.java68
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionImpl.java405
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionMetaDataImpl.java71
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/DestinationImpl.java19
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/JMSDestination.java18
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/JMSTemporaryDestination.java20
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MapMessageImpl.java175
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageConsumerImpl.java159
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageImpl.java461
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageProducerImpl.java159
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/NotYetImplementedException.java35
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ObjectMessageImpl.java92
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueBrowserImpl.java54
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueImpl.java35
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueReceiverImpl.java26
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueSenderImpl.java39
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/SessionImpl.java448
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/StreamMessageImpl.java175
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TemporaryQueueImpl.java30
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TemporaryTopicImpl.java30
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TextMessageImpl.java66
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicImpl.java35
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicPublisherImpl.java50
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicSubscriberImpl.java43
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/bundle/OM.java53
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSAcknowledgeRequest.java44
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientMessageRequest.java53
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocol.java42
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocolFactory.java39
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCloseSessionRequest.java51
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCommitRequest.java74
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSDeregisterConsumerRequest.java55
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogoffRequest.java40
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogonRequest.java55
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSOpenSessionRequest.java51
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRecoverRequest.java51
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRegisterConsumerRequest.java70
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRollbackRequest.java51
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSServerMessageIndication.java47
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSSyncRequest.java53
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/DestinationUtil.java145
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/MessageUtil.java161
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/TypeUtil.java301
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSAdminProtocolConstants.java25
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSInitialContext.java85
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSProtocolConstants.java85
-rw-r--r--plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSUtil.java54
48 files changed, 0 insertions, 4583 deletions
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/BytesMessageImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/BytesMessageImpl.java
deleted file mode 100644
index 594c8b4ada..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/BytesMessageImpl.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-import java.io.IOException;
-
-public class BytesMessageImpl extends MessageImpl implements BytesMessage
-{
- public long getBodyLength()
- {
- throw new NotYetImplementedException();
- }
-
- public boolean readBoolean()
- {
- throw new NotYetImplementedException();
- }
-
- public byte readByte()
- {
- throw new NotYetImplementedException();
- }
-
- public int readBytes(byte[] value)
- {
- throw new NotYetImplementedException();
- }
-
- public int readBytes(byte[] value, int length)
- {
- throw new NotYetImplementedException();
- }
-
- public char readChar()
- {
- throw new NotYetImplementedException();
- }
-
- public double readDouble()
- {
- throw new NotYetImplementedException();
- }
-
- public float readFloat()
- {
- throw new NotYetImplementedException();
- }
-
- public int readInt()
- {
- throw new NotYetImplementedException();
- }
-
- public long readLong()
- {
- throw new NotYetImplementedException();
- }
-
- public short readShort()
- {
- throw new NotYetImplementedException();
- }
-
- public String readUTF()
- {
- throw new NotYetImplementedException();
- }
-
- public int readUnsignedByte()
- {
- throw new NotYetImplementedException();
- }
-
- public int readUnsignedShort()
- {
- throw new NotYetImplementedException();
- }
-
- public void reset()
- {
- throw new NotYetImplementedException();
- }
-
- public void writeBoolean(boolean value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeByte(byte value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeBytes(byte[] value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeBytes(byte[] value, int offset, int length)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeChar(char value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeDouble(double value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeFloat(float value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeInt(int value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeLong(long value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeObject(Object value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeShort(short value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeUTF(String value)
- {
- throw new NotYetImplementedException();
- }
-
- @Override
- public void populate(Message source) throws JMSException
- {
- super.populate(source);
- byte[] buffer = new byte[512];
- BytesMessage bytes = (BytesMessage)source;
-
- bytes.reset();
- int count;
- while ((count = bytes.readBytes(buffer)) != -1)
- {
- writeBytes(buffer, 0, count);
- }
- }
-
- @Override
- public void write(ExtendedDataOutputStream out) throws IOException
- {
- super.write(out);
- }
-
- @Override
- public void read(ExtendedDataInputStream in) throws IOException
- {
- super.read(in);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionFactoryImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionFactoryImpl.java
deleted file mode 100644
index 921df3c369..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionFactoryImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.util.container.IManagedContainer;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-
-import java.io.Serializable;
-import java.rmi.Remote;
-
-public class ConnectionFactoryImpl implements ConnectionFactory, Remote, Serializable
-{
- private static final long serialVersionUID = 1L;
-
- private String connectorType;
-
- private String connectorDescription;
-
- private Object transportContainer;
-
- public ConnectionFactoryImpl(String connectorType, String connectorDescription)
- {
- this.connectorType = connectorType;
- this.connectorDescription = connectorDescription;
- }
-
- public String getConnectorType()
- {
- return connectorType;
- }
-
- public String getConnectorDescription()
- {
- return connectorDescription;
- }
-
- public Object getTransportContainer()
- {
- return transportContainer;
- }
-
- public void setTransportContainer(Object transportContainer)
- {
- this.transportContainer = transportContainer;
- }
-
- public Connection createConnection() throws JMSException
- {
- return createConnection(null, null);
- }
-
- public Connection createConnection(String userName, String password) throws JMSException
- {
- return new ConnectionImpl((IManagedContainer)transportContainer, connectorType, connectorDescription, userName,
- password);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionImpl.java
deleted file mode 100644
index 435040e92d..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionImpl.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.Net4jUtil;
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.connector.IConnector;
-import org.eclipse.net4j.internal.jms.bundle.OM;
-import org.eclipse.net4j.internal.jms.protocol.JMSClientProtocol;
-import org.eclipse.net4j.internal.jms.protocol.JMSLogonRequest;
-import org.eclipse.net4j.internal.jms.protocol.JMSOpenSessionRequest;
-import org.eclipse.net4j.internal.util.container.Container;
-import org.eclipse.net4j.internal.util.container.LifecycleEventConverter;
-import org.eclipse.net4j.internal.util.container.SingleDeltaContainerEvent;
-import org.eclipse.net4j.internal.util.lifecycle.LifecycleEventAdapter;
-import org.eclipse.net4j.jms.JMSUtil;
-import org.eclipse.net4j.util.container.IContainer;
-import org.eclipse.net4j.util.container.IContainerDelta;
-import org.eclipse.net4j.util.container.IContainerEvent;
-import org.eclipse.net4j.util.container.IManagedContainer;
-import org.eclipse.net4j.util.container.IContainerDelta.Kind;
-import org.eclipse.net4j.util.event.IListener;
-import org.eclipse.net4j.util.lifecycle.ILifecycle;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionConsumer;
-import javax.jms.ConnectionMetaData;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.ServerSessionPool;
-import javax.jms.Session;
-import javax.jms.Topic;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ConnectionImpl extends Container<Session> implements Connection
-{
- private String connectorType;
-
- private String connectorDescription;
-
- private String userName;
-
- private String password;
-
- private ExceptionListener exceptionListener;
-
- private String clientID;
-
- private ConnectionMetaData metaData = new ConnectionMetaDataImpl(this);
-
- private long sendTimeout = 2500;
-
- private IManagedContainer transportContainer;
-
- private IChannel channel;
-
- private List<SessionImpl> sessions = new ArrayList<SessionImpl>(0);
-
- private transient IListener sessionListener = new LifecycleEventConverter<Session>(this)
- {
-
- @Override
- protected IContainerEvent<Session> createContainerEvent(IContainer<Session> container, Session element, Kind kind)
- {
- if (kind == IContainerDelta.Kind.REMOVED)
- {
- removeSession((SessionImpl)element);
- }
-
- return new SingleDeltaContainerEvent<Session>(container, element, kind);
- }
- };
-
- private transient IListener channelListener = new LifecycleEventAdapter()
- {
- @Override
- protected void onDeactivated(ILifecycle lifecycle)
- {
- close();
- }
- };
-
- private boolean modified = false;
-
- private boolean stopped = true;
-
- public ConnectionImpl(IManagedContainer transportContainer, String connectorType, String connectorDescription,
- String userName, String password) throws JMSException
- {
- this.transportContainer = transportContainer == null ? JMSUtil.getTransportContainer() : transportContainer;
- if (transportContainer == null)
- {
- throw new JMSException("No transport container available");
- }
-
- this.connectorType = connectorType;
- this.connectorDescription = connectorDescription;
- this.userName = userName;
- this.password = password;
-
- IConnector connector = Net4jUtil.getConnector(transportContainer, connectorType, connectorDescription);
- JMSClientProtocol protocol = new JMSClientProtocol();
- protocol.setInfraStructure(this);
- channel = connector.openChannel(protocol);
- channel.addListener(channelListener);
-
- try
- {
- if (!new JMSLogonRequest(channel, userName, password).send())
- {
- throw new JMSException("Server rejected logon request");
- }
- }
- catch (JMSException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new JMSException(ex.getMessage());
- }
- }
-
- public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector,
- ServerSessionPool sessionPool, int maxMessages)
- {
- throw new UnsupportedOperationException();
- }
-
- public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName,
- String messageSelector, ServerSessionPool sessionPool, int maxMessages)
- {
- throw new UnsupportedOperationException();
- }
-
- public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException
- {
- ensureOpen();
- setModified();
- int sessionID = findFreeSessionID();
- SessionImpl session = new SessionImpl(this, sessionID, transacted, acknowledgeMode);
- addSession(session);
-
- try
- {
- if (!new JMSOpenSessionRequest(channel, sessionID).send())
- {
- throw new JMSException("Server rejected open session request");
- }
- }
- catch (JMSException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new JMSException(ex.getMessage());
- }
-
- return session;
- }
-
- public IManagedContainer getTransportContainer()
- {
- return transportContainer;
- }
-
- public String getConnectorType()
- {
- return connectorType;
- }
-
- public String getConnectorDescription()
- {
- return connectorDescription;
- }
-
- public String getUserName()
- {
- return userName;
- }
-
- public String getPassword()
- {
- return password;
- }
-
- public ConnectionMetaData getMetaData()
- {
- ensureOpen();
- setModified();
- return metaData;
- }
-
- public String getClientID()
- {
- ensureOpen();
- setModified();
- return clientID;
- }
-
- public void setClientID(String clientID)
- {
- ensureOpen();
- if (clientID != null)
- {
- throw new IllegalStateException("clientID != null");
- }
-
- if (modified)
- {
- throw new IllegalStateException("modified == true");
- }
-
- this.clientID = clientID;
- }
-
- public ExceptionListener getExceptionListener()
- {
- ensureOpen();
- setModified();
- return exceptionListener;
- }
-
- public void setExceptionListener(ExceptionListener listener)
- {
- ensureOpen();
- setModified();
- exceptionListener = listener;
- }
-
- public long getSendTimeout()
- {
- return sendTimeout;
- }
-
- public void setSendTimeout(long sendTimeout)
- {
- this.sendTimeout = sendTimeout;
- }
-
- public synchronized void start() throws JMSException
- {
- ensureOpen();
- setModified();
- if (stopped)
- {
- for (SessionImpl session : getSessions())
- {
- try
- {
- session.activate();
- }
- catch (Exception ex)
- {
- OM.LOG.error(ex);
- throw new JMSException(ex.getMessage());
- }
- }
-
- stopped = false;
- }
- }
-
- public synchronized void stop()
- {
- ensureOpen();
- setModified();
- if (!stopped)
- {
- for (SessionImpl session : getSessions())
- {
- session.deactivate();
- }
-
- stopped = true;
- }
- }
-
- public synchronized void close()
- {
- if (channel != null)
- {
- stop();
- for (SessionImpl session : getSessions())
- {
- session.close();
- }
-
- channel.removeListener(channelListener);
- channel.close();
- channel = null;
- }
- }
-
- public IChannel getChannel()
- {
- return channel;
- }
-
- public void handleMessageFromSignal(int sessionID, long consumerID, MessageImpl message)
- {
- SessionImpl session = sessions.get(sessionID);
- session.handleServerMessage(consumerID, message);
- }
-
- public SessionImpl[] getSessions()
- {
- List<SessionImpl> result = new ArrayList<SessionImpl>(sessions.size());
- synchronized (sessions)
- {
- for (SessionImpl session : sessions)
- {
- if (session != null)
- {
- result.add(session);
- }
- }
- }
-
- return result.toArray(new SessionImpl[result.size()]);
- }
-
- public Session[] getElements()
- {
- return getSessions();
- }
-
- @Override
- public boolean isEmpty()
- {
- return getSessions().length == 0;
- }
-
- private int findFreeSessionID()
- {
- synchronized (sessions)
- {
- int size = sessions.size();
- for (int i = 0; i < size; i++)
- {
- if (sessions.get(i) == null)
- {
- return i;
- }
- }
-
- return size;
- }
- }
-
- private void addSession(SessionImpl session)
- {
- synchronized (sessions)
- {
- int sessionID = session.getID();
- while (sessionID >= sessions.size())
- {
- sessions.add(null);
- }
-
- sessions.set(sessionID, session);
- }
- }
-
- private boolean removeSession(SessionImpl session)
- {
- synchronized (sessions)
- {
- int sessionID = session.getID();
- if (sessions.get(sessionID) == session)
- {
- session.removeListener(sessionListener);
- sessions.set(sessionID, null);
- return true;
- }
-
- return false;
- }
- }
-
- private void setModified()
- {
- modified = true;
- }
-
- private void ensureOpen() throws IllegalStateException
- {
- if (channel == null)
- {
- throw new IllegalStateException("channel == null");
- }
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionMetaDataImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionMetaDataImpl.java
deleted file mode 100644
index 996de7f3a8..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ConnectionMetaDataImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.ConnectionMetaData;
-
-import java.util.Enumeration;
-import java.util.StringTokenizer;
-
-public class ConnectionMetaDataImpl implements ConnectionMetaData
-{
- private ConnectionImpl connection;
-
- public ConnectionMetaDataImpl(ConnectionImpl connection)
- {
- this.connection = connection;
- }
-
- public ConnectionImpl getConnection()
- {
- return connection;
- }
-
- public int getJMSMajorVersion()
- {
- return 1;
- }
-
- public int getJMSMinorVersion()
- {
- return 1;
- }
-
- public String getJMSVersion()
- {
- return "1.1";
- }
-
- public String getJMSProviderName()
- {
- return "Net4j JMS";
- }
-
- public int getProviderMajorVersion()
- {
- return 0;
- }
-
- public int getProviderMinorVersion()
- {
- return 8;
- }
-
- public String getProviderVersion()
- {
- return "0.8.0";
- }
-
- public Enumeration<?> getJMSXPropertyNames()
- {
- return new StringTokenizer("");
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/DestinationImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/DestinationImpl.java
deleted file mode 100644
index 899748b210..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/DestinationImpl.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import java.io.Serializable;
-import java.rmi.Remote;
-
-public abstract class DestinationImpl implements JMSDestination, Remote, Serializable
-{
- private static final long serialVersionUID = 1L;
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/JMSDestination.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/JMSDestination.java
deleted file mode 100644
index bcb39bff5d..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/JMSDestination.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.Destination;
-
-public interface JMSDestination extends Destination
-{
- public String getName();
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/JMSTemporaryDestination.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/JMSTemporaryDestination.java
deleted file mode 100644
index 5cc1e2d06b..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/JMSTemporaryDestination.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-public interface JMSTemporaryDestination extends JMSDestination
-{
- public ConnectionImpl getOwningConnection();
-
- public long getConnectionId();
-
- public boolean validForConnection(ConnectionImpl connection);
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MapMessageImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MapMessageImpl.java
deleted file mode 100644
index 424ce1904a..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MapMessageImpl.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-
-import java.io.IOException;
-import java.util.Enumeration;
-
-public class MapMessageImpl extends MessageImpl implements MapMessage
-{
- public boolean getBoolean(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public byte getByte(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public byte[] getBytes(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public char getChar(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public double getDouble(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public float getFloat(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public int getInt(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public long getLong(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public Enumeration<?> getMapNames()
- {
- throw new NotYetImplementedException();
- }
-
- public Object getObject(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public short getShort(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public String getString(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public boolean itemExists(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public void setBoolean(String name, boolean value)
- {
- throw new NotYetImplementedException();
- }
-
- public void setByte(String name, byte value)
- {
- throw new NotYetImplementedException();
- }
-
- public void setBytes(String name, byte[] value)
- {
- throw new NotYetImplementedException();
- }
-
- public void setBytes(String name, byte[] value, int offset, int length)
- {
- throw new NotYetImplementedException();
- }
-
- public void setChar(String name, char value)
- {
- throw new NotYetImplementedException();
- }
-
- public void setDouble(String name, double value)
- {
- throw new NotYetImplementedException();
- }
-
- public void setFloat(String name, float value)
- {
- throw new NotYetImplementedException();
- }
-
- public void setInt(String name, int value)
- {
- throw new NotYetImplementedException();
- }
-
- public void setLong(String name, long value)
- {
- throw new NotYetImplementedException();
- }
-
- public void setObject(String name, Object value)
- {
- throw new NotYetImplementedException();
- }
-
- public void setShort(String name, short value)
- {
- throw new NotYetImplementedException();
- }
-
- public void setString(String name, String value)
- {
- throw new NotYetImplementedException();
- }
-
- @Override
- public void populate(Message source) throws JMSException
- {
- super.populate(source);
- MapMessage map = (MapMessage)source;
- Enumeration<?> e = map.getMapNames();
- while (e.hasMoreElements())
- {
- String name = (String)e.nextElement();
- Object value = map.getObject(name);
- setObject(name, value);
- }
- }
-
- @Override
- public void write(ExtendedDataOutputStream out) throws IOException
- {
- super.write(out);
- }
-
- @Override
- public void read(ExtendedDataInputStream in) throws IOException
- {
- super.read(in);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageConsumerImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageConsumerImpl.java
deleted file mode 100644
index e4a5a997d6..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageConsumerImpl.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.internal.jms.bundle.OM;
-import org.eclipse.net4j.internal.util.lifecycle.Lifecycle;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-
-public class MessageConsumerImpl extends Lifecycle implements MessageConsumer
-{
- private static final long DO_NOT_WAIT = -1L;
-
- private SessionImpl session;
-
- private long consumerID;
-
- private DestinationImpl destination;
-
- private String messageSelector;
-
- private MessageListener messageListener;
-
- /**
- * Incoming messages
- */
- private BlockingQueue<MessageImpl> messages = new LinkedBlockingQueue<MessageImpl>();
-
- public MessageConsumerImpl(SessionImpl session, long consumerID, DestinationImpl destination, String messageSelector)
- {
- this.session = session;
- this.consumerID = consumerID;
- this.destination = destination;
- this.messageSelector = messageSelector;
- }
-
- public SessionImpl getSession()
- {
- return session;
- }
-
- public long getConsumerID()
- {
- return consumerID;
- }
-
- public DestinationImpl getDestination()
- {
- return destination;
- }
-
- public String getMessageSelector()
- {
- return messageSelector;
- }
-
- public MessageListener getMessageListener()
- {
- return messageListener;
- }
-
- public void setMessageListener(MessageListener listener)
- {
- messageListener = listener;
- if (messageListener != null)
- {
- session.addWork(this);
- }
- }
-
- public Message receive() throws JMSException
- {
- return receive(Long.MAX_VALUE);
- }
-
- public Message receive(long timeout) throws JMSException
- {
- if (messageListener != null)
- {
- throw new JMSException("Consumer is configured for asynchronous delivery");
- }
-
- if (timeout == DO_NOT_WAIT)
- {
- return messages.poll();
- }
-
- try
- {
- return messages.poll(timeout, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException ex)
- {
- throw new JMSException(ex.getMessage());
- }
- }
-
- public Message receiveNoWait() throws JMSException
- {
- return receive(DO_NOT_WAIT);
- }
-
- public void close()
- {
- throw new NotYetImplementedException();
- }
-
- public void handleServerMessage(MessageImpl message)
- {
- messages.add(message);
- if (messageListener != null)
- {
- session.addWork(this);
- }
- }
-
- public void dispatchMessage()
- {
- MessageListener listener = messageListener;
- if (listener != null)
- {
- MessageImpl message = messages.poll();
- if (message == null)
- {
- OM.LOG.warn("No message to dispatch");
- return;
- }
-
- try
- {
- listener.onMessage(message);
- if (!session.getTransacted() && session.getAcknowledgeMode() != Session.CLIENT_ACKNOWLEDGE)
- {
- session.acknowledgeMessages(this);
- }
- }
- catch (RuntimeException ex)
- {
- OM.LOG.warn(ex);
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageImpl.java
deleted file mode 100644
index e2075051cc..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageImpl.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.internal.jms.util.DestinationUtil;
-import org.eclipse.net4j.internal.jms.util.TypeUtil;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageFormatException;
-import javax.jms.Session;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-public class MessageImpl implements Message, Comparable<MessageImpl>
-{
- private static final String[] KEYWORDS = { "and", "between", "escape", "in", "is", "like", "false", "null", "or",
- "not", "true" };
-
- private Map<String, Object> properties = new HashMap<String, Object>();
-
- private byte[] correlationID;
-
- private int deliveryMode;
-
- private DestinationImpl destination;
-
- private long expiration;
-
- private String messageID;
-
- private int priority;
-
- private boolean redelivered;
-
- private DestinationImpl replyTo;
-
- private long timestamp;
-
- private String type;
-
- private SessionImpl receivingSession;
-
- private MessageConsumerImpl receivingConsumer;
-
- public MessageImpl()
- {
- }
-
- public SessionImpl getReceivingSession()
- {
- return receivingSession;
- }
-
- public void setReceivingSession(SessionImpl receivingSession)
- {
- this.receivingSession = receivingSession;
- }
-
- public MessageConsumerImpl getReceivingConsumer()
- {
- return receivingConsumer;
- }
-
- public void setReceivingConsumer(MessageConsumerImpl receivingConsumer)
- {
- this.receivingConsumer = receivingConsumer;
- }
-
- public String getJMSCorrelationID()
- {
- if (correlationID == null)
- {
- return null;
- }
-
- return new String(correlationID);
- }
-
- public void setJMSCorrelationID(String correlationID)
- {
- this.correlationID = correlationID == null ? null : correlationID.getBytes();
- }
-
- public byte[] getJMSCorrelationIDAsBytes()
- {
- return correlationID;
- }
-
- public void setJMSCorrelationIDAsBytes(byte[] correlationID)
- {
- this.correlationID = correlationID;
- }
-
- public int getJMSDeliveryMode()
- {
- return deliveryMode;
- }
-
- public void setJMSDeliveryMode(int deliveryMode)
- {
- this.deliveryMode = deliveryMode;
- }
-
- public Destination getJMSDestination()
- {
- return destination;
- }
-
- public void setJMSDestination(Destination destination) throws JMSException
- {
- this.destination = DestinationUtil.convert(destination);
- }
-
- public long getJMSExpiration()
- {
- return expiration;
- }
-
- public void setJMSExpiration(long expiration)
- {
- this.expiration = expiration;
- }
-
- public String getJMSMessageID()
- {
- return messageID;
- }
-
- public void setJMSMessageID(String messageID)
- {
- this.messageID = messageID;
- }
-
- public int getJMSPriority()
- {
- return priority;
- }
-
- public void setJMSPriority(int priority)
- {
- this.priority = priority;
- }
-
- public boolean getJMSRedelivered()
- {
- return redelivered;
- }
-
- public void setJMSRedelivered(boolean redelivered)
- {
- this.redelivered = redelivered;
- }
-
- public Destination getJMSReplyTo()
- {
- return replyTo;
- }
-
- public void setJMSReplyTo(Destination replyTo) throws JMSException
- {
- this.replyTo = DestinationUtil.convert(replyTo);
- }
-
- public long getJMSTimestamp()
- {
- return timestamp;
- }
-
- public void setJMSTimestamp(long timestamp)
- {
- this.timestamp = timestamp;
- }
-
- public String getJMSType()
- {
- return type;
- }
-
- public void setJMSType(String type)
- {
- this.type = type;
- }
-
- public void clearProperties()
- {
- properties.clear();
- }
-
- public boolean propertyExists(String name)
- {
- return properties.containsKey(name);
- }
-
- public boolean getBooleanProperty(String name) throws MessageFormatException
- {
- return TypeUtil.getBoolean(properties.get(name));
- }
-
- public byte getByteProperty(String name) throws MessageFormatException
- {
- return TypeUtil.getByte(properties.get(name));
- }
-
- public short getShortProperty(String name) throws MessageFormatException
- {
- return TypeUtil.getShort(properties.get(name));
- }
-
- public int getIntProperty(String name) throws MessageFormatException
- {
- return TypeUtil.getInt(properties.get(name));
- }
-
- public long getLongProperty(String name) throws MessageFormatException
- {
- return TypeUtil.getLong(properties.get(name));
- }
-
- public float getFloatProperty(String name) throws MessageFormatException
- {
- return TypeUtil.getFloat(properties.get(name));
- }
-
- public double getDoubleProperty(String name) throws MessageFormatException
- {
- return TypeUtil.getDouble(properties.get(name));
- }
-
- public String getStringProperty(String name) throws MessageFormatException
- {
- return TypeUtil.getString(properties.get(name));
- }
-
- public Object getObjectProperty(String name)
- {
- return properties.get(name);
- }
-
- public Enumeration<String> getPropertyNames()
- {
- return Collections.enumeration(properties.keySet());
- }
-
- public void setBooleanProperty(String name, boolean value) throws JMSException
- {
- setProperty(name, value);
- }
-
- public void setByteProperty(String name, byte value) throws JMSException
- {
- setProperty(name, value);
- }
-
- public void setShortProperty(String name, short value) throws JMSException
- {
- setProperty(name, value);
- }
-
- public void setIntProperty(String name, int value) throws JMSException
- {
- setProperty(name, value);
- }
-
- public void setLongProperty(String name, long value) throws JMSException
- {
- setProperty(name, value);
- }
-
- public void setFloatProperty(String name, float value) throws JMSException
- {
- setProperty(name, value);
- }
-
- public void setDoubleProperty(String name, double value) throws JMSException
- {
- setProperty(name, value);
- }
-
- public void setStringProperty(String name, String value) throws JMSException
- {
- setProperty(name, value);
- }
-
- public void setObjectProperty(String name, Object value) throws JMSException
- {
- if (value instanceof Boolean || value instanceof Byte || value instanceof Short || value instanceof Integer
- || value instanceof Long || value instanceof Float || value instanceof Double || value instanceof String
- || value == null)
- {
- setProperty(name, value);
- }
- else
- {
- throw new MessageFormatException("Values of type" + value.getClass().getName() + " are not supported");
- }
- }
-
- protected void setProperty(String name, Object value) throws JMSException
- {
- if (name == null)
- {
- throw new JMSException("Invalid property name: " + name);
- }
-
- char[] chars = name.toCharArray();
- if (chars.length == 0)
- {
- throw new JMSException("Invalid property name: " + name);
- }
-
- if (!Character.isJavaIdentifierStart(chars[0]))
- {
- throw new JMSException("Invalid property name: " + name);
- }
-
- for (int i = 1; i < chars.length; ++i)
- {
- if (!Character.isJavaIdentifierPart(chars[i]))
- {
- throw new JMSException("Invalid property name: " + name);
- }
- }
-
- for (int i = 0; i < KEYWORDS.length; ++i)
- {
- if (name.equalsIgnoreCase(KEYWORDS[i]))
- {
- throw new JMSException("Invalid property name: " + name);
- }
- }
-
- properties.put(name, value);
- }
-
- public void acknowledge()
- {
- if (receivingSession == null)
- {
- return;
- }
-
- if (!receivingSession.isActive())
- {
- return;
- }
-
- if (receivingSession.getTransacted())
- {
- return;
- }
-
- if (receivingSession.getAcknowledgeMode() != Session.CLIENT_ACKNOWLEDGE)
- {
- return;
- }
-
- receivingSession.acknowledgeMessages(receivingConsumer);
- }
-
- public void clearBody()
- {
- throw new NotYetImplementedException();
- }
-
- public int compareTo(MessageImpl obj)
- {
- if (priority < obj.priority)
- {
- return -1;
- }
-
- if (priority > obj.priority)
- {
- return 1;
- }
-
- return 0;
- }
-
- @SuppressWarnings("unchecked")
- public void populate(Message source) throws JMSException
- {
- setJMSMessageID(source.getJMSMessageID());
- setJMSDestination(source.getJMSDestination());
- setJMSTimestamp(source.getJMSTimestamp());
- setJMSPriority(source.getJMSPriority());
- setJMSExpiration(source.getJMSExpiration());
- setJMSDeliveryMode(source.getJMSDeliveryMode());
- setJMSCorrelationID(source.getJMSCorrelationID());
- setJMSType(source.getJMSType());
- setJMSReplyTo(source.getJMSReplyTo());
-
- Enumeration<String> e = source.getPropertyNames();
- while (e.hasMoreElements())
- {
- String name = e.nextElement();
- Object value = source.getObjectProperty(name);
- setObjectProperty(name, value);
- }
- }
-
- public void write(ExtendedDataOutputStream out) throws IOException
- {
- out.writeByteArray(correlationID);
- out.writeByte(deliveryMode);
- DestinationUtil.write(out, destination);
- out.writeLong(expiration);
- out.writeString(messageID);
- out.writeByte(priority);
- out.writeBoolean(redelivered);
- DestinationUtil.write(out, replyTo);
- out.writeLong(timestamp);
- out.writeString(type);
-
- out.writeInt(properties.size());
- for (Entry<String, Object> entry : properties.entrySet())
- {
- out.writeString(entry.getKey());
- TypeUtil.write(out, entry.getValue());
- }
- }
-
- public void read(ExtendedDataInputStream in) throws IOException
- {
- correlationID = in.readByteArray();
- deliveryMode = in.readByte();
- destination = DestinationUtil.read(in);
- expiration = in.readLong();
- messageID = in.readString();
- priority = in.readByte();
- redelivered = in.readBoolean();
- replyTo = DestinationUtil.read(in);
- timestamp = in.readLong();
- type = in.readString();
-
- int size = in.readInt();
- for (int i = 0; i < size; i++)
- {
- String key = in.readString();
- Object value = TypeUtil.read(in);
- properties.put(key, value);
- }
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageProducerImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageProducerImpl.java
deleted file mode 100644
index e3a8b229cd..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/MessageProducerImpl.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.internal.util.lifecycle.Lifecycle;
-
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageFormatException;
-import javax.jms.MessageProducer;
-
-import java.util.Date;
-
-public class MessageProducerImpl extends Lifecycle implements MessageProducer
-{
- private SessionImpl session;
-
- private DestinationImpl destination;
-
- private int deliveryMode = DeliveryMode.PERSISTENT;
-
- private int priority = Message.DEFAULT_PRIORITY;
-
- private long timeToLive = 0;
-
- private boolean disableMessageTimestamp = false;
-
- private boolean disableMessageID = false;
-
- public MessageProducerImpl(SessionImpl session, DestinationImpl destination)
- {
- this.session = session;
- this.destination = destination;
- }
-
- public SessionImpl getSession()
- {
- return session;
- }
-
- public int getDeliveryMode()
- {
- return deliveryMode;
- }
-
- public void setDeliveryMode(int deliveryMode)
- {
- this.deliveryMode = deliveryMode;
- }
-
- public int getPriority()
- {
- return priority;
- }
-
- public void setPriority(int priority)
- {
- this.priority = priority;
- }
-
- public long getTimeToLive()
- {
- return timeToLive;
- }
-
- public void setTimeToLive(long timeToLive)
- {
- this.timeToLive = timeToLive;
- }
-
- public DestinationImpl getDestination()
- {
- return destination;
- }
-
- public boolean getDisableMessageID()
- {
- return disableMessageID;
- }
-
- public void setDisableMessageID(boolean disableMessageID)
- {
- this.disableMessageID = disableMessageID;
- }
-
- public boolean getDisableMessageTimestamp()
- {
- return disableMessageTimestamp;
- }
-
- public void setDisableMessageTimestamp(boolean disableMessageTimestamp)
- {
- this.disableMessageTimestamp = disableMessageTimestamp;
- }
-
- public void send(Message message) throws JMSException
- {
- send(getDestination(), message, getDeliveryMode(), getPriority(), getTimeToLive());
- }
-
- public void send(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
- {
- send(getDestination(), message, getDeliveryMode(), getPriority(), getTimeToLive());
- }
-
- public void send(Destination destination, Message message) throws JMSException
- {
- send(destination, message, getDeliveryMode(), getPriority(), getTimeToLive());
- }
-
- public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive)
- throws JMSException
- {
- if (message == null)
- {
- throw new MessageFormatException("Null message");
- }
-
- // message.setJMSMessageID(MessageId.create());
- message.setJMSDestination(destination);
- message.setJMSTimestamp(new Date().getTime());
- message.setJMSPriority(priority);
-
- if (timeToLive > 0)
- {
- message.setJMSExpiration(System.currentTimeMillis() + timeToLive);
- }
- else
- {
- message.setJMSExpiration(0);
- }
-
- if (destination instanceof JMSTemporaryDestination)
- {
- message.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
- }
- else
- {
- message.setJMSDeliveryMode(deliveryMode);
- }
-
- session.sendMessage(message);
- }
-
- public void close()
- {
- throw new NotYetImplementedException();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/NotYetImplementedException.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/NotYetImplementedException.java
deleted file mode 100644
index dadeff88e6..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/NotYetImplementedException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-public class NotYetImplementedException extends RuntimeException
-{
- private static final long serialVersionUID = 1L;
-
- public NotYetImplementedException()
- {
- }
-
- public NotYetImplementedException(String message)
- {
- super(message);
- }
-
- public NotYetImplementedException(Throwable cause)
- {
- super(cause);
- }
-
- public NotYetImplementedException(String message, Throwable cause)
- {
- super(message, cause);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ObjectMessageImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ObjectMessageImpl.java
deleted file mode 100644
index cf9ecb92aa..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/ObjectMessageImpl.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.internal.jms.bundle.OM;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-public class ObjectMessageImpl extends MessageImpl implements ObjectMessage
-{
- private Serializable object;
-
- public ObjectMessageImpl()
- {
- }
-
- public ObjectMessageImpl(Serializable object)
- {
- this.object = object;
- }
-
- public Serializable getObject()
- {
- return object;
- }
-
- public void setObject(Serializable object)
- {
- this.object = object;
- }
-
- @Override
- public void populate(Message source) throws JMSException
- {
- super.populate(source);
- ObjectMessage object = (ObjectMessage)source;
- setObject(object.getObject());
- }
-
- @Override
- public void write(ExtendedDataOutputStream out) throws IOException
- {
- super.write(out);
- if (object != null)
- {
- out.writeBoolean(true);
- ObjectOutputStream stream = new ObjectOutputStream(out);
- stream.writeObject(object);
- }
- else
- {
- out.writeBoolean(false);
- }
- }
-
- @Override
- public void read(ExtendedDataInputStream in) throws IOException
- {
- super.read(in);
- boolean notNull = in.readBoolean();
- if (notNull)
- {
- try
- {
- ObjectInputStream stream = new ObjectInputStream(in);
- object = (Serializable)stream.readObject();
- }
- catch (ClassNotFoundException ex)
- {
- OM.LOG.error(ex);
- throw new IOException(ex.getMessage());
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueBrowserImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueBrowserImpl.java
deleted file mode 100644
index a7ad077d57..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueBrowserImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-
-import java.util.Enumeration;
-
-public class QueueBrowserImpl implements QueueBrowser
-{
- private Queue queue;
-
- private String messageSelector;
-
- public QueueBrowserImpl(Queue queue, String messageSelector)
- {
- this.queue = queue;
- this.messageSelector = messageSelector;
- }
-
- public QueueBrowserImpl(Queue queue)
- {
- this(queue, null);
- }
-
- public Queue getQueue()
- {
- return queue;
- }
-
- public String getMessageSelector()
- {
- return messageSelector;
- }
-
- public void close()
- {
- throw new NotYetImplementedException();
- }
-
- public Enumeration<?> getEnumeration()
- {
- throw new NotYetImplementedException();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueImpl.java
deleted file mode 100644
index 934f1a4600..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.Queue;
-
-public class QueueImpl extends DestinationImpl implements Queue
-{
- private static final long serialVersionUID = 1L;
-
- private String queueName;
-
- public QueueImpl(String queueName)
- {
- this.queueName = queueName;
- }
-
- public String getQueueName()
- {
- return queueName;
- }
-
- public String getName()
- {
- return queueName;
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueReceiverImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueReceiverImpl.java
deleted file mode 100644
index c218ffcf5e..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueReceiverImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.QueueReceiver;
-
-public class QueueReceiverImpl extends MessageConsumerImpl implements QueueReceiver
-{
- public QueueReceiverImpl(SessionImpl session, int id, QueueImpl queue, String messageSelector)
- {
- super(session, id, queue, messageSelector);
- }
-
- public QueueImpl getQueue()
- {
- return (QueueImpl)getDestination();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueSenderImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueSenderImpl.java
deleted file mode 100644
index b38d52232f..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/QueueSenderImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Queue;
-import javax.jms.QueueSender;
-
-public class QueueSenderImpl extends MessageProducerImpl implements QueueSender
-{
- public QueueSenderImpl(SessionImpl session, QueueImpl queue)
- {
- super(session, queue);
- }
-
- public QueueImpl getQueue()
- {
- return (QueueImpl)getDestination();
- }
-
- public void send(Queue queue, Message message) throws JMSException
- {
- send(queue, message, getDeliveryMode(), getPriority(), getTimeToLive());
- }
-
- public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
- {
- super.send(queue, message, deliveryMode, priority, timeToLive);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/SessionImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/SessionImpl.java
deleted file mode 100644
index fb027d5241..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/SessionImpl.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.internal.jms.bundle.OM;
-import org.eclipse.net4j.internal.jms.protocol.JMSAcknowledgeRequest;
-import org.eclipse.net4j.internal.jms.protocol.JMSClientMessageRequest;
-import org.eclipse.net4j.internal.jms.protocol.JMSCommitRequest;
-import org.eclipse.net4j.internal.jms.protocol.JMSRecoverRequest;
-import org.eclipse.net4j.internal.jms.protocol.JMSRegisterConsumerRequest;
-import org.eclipse.net4j.internal.jms.protocol.JMSRollbackRequest;
-import org.eclipse.net4j.internal.jms.util.DestinationUtil;
-import org.eclipse.net4j.internal.jms.util.MessageUtil;
-import org.eclipse.net4j.internal.util.lifecycle.QueueWorker;
-
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicSubscriber;
-import javax.transaction.TransactionRolledbackException;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class SessionImpl extends QueueWorker<MessageConsumerImpl> implements Session
-{
- private ConnectionImpl connection;
-
- private int id;
-
- private boolean transacted;
-
- private int acknowledgeMode;
-
- private Map<Long, MessageConsumerImpl> consumers = new HashMap<Long, MessageConsumerImpl>();
-
- /**
- * Outgoing transacted messages
- */
- private List<MessageImpl> messages = new ArrayList<MessageImpl>();
-
- private Set<MessageProducerImpl> producers = new HashSet<MessageProducerImpl>();
-
- public SessionImpl(ConnectionImpl connection, int id, boolean transacted, int acknowledgeMode) throws JMSException
- {
- this.connection = connection;
- this.id = id;
- this.transacted = transacted;
- this.acknowledgeMode = acknowledgeMode;
-
- try
- {
- activate();
- }
- catch (Exception ex)
- {
- throw new JMSException(ex.getMessage());
- }
- }
-
- public ConnectionImpl getConnection()
- {
- return connection;
- }
-
- public int getID()
- {
- return id;
- }
-
- public boolean getTransacted()
- {
- return transacted;
- }
-
- public int getAcknowledgeMode()
- {
- return acknowledgeMode;
- }
-
- public MessageListener getMessageListener()
- {
- return null;
- }
-
- public void setMessageListener(MessageListener listener)
- {
- throw new UnsupportedOperationException();
- }
-
- public MessageProducer createProducer(Destination destination) throws JMSException
- {
- DestinationImpl dest = DestinationUtil.convert(destination);
- MessageProducerImpl producer = new MessageProducerImpl(this, dest);
- producers.add(producer);
- return producer;
- }
-
- public MessageConsumer createConsumer(Destination destination) throws JMSException
- {
- return createConsumer(destination, null);
- }
-
- public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException
- {
- return createConsumer(destination, null, false);
- }
-
- public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal)
- throws JMSException
- {
- DestinationImpl dest = DestinationUtil.convert(destination);
- long consumerID = registerConsumer(dest, messageSelector, noLocal, false);
- MessageConsumerImpl consumer = new MessageConsumerImpl(this, consumerID, dest, messageSelector);
- consumers.put(consumerID, consumer);
- return consumer;
- }
-
- public Queue createQueue(String queueName)
- {
- return new QueueImpl(queueName);
- }
-
- public TemporaryQueue createTemporaryQueue()
- {
- return new TemporaryQueueImpl();
- }
-
- public QueueBrowser createBrowser(Queue queue)
- {
- return new QueueBrowserImpl(queue);
- }
-
- public QueueBrowser createBrowser(Queue queue, String messageSelector)
- {
- return new QueueBrowserImpl(queue, messageSelector);
- }
-
- public Topic createTopic(String topicName)
- {
- return new TopicImpl(topicName);
- }
-
- public TemporaryTopic createTemporaryTopic()
- {
- return new TemporaryTopicImpl();
- }
-
- public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
- {
- return createDurableSubscriber(topic, name, null, false);
- }
-
- public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal)
- throws JMSException
- {
- TopicImpl dest = (TopicImpl)DestinationUtil.convert(topic);
- long consumerID = registerConsumer(dest, messageSelector, noLocal, true);
- TopicSubscriberImpl subscriber = new TopicSubscriberImpl(this, consumerID, dest, name, messageSelector, noLocal);
- consumers.put(consumerID, subscriber);
- return subscriber;
- }
-
- public void unsubscribe(String name)
- {
- throw new NotYetImplementedException();
- }
-
- public Message createMessage()
- {
- return new MessageImpl();
- }
-
- public StreamMessage createStreamMessage()
- {
- return new StreamMessageImpl();
- }
-
- public BytesMessage createBytesMessage()
- {
- return new BytesMessageImpl();
- }
-
- public MapMessage createMapMessage()
- {
- return new MapMessageImpl();
- }
-
- public ObjectMessage createObjectMessage()
- {
- return createObjectMessage(null);
- }
-
- public ObjectMessage createObjectMessage(Serializable object)
- {
- return new ObjectMessageImpl(object);
- }
-
- public TextMessage createTextMessage()
- {
- return createTextMessage(null);
- }
-
- public TextMessage createTextMessage(String text)
- {
- return new TextMessageImpl(text);
- }
-
- public void recover() throws JMSException
- {
- ensureNotTransacted();
- try
- {
- stop();
- new JMSRecoverRequest(connection.getChannel(), id).send();
- start();
- }
- catch (Exception ex)
- {
- OM.LOG.error(ex);
- close();
- }
- }
-
- public void commit() throws JMSException
- {
- ensureTransacted();
- synchronized (messages)
- {
- try
- {
- String[] messageIDs = new JMSCommitRequest(connection.getChannel(), id, messages).send();
- if (messageIDs == null)
- {
- throw new TransactionRolledbackException("Transaction rolled back by JMS server");
- }
-
- for (int i = 0; i < messageIDs.length; i++)
- {
- messages.get(i).setJMSMessageID(messageIDs[i]);
- }
-
- messages.clear();
- }
- catch (JMSException ex)
- {
- throw ex;
- }
- catch (RuntimeException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new JMSException(ex.getMessage());
- }
- }
- }
-
- public void rollback() throws JMSException
- {
- ensureTransacted();
- synchronized (messages)
- {
- try
- {
- if (!new JMSRollbackRequest(connection.getChannel(), id).send())
- {
- throw new JMSException("JMS server failed to rolled back transaction");
- }
-
- messages.clear();
- }
- catch (JMSException ex)
- {
- throw ex;
- }
- catch (RuntimeException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new JMSException(ex.getMessage());
- }
- }
- }
-
- public void close()
- {
- deactivate();
- }
-
- public void run()
- {
- throw new UnsupportedOperationException();
- }
-
- public long registerConsumer(DestinationImpl destination, String messageSelector, boolean noLocal, boolean durable)
- throws JMSException
- {
- try
- {
- return new JMSRegisterConsumerRequest(connection.getChannel(), id, destination, messageSelector, noLocal, durable)
- .send();
- }
- catch (Exception ex)
- {
- throw new JMSException(ex.getMessage());
- }
- }
-
- public void sendMessage(Message message) throws JMSException
- {
- if (getTransacted())
- {
- synchronized (messages)
- {
- if (message instanceof MessageImpl)
- {
- messages.add(MessageUtil.copy(message));
- }
- else
- {
- messages.add(MessageUtil.convert(message));
- }
- }
- }
- else
- {
- try
- {
- MessageImpl impl = MessageUtil.convert(message);
- JMSClientMessageRequest request = new JMSClientMessageRequest(connection.getChannel(), impl);
- String messageID = request.send(connection.getSendTimeout());
- if (messageID == null)
- {
- throw new JMSException("Message not accepted by JMS server");
- }
-
- message.setJMSMessageID(messageID);
- }
- catch (JMSException ex)
- {
- throw ex;
- }
- catch (RuntimeException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new JMSException(ex.getMessage());
- }
- }
- }
-
- public boolean acknowledgeMessages(MessageConsumerImpl consumer)
- {
- try
- {
- new JMSAcknowledgeRequest(connection.getChannel(), id).send();
- return true;
- }
- catch (Exception ex)
- {
- OM.LOG.error(ex);
- return true;
- }
- }
-
- public void handleServerMessage(long consumerID, MessageImpl message)
- {
- message.setReceivingSession(this);
- MessageConsumerImpl consumer = consumers.get(consumerID);
- if (consumer == null)
- {
- OM.LOG.warn("Consumer " + consumerID + " not found. Discarding message.");
- return;
- }
-
- consumer.handleServerMessage(message);
- }
-
- @Override
- protected String getThreadName()
- {
- return "jms-session";
- }
-
- @Override
- protected void work(WorkContext context, MessageConsumerImpl consumer)
- {
- consumer.dispatchMessage();
- }
-
- private void ensureTransacted() throws IllegalStateException
- {
- if (!transacted)
- {
- throw new IllegalStateException("Session " + id + " not transacted");
- }
- }
-
- private void ensureNotTransacted() throws IllegalStateException
- {
- if (transacted)
- {
- throw new IllegalStateException("Session " + id + " transacted");
- }
- }
-
- private void start()
- {
- }
-
- private void stop()
- {
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/StreamMessageImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/StreamMessageImpl.java
deleted file mode 100644
index 66f4003c20..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/StreamMessageImpl.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageEOFException;
-import javax.jms.StreamMessage;
-
-import java.io.IOException;
-
-public class StreamMessageImpl extends MessageImpl implements StreamMessage
-{
- public boolean readBoolean()
- {
- throw new NotYetImplementedException();
- }
-
- public byte readByte()
- {
- throw new NotYetImplementedException();
- }
-
- public int readBytes(byte[] value)
- {
- throw new NotYetImplementedException();
- }
-
- public char readChar()
- {
- throw new NotYetImplementedException();
- }
-
- public double readDouble()
- {
- throw new NotYetImplementedException();
- }
-
- public float readFloat()
- {
- throw new NotYetImplementedException();
- }
-
- public int readInt()
- {
- throw new NotYetImplementedException();
- }
-
- public long readLong()
- {
- throw new NotYetImplementedException();
- }
-
- public Object readObject()
- {
- throw new NotYetImplementedException();
- }
-
- public short readShort()
- {
- throw new NotYetImplementedException();
- }
-
- public String readString()
- {
- throw new NotYetImplementedException();
- }
-
- public void reset()
- {
- throw new NotYetImplementedException();
- }
-
- public void writeBoolean(boolean value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeByte(byte value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeBytes(byte[] value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeBytes(byte[] value, int offset, int length)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeChar(char value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeDouble(double value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeFloat(float value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeInt(int value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeLong(long value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeObject(Object value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeShort(short value)
- {
- throw new NotYetImplementedException();
- }
-
- public void writeString(String value)
- {
- throw new NotYetImplementedException();
- }
-
- @Override
- public void populate(Message source) throws JMSException
- {
- super.populate(source);
- StreamMessage from = (StreamMessage)source;
- from.reset();
- try
- {
- while (true)
- {
- Object object = from.readObject();
- writeObject(object);
- }
- }
- catch (MessageEOFException ignore)
- {
- }
- }
-
- @Override
- public void write(ExtendedDataOutputStream out) throws IOException
- {
- super.write(out);
- }
-
- @Override
- public void read(ExtendedDataInputStream in) throws IOException
- {
- super.read(in);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TemporaryQueueImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TemporaryQueueImpl.java
deleted file mode 100644
index d1a71e1e9d..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TemporaryQueueImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.TemporaryQueue;
-
-public class TemporaryQueueImpl extends QueueImpl implements TemporaryQueue
-{
- private static final long serialVersionUID = 1L;
-
- private static int counter = 0;
-
- public TemporaryQueueImpl()
- {
- super("TempQueue" + (++counter));
- }
-
- public void delete()
- {
- throw new NotYetImplementedException();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TemporaryTopicImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TemporaryTopicImpl.java
deleted file mode 100644
index 2b1c09ea17..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TemporaryTopicImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.TemporaryTopic;
-
-public class TemporaryTopicImpl extends TopicImpl implements TemporaryTopic
-{
- private static final long serialVersionUID = 1L;
-
- private static int counter = 0;
-
- public TemporaryTopicImpl()
- {
- super("TempTopic" + (++counter));
- }
-
- public void delete()
- {
- throw new NotYetImplementedException();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TextMessageImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TextMessageImpl.java
deleted file mode 100644
index 038deb0c38..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TextMessageImpl.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.TextMessage;
-
-import java.io.IOException;
-
-public class TextMessageImpl extends MessageImpl implements TextMessage
-{
- private String text;
-
- public TextMessageImpl()
- {
- }
-
- public TextMessageImpl(String text)
- {
- this.text = text;
- }
-
- public String getText()
- {
- return text;
- }
-
- public void setText(String text)
- {
- this.text = text;
- }
-
- @Override
- public void populate(Message source) throws JMSException
- {
- super.populate(source);
- TextMessage text = (TextMessage)source;
- setText(text.getText());
- }
-
- @Override
- public void write(ExtendedDataOutputStream out) throws IOException
- {
- super.write(out);
- out.writeString(text);
- }
-
- @Override
- public void read(ExtendedDataInputStream in) throws IOException
- {
- super.read(in);
- text = in.readString();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicImpl.java
deleted file mode 100644
index add4eb4302..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.Topic;
-
-public class TopicImpl extends DestinationImpl implements Topic
-{
- private static final long serialVersionUID = 1L;
-
- private String topicName;
-
- public TopicImpl(String topicName)
- {
- this.topicName = topicName;
- }
-
- public String getTopicName()
- {
- return topicName;
- }
-
- public String getName()
- {
- return topicName;
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicPublisherImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicPublisherImpl.java
deleted file mode 100644
index ccd61660c2..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicPublisherImpl.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-
-public class TopicPublisherImpl extends MessageProducerImpl implements TopicPublisher
-{
- public TopicPublisherImpl(SessionImpl session, TopicImpl topic)
- {
- super(session, topic);
- }
-
- public TopicImpl getTopic()
- {
- return (TopicImpl)getDestination();
- }
-
- public void publish(Message message) throws JMSException
- {
- publish(getTopic(), message, getDeliveryMode(), getPriority(), getTimeToLive());
- }
-
- public void publish(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
- {
- publish(getTopic(), message, deliveryMode, priority, timeToLive);
- }
-
- public void publish(Topic topic, Message message) throws JMSException
- {
- publish(topic, message, getDeliveryMode(), getPriority(), getTimeToLive());
- }
-
- public void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive)
- throws JMSException
- {
- send(topic, message, deliveryMode, priority, timeToLive);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicSubscriberImpl.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicSubscriberImpl.java
deleted file mode 100644
index eefb91e59f..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/TopicSubscriberImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms;
-
-import javax.jms.TopicSubscriber;
-
-public class TopicSubscriberImpl extends MessageConsumerImpl implements TopicSubscriber
-{
- private String name;
-
- private boolean noLocal;
-
- public TopicSubscriberImpl(SessionImpl session, long id, TopicImpl topic, String name, String messageSelector,
- boolean noLocal)
- {
- super(session, id, topic, messageSelector);
- this.name = name;
- this.noLocal = noLocal;
- }
-
- public boolean getNoLocal()
- {
- return noLocal;
- }
-
- public TopicImpl getTopic()
- {
- return (TopicImpl)getDestination();
- }
-
- public String getName()
- {
- return name;
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/bundle/OM.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/bundle/OM.java
deleted file mode 100644
index d16a2184a2..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/bundle/OM.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.bundle;
-
-import org.eclipse.net4j.jms.JMSUtil;
-import org.eclipse.net4j.util.container.IPluginContainer;
-import org.eclipse.net4j.util.om.OMBundle;
-import org.eclipse.net4j.util.om.OMPlatform;
-import org.eclipse.net4j.util.om.OSGiActivator;
-import org.eclipse.net4j.util.om.log.OMLogger;
-import org.eclipse.net4j.util.om.trace.OMTracer;
-
-/**
- * The <em>Operations & Maintenance</em> class of this bundle.
- *
- * @author Eike Stepper
- */
-public abstract class OM
-{
- public static final String BUNDLE_ID = "org.eclipse.net4j.jms"; //$NON-NLS-1$
-
- public static final OMBundle BUNDLE = OMPlatform.INSTANCE.bundle(BUNDLE_ID, OM.class);
-
- public static final OMTracer DEBUG = BUNDLE.tracer("debug"); //$NON-NLS-1$
-
- public static final OMTracer DEBUG_PROTOCOL = DEBUG.tracer("protocol"); //$NON-NLS-1$
-
- public static final OMLogger LOG = BUNDLE.logger();
-
- static void start() throws Exception
- {
- JMSUtil.setTransportContainer(IPluginContainer.INSTANCE);
- }
-
- /**
- * @author Eike Stepper
- */
- public static final class Activator extends OSGiActivator
- {
- public Activator()
- {
- super(BUNDLE);
- }
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSAcknowledgeRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSAcknowledgeRequest.java
deleted file mode 100644
index 90c24240ea..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSAcknowledgeRequest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.Request;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSAcknowledgeRequest extends Request
-{
- private int sessionID;
-
- public JMSAcknowledgeRequest(IChannel channel, int sessionID)
- {
- super(channel);
- this.sessionID = sessionID;
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_ACKNOWLEDGE;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- out.writeInt(sessionID);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientMessageRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientMessageRequest.java
deleted file mode 100644
index 3220abfc1e..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientMessageRequest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.internal.jms.MessageImpl;
-import org.eclipse.net4j.internal.jms.util.MessageUtil;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.RequestWithConfirmation;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSClientMessageRequest extends RequestWithConfirmation<String>
-{
- private MessageImpl message;
-
- public JMSClientMessageRequest(IChannel channel, MessageImpl message)
- {
- super(channel);
- this.message = message;
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_CLIENT_MESSAGE;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- MessageUtil.write(out, message);
- }
-
- @Override
- protected String confirming(ExtendedDataInputStream in) throws IOException
- {
- return in.readString();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocol.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocol.java
deleted file mode 100644
index 9b8510f408..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocol.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.SignalProtocol;
-import org.eclipse.net4j.signal.SignalReactor;
-
-/**
- * @author Eike Stepper
- */
-public class JMSClientProtocol extends SignalProtocol
-{
- public JMSClientProtocol()
- {
- }
-
- public String getType()
- {
- return JMSProtocolConstants.PROTOCOL_NAME;
- }
-
- @Override
- protected SignalReactor doCreateSignalReactor(short signalID)
- {
- switch (signalID)
- {
- case JMSProtocolConstants.SIGNAL_SERVER_MESSAGE:
- return new JMSServerMessageIndication();
- }
-
- return null;
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocolFactory.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocolFactory.java
deleted file mode 100644
index abbbc33ef1..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSClientProtocolFactory.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.util.container.IManagedContainer;
-
-import org.eclipse.internal.net4j.protocol.ClientProtocolFactory;
-
-/**
- * @author Eike Stepper
- */
-public final class JMSClientProtocolFactory extends ClientProtocolFactory
-{
- public static final String TYPE = JMSProtocolConstants.PROTOCOL_NAME;
-
- public JMSClientProtocolFactory()
- {
- super(TYPE);
- }
-
- public JMSClientProtocol create(String description)
- {
- return new JMSClientProtocol();
- }
-
- public static JMSClientProtocol get(IManagedContainer container, String description)
- {
- return (JMSClientProtocol)container.getElement(PRODUCT_GROUP, TYPE, description);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCloseSessionRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCloseSessionRequest.java
deleted file mode 100644
index 6545bd4425..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCloseSessionRequest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.RequestWithConfirmation;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSCloseSessionRequest extends RequestWithConfirmation<Boolean>
-{
- private int sessionID;
-
- public JMSCloseSessionRequest(IChannel channel, int sessionID)
- {
- super(channel);
- this.sessionID = sessionID;
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_CLOSE_SESSION;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- out.writeInt(sessionID);
- }
-
- @Override
- protected Boolean confirming(ExtendedDataInputStream in) throws IOException
- {
- return in.readBoolean();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCommitRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCommitRequest.java
deleted file mode 100644
index aca1200758..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSCommitRequest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.internal.jms.MessageImpl;
-import org.eclipse.net4j.internal.jms.util.MessageUtil;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.RequestWithConfirmation;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-import java.util.List;
-
-/**
- * @author Eike Stepper
- */
-public class JMSCommitRequest extends RequestWithConfirmation<String[]>
-{
- private int sessionID;
-
- private List<MessageImpl> messages;
-
- public JMSCommitRequest(IChannel channel, int sessionID, List<MessageImpl> messages)
- {
- super(channel);
- this.sessionID = sessionID;
- this.messages = messages;
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_COMMIT;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- out.writeInt(sessionID);
- out.writeInt(messages.size());
- for (MessageImpl message : messages)
- {
- MessageUtil.write(out, message);
- }
- }
-
- @Override
- protected String[] confirming(ExtendedDataInputStream in) throws IOException
- {
- int size = in.readInt();
- if (size == -1)
- {
- return null;
- }
-
- String[] messageIDs = new String[size];
- for (int i = 0; i < size; i++)
- {
- messageIDs[i] = in.readString();
- }
-
- return messageIDs;
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSDeregisterConsumerRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSDeregisterConsumerRequest.java
deleted file mode 100644
index d81a0aaa68..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSDeregisterConsumerRequest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.RequestWithConfirmation;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSDeregisterConsumerRequest extends RequestWithConfirmation<Boolean>
-{
- private int sessionID;
-
- private long consumerID;
-
- public JMSDeregisterConsumerRequest(IChannel channel, int sessionID, long consumerID)
- {
- super(channel);
- this.sessionID = sessionID;
- this.consumerID = consumerID;
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_DEREGISTER_CONSUMER;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- out.writeInt(sessionID);
- out.writeLong(consumerID);
- }
-
- @Override
- protected Boolean confirming(ExtendedDataInputStream in) throws IOException
- {
- return in.readBoolean();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogoffRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogoffRequest.java
deleted file mode 100644
index 80b63e31cd..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogoffRequest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.Request;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSLogoffRequest extends Request
-{
- public JMSLogoffRequest(IChannel channel)
- {
- super(channel);
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_LOGOFF;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogonRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogonRequest.java
deleted file mode 100644
index e5649fb72f..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSLogonRequest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.RequestWithConfirmation;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSLogonRequest extends RequestWithConfirmation<Boolean>
-{
- private String userName;
-
- private String password;
-
- public JMSLogonRequest(IChannel channel, String userName, String password)
- {
- super(channel);
- this.userName = userName;
- this.password = password;
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_LOGON;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- out.writeString(userName);
- out.writeString(password);
- }
-
- @Override
- protected Boolean confirming(ExtendedDataInputStream in) throws IOException
- {
- return in.readBoolean();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSOpenSessionRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSOpenSessionRequest.java
deleted file mode 100644
index ec829f5b74..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSOpenSessionRequest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.RequestWithConfirmation;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSOpenSessionRequest extends RequestWithConfirmation<Boolean>
-{
- private int sessionID;
-
- public JMSOpenSessionRequest(IChannel channel, int sessionID)
- {
- super(channel);
- this.sessionID = sessionID;
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_OPEN_SESSION;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- out.writeInt(sessionID);
- }
-
- @Override
- protected Boolean confirming(ExtendedDataInputStream in) throws IOException
- {
- return in.readBoolean();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRecoverRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRecoverRequest.java
deleted file mode 100644
index 2842eb32d2..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRecoverRequest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.RequestWithConfirmation;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSRecoverRequest extends RequestWithConfirmation<Object>
-{
- private int sessionID;
-
- public JMSRecoverRequest(IChannel channel, int sessionID)
- {
- super(channel);
- this.sessionID = sessionID;
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_RECOVER;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- out.writeInt(sessionID);
- }
-
- @Override
- protected Object confirming(ExtendedDataInputStream in) throws IOException
- {
- return null;
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRegisterConsumerRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRegisterConsumerRequest.java
deleted file mode 100644
index 0ee1a451af..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRegisterConsumerRequest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.internal.jms.DestinationImpl;
-import org.eclipse.net4j.internal.jms.util.DestinationUtil;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.RequestWithConfirmation;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSRegisterConsumerRequest extends RequestWithConfirmation<Long>
-{
- private int sessionID;
-
- private DestinationImpl destination;
-
- private String messageSelector;
-
- private boolean noLocal;
-
- private boolean durable;
-
- public JMSRegisterConsumerRequest(IChannel channel, int sessionID, DestinationImpl destination,
- String messageSelector, boolean noLocal, boolean durable)
- {
- super(channel);
- this.sessionID = sessionID;
- this.destination = destination;
- this.messageSelector = messageSelector;
- this.noLocal = noLocal;
- this.durable = durable;
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_REGISTER_CONSUMER;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- out.writeInt(sessionID);
- DestinationUtil.write(out, destination);
- out.writeString(messageSelector);
- out.writeBoolean(noLocal);
- out.writeBoolean(durable);
- }
-
- @Override
- protected Long confirming(ExtendedDataInputStream in) throws IOException
- {
- return in.readLong();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRollbackRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRollbackRequest.java
deleted file mode 100644
index c4db85ca0d..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSRollbackRequest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.RequestWithConfirmation;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSRollbackRequest extends RequestWithConfirmation<Boolean>
-{
- private int sessionID;
-
- public JMSRollbackRequest(IChannel channel, int sessionID)
- {
- super(channel);
- this.sessionID = sessionID;
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_ROLLBACK;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- out.writeInt(sessionID);
- }
-
- @Override
- protected Boolean confirming(ExtendedDataInputStream in) throws IOException
- {
- return in.readBoolean();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSServerMessageIndication.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSServerMessageIndication.java
deleted file mode 100644
index fed8f93f9e..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSServerMessageIndication.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.internal.jms.ConnectionImpl;
-import org.eclipse.net4j.internal.jms.MessageImpl;
-import org.eclipse.net4j.internal.jms.util.MessageUtil;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.Indication;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSServerMessageIndication extends Indication
-{
- public JMSServerMessageIndication()
- {
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_SERVER_MESSAGE;
- }
-
- @Override
- protected void indicating(ExtendedDataInputStream in) throws IOException
- {
- int sessionID = in.readInt();
- long consumerID = in.readLong();
- MessageImpl message = MessageUtil.read(in);
- JMSClientProtocol protocol = (JMSClientProtocol)getProtocol();
- ConnectionImpl connection = (ConnectionImpl)protocol.getInfraStructure();
- connection.handleMessageFromSignal(sessionID, consumerID, message);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSSyncRequest.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSSyncRequest.java
deleted file mode 100644
index e6601a5255..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/protocol/JMSSyncRequest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.protocol;
-
-import org.eclipse.net4j.channel.IChannel;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.signal.RequestWithConfirmation;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import java.io.IOException;
-
-/**
- * @author Eike Stepper
- */
-public class JMSSyncRequest extends RequestWithConfirmation<Long>
-{
- private long clientTime0;
-
- public JMSSyncRequest(IChannel channel)
- {
- super(channel);
- }
-
- @Override
- protected short getSignalID()
- {
- return JMSProtocolConstants.SIGNAL_SYNC;
- }
-
- @Override
- protected void requesting(ExtendedDataOutputStream out) throws IOException
- {
- clientTime0 = System.currentTimeMillis();
- }
-
- @Override
- protected Long confirming(ExtendedDataInputStream in) throws IOException
- {
- long serverTime = in.readLong();
- long clientTime1 = System.currentTimeMillis();
- long roundTripDuration = clientTime1 - clientTime0;
- return serverTime + roundTripDuration / 2;
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/DestinationUtil.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/DestinationUtil.java
deleted file mode 100644
index 5b26efdb34..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/DestinationUtil.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.util;
-
-import org.eclipse.net4j.internal.jms.DestinationImpl;
-import org.eclipse.net4j.internal.jms.QueueImpl;
-import org.eclipse.net4j.internal.jms.TopicImpl;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.jms.Topic;
-
-import java.io.IOException;
-
-public final class DestinationUtil
-{
- private DestinationUtil()
- {
- }
-
- public static byte getType(Destination destination)
- {
- if (destination instanceof Queue)
- {
- return JMSProtocolConstants.DESTINATION_TYPE_QUEUE;
- }
-
- if (destination instanceof Topic)
- {
- return JMSProtocolConstants.DESTINATION_TYPE_TOPIC;
- }
-
- if (destination == null)
- {
- return JMSProtocolConstants.DESTINATION_TYPE_NULL;
- }
-
- throw new IllegalArgumentException("destination: " + destination);
- }
-
- public static String getTypeName(byte type)
- {
- switch (type)
- {
- case JMSProtocolConstants.DESTINATION_TYPE_NULL:
- return "NULL_DESTINATION";
-
- case JMSProtocolConstants.DESTINATION_TYPE_QUEUE:
- return "QUEUE_DESTINATION";
-
- case JMSProtocolConstants.DESTINATION_TYPE_TOPIC:
- return "TOPIC_DESTINATION";
- }
-
- throw new IllegalArgumentException("type: " + type);
- }
-
- public static String getName(Destination destination) throws JMSException
- {
- byte type = getType(destination);
- switch (type)
- {
- case JMSProtocolConstants.DESTINATION_TYPE_QUEUE:
- return ((Queue)destination).getQueueName();
-
- case JMSProtocolConstants.DESTINATION_TYPE_TOPIC:
- return ((Topic)destination).getTopicName();
- }
-
- return null;
- }
-
- public static DestinationImpl create(byte type, String name)
- {
- switch (type)
- {
- case JMSProtocolConstants.DESTINATION_TYPE_QUEUE:
- return new QueueImpl(name);
-
- case JMSProtocolConstants.DESTINATION_TYPE_TOPIC:
- return new TopicImpl(name);
- }
-
- return null;
- }
-
- public static DestinationImpl copy(Destination source) throws JMSException
- {
- byte type = getType(source);
- switch (type)
- {
- case JMSProtocolConstants.DESTINATION_TYPE_QUEUE:
- return new QueueImpl(((Queue)source).getQueueName());
-
- case JMSProtocolConstants.DESTINATION_TYPE_TOPIC:
- return new TopicImpl(((Topic)source).getTopicName());
- }
-
- return null;
- }
-
- public static DestinationImpl convert(Destination source) throws JMSException
- {
- if (source instanceof DestinationImpl)
- {
- return (DestinationImpl)source;
- }
-
- return copy(source);
- }
-
- public static void write(ExtendedDataOutputStream out, DestinationImpl destination) throws IOException
- {
- byte type = getType(destination);
- out.writeByte(type);
- if (type != JMSProtocolConstants.DESTINATION_TYPE_NULL)
- {
- out.writeString(destination.getName());
- }
- }
-
- public static DestinationImpl read(ExtendedDataInputStream in) throws IOException
- {
- byte type = in.readByte();
- String name = null;
- if (type != JMSProtocolConstants.DESTINATION_TYPE_NULL)
- {
- name = in.readString();
- }
-
- return create(type, name);
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/MessageUtil.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/MessageUtil.java
deleted file mode 100644
index 1121d499da..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/MessageUtil.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.util;
-
-import org.eclipse.net4j.internal.jms.BytesMessageImpl;
-import org.eclipse.net4j.internal.jms.MapMessageImpl;
-import org.eclipse.net4j.internal.jms.MessageImpl;
-import org.eclipse.net4j.internal.jms.ObjectMessageImpl;
-import org.eclipse.net4j.internal.jms.StreamMessageImpl;
-import org.eclipse.net4j.internal.jms.TextMessageImpl;
-import org.eclipse.net4j.internal.jms.bundle.OM;
-import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-
-import java.io.IOException;
-
-public final class MessageUtil
-{
- private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, MessageUtil.class);
-
- private MessageUtil()
- {
- }
-
- public static byte getType(Message message)
- {
- if (message instanceof BytesMessage)
- {
- return JMSProtocolConstants.MESSAGE_TYPE_BYTES;
- }
-
- if (message instanceof MapMessage)
- {
- return JMSProtocolConstants.MESSAGE_TYPE_MAP;
- }
-
- if (message instanceof ObjectMessage)
- {
- return JMSProtocolConstants.MESSAGE_TYPE_OBJECT;
- }
-
- if (message instanceof StreamMessage)
- {
- return JMSProtocolConstants.MESSAGE_TYPE_STREAM;
- }
-
- if (message instanceof TextMessage)
- {
- return JMSProtocolConstants.MESSAGE_TYPE_TEXT;
- }
-
- throw new IllegalArgumentException("message: " + message);
- }
-
- public static String getTypeName(byte type)
- {
- switch (type)
- {
- case JMSProtocolConstants.MESSAGE_TYPE_BYTES:
- return "BYTES_MESSAGE";
-
- case JMSProtocolConstants.MESSAGE_TYPE_MAP:
- return "MAP_MESSAGE";
-
- case JMSProtocolConstants.MESSAGE_TYPE_OBJECT:
- return "OBJECT_MESSAGE";
-
- case JMSProtocolConstants.MESSAGE_TYPE_STREAM:
- return "STREAM_MESSAGE";
-
- case JMSProtocolConstants.MESSAGE_TYPE_TEXT:
- return "TEXT_MESSAGE";
- }
-
- throw new IllegalArgumentException("type: " + type);
- }
-
- public static MessageImpl create(byte type)
- {
- switch (type)
- {
- case JMSProtocolConstants.MESSAGE_TYPE_BYTES:
- return new BytesMessageImpl();
-
- case JMSProtocolConstants.MESSAGE_TYPE_MAP:
- return new MapMessageImpl();
-
- case JMSProtocolConstants.MESSAGE_TYPE_OBJECT:
- return new ObjectMessageImpl();
-
- case JMSProtocolConstants.MESSAGE_TYPE_STREAM:
- return new StreamMessageImpl();
-
- case JMSProtocolConstants.MESSAGE_TYPE_TEXT:
- return new TextMessageImpl();
- }
-
- throw new IllegalArgumentException("type: " + type);
- }
-
- public static MessageImpl copy(Message source) throws JMSException
- {
- byte type = getType(source);
- MessageImpl result = create(type);
- result.populate(source);
- return result;
- }
-
- public static MessageImpl convert(Message source) throws JMSException
- {
- if (source instanceof MessageImpl)
- {
- return (MessageImpl)source;
- }
-
- return copy(source);
- }
-
- public static void write(ExtendedDataOutputStream out, MessageImpl message) throws IOException
- {
- byte type = getType(message);
- if (PROTOCOL.isEnabled())
- {
- PROTOCOL.format("Writing {0}", getTypeName(type));
- }
-
- out.writeByte(type);
- message.write(out);
- }
-
- public static MessageImpl read(ExtendedDataInputStream in) throws IOException
- {
- byte type = in.readByte();
- if (PROTOCOL.isEnabled())
- {
- PROTOCOL.format("Reading {0}", getTypeName(type));
- }
-
- MessageImpl message = create(type);
- message.read(in);
- return message;
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/TypeUtil.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/TypeUtil.java
deleted file mode 100644
index 75e48dc333..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/internal/jms/util/TypeUtil.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.jms.util;
-
-import org.eclipse.net4j.jms.JMSProtocolConstants;
-import org.eclipse.net4j.util.io.ExtendedDataInputStream;
-import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
-
-import javax.jms.MessageFormatException;
-
-import java.io.IOException;
-
-public final class TypeUtil
-{
- private TypeUtil()
- {
- }
-
- public static boolean getBoolean(Object value) throws MessageFormatException
- {
- if (value instanceof Boolean)
- {
- return (Boolean)value;
- }
- else if (value instanceof String)
- {
- return Boolean.valueOf((String)value);
- }
- else if (value == null)
- {
- throw new IllegalArgumentException("value == null");
- }
-
- throw new MessageFormatException(conversionProblem(boolean.class, value));
- }
-
- public static byte getByte(Object value) throws MessageFormatException
- {
- if (value instanceof Byte)
- {
- return (Byte)value;
- }
- else if (value instanceof String)
- {
- return Byte.parseByte((String)value);
- }
- else if (value == null)
- {
- throw new IllegalArgumentException("value == null");
- }
-
- throw new MessageFormatException(conversionProblem(byte.class, value));
- }
-
- public static short getShort(Object value) throws MessageFormatException
- {
- if (value instanceof Short)
- {
- return (Short)value;
- }
- else if (value instanceof Byte)
- {
- return (Byte)value;
- }
- else if (value instanceof String)
- {
- return Short.parseShort((String)value);
- }
- else if (value == null)
- {
- throw new IllegalArgumentException("value == null");
- }
-
- throw new MessageFormatException(conversionProblem(short.class, value));
- }
-
- public static char getChar(Object value) throws MessageFormatException
- {
- if (value instanceof Character)
- {
- return (Character)value;
- }
- else if (value == null)
- {
- throw new IllegalArgumentException("value == null");
- }
-
- throw new MessageFormatException(conversionProblem(char.class, value));
- }
-
- public static int getInt(Object value) throws MessageFormatException
- {
- if (value instanceof Integer)
- {
- return (Integer)value;
- }
- else if (value instanceof Short)
- {
- return (Short)value;
- }
- else if (value instanceof Byte)
- {
- return (Byte)value;
- }
- else if (value instanceof String)
- {
- return Integer.parseInt((String)value);
- }
- else if (value == null)
- {
- throw new IllegalArgumentException("value == null");
- }
-
- throw new MessageFormatException(conversionProblem(int.class, value));
- }
-
- public static long getLong(Object value) throws MessageFormatException
- {
- if (value instanceof Long)
- {
- return (Long)value;
- }
- else if (value instanceof Integer)
- {
- return (Integer)value;
- }
- else if (value instanceof Short)
- {
- return (Short)value;
- }
- else if (value instanceof Byte)
- {
- return (Byte)value;
- }
- else if (value instanceof String)
- {
- return Long.parseLong((String)value);
- }
- else if (value == null)
- {
- throw new IllegalArgumentException("value == null");
- }
-
- throw new MessageFormatException(conversionProblem(long.class, value));
- }
-
- public static float getFloat(Object value) throws MessageFormatException
- {
- if (value instanceof Float)
- {
- return (Float)value;
- }
- else if (value instanceof String)
- {
- return Float.parseFloat((String)value);
- }
- else if (value == null)
- {
- throw new IllegalArgumentException("value == null");
- }
-
- throw new MessageFormatException(conversionProblem(float.class, value));
- }
-
- public static double getDouble(Object value) throws MessageFormatException
- {
- if (value instanceof Double)
- {
- return (Double)value;
- }
- else if (value instanceof Float)
- {
- return (Float)value;
- }
- else if (value instanceof String)
- {
- return Double.parseDouble((String)value);
- }
- else if (value == null)
- {
- throw new IllegalArgumentException("value == null");
- }
-
- throw new MessageFormatException(conversionProblem(double.class, value));
- }
-
- public static String getString(Object value) throws MessageFormatException
- {
- if (value instanceof byte[])
- {
- throw new MessageFormatException(conversionProblem(String.class, value));
- }
- else if (value == null)
- {
- throw new IllegalArgumentException("value == null");
- }
-
- return String.valueOf(value);
- }
-
- public static byte[] getBytes(Object value) throws MessageFormatException
- {
- if (value instanceof byte[])
- {
- byte[] bytes = (byte[])value;
- byte[] result = new byte[bytes.length];
- System.arraycopy(bytes, 0, result, 0, bytes.length);
- }
- else if (value == null)
- {
- throw new IllegalArgumentException("value == null");
- }
-
- throw new MessageFormatException(conversionProblem(byte[].class, value));
- }
-
- public static void write(ExtendedDataOutputStream out, Object value) throws IOException
- {
- if (value instanceof Boolean)
- {
- out.writeByte(JMSProtocolConstants.TYPE_BOOLEAN);
- out.writeBoolean((Boolean)value);
- }
- else if (value instanceof Byte)
- {
- out.writeByte(JMSProtocolConstants.TYPE_BYTE);
- out.writeByte((Byte)value);
- }
- else if (value instanceof Character)
- {
- out.writeByte(JMSProtocolConstants.TYPE_CHAR);
- out.writeChar((Character)value);
- }
- else if (value instanceof Double)
- {
- out.writeByte(JMSProtocolConstants.TYPE_DOUBLE);
- out.writeDouble((Double)value);
- }
- else if (value instanceof Float)
- {
- out.writeByte(JMSProtocolConstants.TYPE_FLOAT);
- out.writeFloat((Float)value);
- }
- else if (value instanceof Long)
- {
- out.writeByte(JMSProtocolConstants.TYPE_LONG);
- out.writeLong((Long)value);
- }
- else if (value instanceof Short)
- {
- out.writeByte(JMSProtocolConstants.TYPE_SHORT);
- out.writeShort((Short)value);
- }
- else if (value instanceof String)
- {
- out.writeByte(JMSProtocolConstants.TYPE_STRING);
- out.writeString((String)value);
- }
-
- throw new IllegalArgumentException("value: " + value);
- }
-
- public static Object read(ExtendedDataInputStream in) throws IOException
- {
- byte type = in.readByte();
- switch (type)
- {
- case JMSProtocolConstants.TYPE_BOOLEAN:
- return in.readBoolean();
- case JMSProtocolConstants.TYPE_BYTE:
- return in.readByte();
- case JMSProtocolConstants.TYPE_CHAR:
- return in.readChar();
- case JMSProtocolConstants.TYPE_DOUBLE:
- return in.readDouble();
- case JMSProtocolConstants.TYPE_FLOAT:
- return in.readFloat();
- case JMSProtocolConstants.TYPE_LONG:
- return in.readLong();
- case JMSProtocolConstants.TYPE_SHORT:
- return in.readShort();
- case JMSProtocolConstants.TYPE_STRING:
- return in.readString();
- }
-
- throw new IOException("Invalid type: " + type);
- }
-
- private static String conversionProblem(Class<?> type, Object value)
- {
- return "Cannot convert values of type " + value.getClass().getName() + " to " + type.getName();
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSAdminProtocolConstants.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSAdminProtocolConstants.java
deleted file mode 100644
index 8a2426dcd9..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSAdminProtocolConstants.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.jms;
-
-/**
- * @author Eike Stepper
- */
-public interface JMSAdminProtocolConstants
-{
- public static final String PROTOCOL_NAME = "jmsadmin";
-
- public static final short SIGNAL_CREATE_DESTINATION = 1;
-
- public static final byte DESTINATION_TYPE_QUEUE = JMSProtocolConstants.DESTINATION_TYPE_QUEUE;
-
- public static final byte DESTINATION_TYPE_TOPIC = JMSProtocolConstants.DESTINATION_TYPE_TOPIC;
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSInitialContext.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSInitialContext.java
deleted file mode 100644
index aa94ab3d3b..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSInitialContext.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.jms;
-
-import org.eclipse.net4j.internal.jms.ConnectionFactoryImpl;
-import org.eclipse.net4j.util.container.IManagedContainer;
-
-import javax.naming.InitialContext;
-import javax.naming.Name;
-import javax.naming.NamingException;
-
-import java.util.Hashtable;
-
-/**
- * @author Eike Stepper
- */
-public class JMSInitialContext extends InitialContext
-{
- private IManagedContainer transportContainer;
-
- public JMSInitialContext(IManagedContainer transportContainer) throws NamingException
- {
- this.transportContainer = transportContainer;
- }
-
- public JMSInitialContext(boolean lazy, IManagedContainer transportContainer) throws NamingException
- {
- super(lazy);
- this.transportContainer = transportContainer;
- }
-
- public JMSInitialContext(Hashtable<?, ?> environment, IManagedContainer transportContainer) throws NamingException
- {
- super(environment);
- this.transportContainer = transportContainer;
- }
-
- public IManagedContainer getTransportContainer()
- {
- return transportContainer;
- }
-
- @Override
- public Object lookup(Name name) throws NamingException
- {
- return postProcess(super.lookup(name));
- }
-
- @Override
- public Object lookup(String name) throws NamingException
- {
- return postProcess(super.lookup(name));
- }
-
- @Override
- public Object lookupLink(Name name) throws NamingException
- {
- return postProcess(super.lookupLink(name));
- }
-
- @Override
- public Object lookupLink(String name) throws NamingException
- {
- return postProcess(super.lookupLink(name));
- }
-
- protected Object postProcess(Object object)
- {
- if (object instanceof ConnectionFactoryImpl)
- {
- ConnectionFactoryImpl factory = (ConnectionFactoryImpl)object;
- factory.setTransportContainer(transportContainer);
- }
-
- return object;
- }
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSProtocolConstants.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSProtocolConstants.java
deleted file mode 100644
index fd3ab49dd5..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSProtocolConstants.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.jms;
-
-/**
- * @author Eike Stepper
- */
-public interface JMSProtocolConstants
-{
- public static final String PROTOCOL_NAME = "jms";
-
- // Signals
-
- public static final short SIGNAL_SYNC = 1;
-
- public static final short SIGNAL_LOGON = 2;
-
- public static final short SIGNAL_LOGOFF = 3;
-
- public static final short SIGNAL_OPEN_SESSION = 4;
-
- public static final short SIGNAL_CLOSE_SESSION = 5;
-
- public static final short SIGNAL_REGISTER_CONSUMER = 6;
-
- public static final short SIGNAL_DEREGISTER_CONSUMER = 7;
-
- public static final short SIGNAL_CLIENT_MESSAGE = 8;
-
- public static final short SIGNAL_SERVER_MESSAGE = 9;
-
- public static final short SIGNAL_ACKNOWLEDGE = 10;
-
- public static final short SIGNAL_RECOVER = 11;
-
- public static final short SIGNAL_COMMIT = 12;
-
- public static final short SIGNAL_ROLLBACK = 13;
-
- // Message Types
-
- public static final byte MESSAGE_TYPE_BYTES = 1;
-
- public static final byte MESSAGE_TYPE_MAP = 2;
-
- public static final byte MESSAGE_TYPE_OBJECT = 3;
-
- public static final byte MESSAGE_TYPE_STREAM = 4;
-
- public static final byte MESSAGE_TYPE_TEXT = 5;
-
- // Destination Types
-
- public static final byte DESTINATION_TYPE_NULL = 0;
-
- public static final byte DESTINATION_TYPE_QUEUE = 1;
-
- public static final byte DESTINATION_TYPE_TOPIC = 2;
-
- // Data Types
-
- public static final byte TYPE_BOOLEAN = 1;
-
- public static final byte TYPE_BYTE = 2;
-
- public static final byte TYPE_CHAR = 3;
-
- public static final byte TYPE_DOUBLE = 4;
-
- public static final byte TYPE_FLOAT = 5;
-
- public static final byte TYPE_LONG = 6;
-
- public static final byte TYPE_SHORT = 7;
-
- public static final byte TYPE_STRING = 8;
-}
diff --git a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSUtil.java b/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSUtil.java
deleted file mode 100644
index 1cfa876d56..0000000000
--- a/plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms/JMSUtil.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.jms;
-
-import org.eclipse.net4j.internal.jms.protocol.JMSClientProtocolFactory;
-import org.eclipse.net4j.util.container.IManagedContainer;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-/**
- * @author Eike Stepper
- */
-public final class JMSUtil
-{
- private static IManagedContainer transportContainer;
-
- private JMSUtil()
- {
- }
-
- public static void prepareContainer(IManagedContainer container)
- {
- container.registerFactory(new JMSClientProtocolFactory());
- }
-
- public static Context createInitialContext() throws NamingException
- {
- if (transportContainer == null)
- {
- throw new IllegalStateException("transportContainer == null");
- }
-
- return new JMSInitialContext(transportContainer);
- }
-
- public static IManagedContainer getTransportContainer()
- {
- return transportContainer;
- }
-
- public static void setTransportContainer(IManagedContainer transportContainer)
- {
- JMSUtil.transportContainer = transportContainer;
- }
-}

Back to the top