diff options
Diffstat (limited to 'plugins/org.eclipse.net4j.jms/src/org/eclipse/net4j/jms')
4 files changed, 243 insertions, 243 deletions
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 index ca6f2ea58f..72d23ce783 100644 --- 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 @@ -1,25 +1,25 @@ -/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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"; //$NON-NLS-1$
-
- 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;
-}
+/* + * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. + * 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"; //$NON-NLS-1$ + + 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 index 78565c6982..a58d7e24ac 100644 --- 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 @@ -1,85 +1,85 @@ -/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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;
- }
-}
+/* + * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. + * 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 index 84e9645805..34f794f5f3 100644 --- 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 @@ -1,85 +1,85 @@ -/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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"; //$NON-NLS-1$
-
- // 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;
-}
+/* + * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. + * 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"; //$NON-NLS-1$ + + // 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 index 5e7aa7be0d..0b4305c814 100644 --- 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 @@ -1,48 +1,48 @@ -/*
- * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
- * 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.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 Context createInitialContext() throws NamingException
- {
- if (transportContainer == null)
- {
- throw new IllegalStateException("transportContainer == null"); //$NON-NLS-1$
- }
-
- return new JMSInitialContext(transportContainer);
- }
-
- public static IManagedContainer getTransportContainer()
- {
- return transportContainer;
- }
-
- public static void setTransportContainer(IManagedContainer transportContainer)
- {
- JMSUtil.transportContainer = transportContainer;
- }
-}
+/* + * Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. + * 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.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 Context createInitialContext() throws NamingException + { + if (transportContainer == null) + { + throw new IllegalStateException("transportContainer == null"); //$NON-NLS-1$ + } + + return new JMSInitialContext(transportContainer); + } + + public static IManagedContainer getTransportContainer() + { + return transportContainer; + } + + public static void setTransportContainer(IManagedContainer transportContainer) + { + JMSUtil.transportContainer = transportContainer; + } +} |