diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-15 08:26:42 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-09-15 08:26:42 +0000 |
commit | be0e5e9f7964233dbd4b97e78cb95f3a4bcae393 (patch) | |
tree | e3b0ac89b8016ea591082a6ea4b57c64aab3a8cb | |
parent | af278dacffa6bdfa1194c329c067699e9d2b85e8 (diff) |
Add in default JMS Host support to JMS binding
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@815210 13f79535-47bb-0310-9956-ffa450edef68
8 files changed, 136 insertions, 13 deletions
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSHostExtensionPointImpl.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSHostExtensionPoint.java index 11ea5f414c..ba63cc8759 100644 --- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSHostExtensionPointImpl.java +++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSHostExtensionPoint.java @@ -25,14 +25,14 @@ import org.apache.tuscany.sca.host.jms.JMSHostExtensionPoint; import org.apache.tuscany.sca.host.jms.JMSServiceListenerFactory;
import org.apache.tuscany.sca.work.WorkScheduler;
-public class DefaultJMSHostExtensionPointImpl implements JMSHostExtensionPoint {
+public class DefaultJMSHostExtensionPoint implements JMSHostExtensionPoint {
private JMSServiceListenerFactory jmsServiceListenerFactory;
- public DefaultJMSHostExtensionPointImpl(ExtensionPointRegistry extensionPoints) {
+ public DefaultJMSHostExtensionPoint(ExtensionPointRegistry extensionPoints) {
UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
WorkScheduler workScheduler = utilities.getUtility(WorkScheduler.class);
- this.jmsServiceListenerFactory = new JMSServiceListenerFactoryImpl(workScheduler);
+ this.jmsServiceListenerFactory = new DefaultJMSServiceListenerFactory(workScheduler);
}
public JMSServiceListenerFactory getJMSServiceListenerFactory() {
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/ASFListener.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java index 8f65c2ce19..f9e5774944 100644 --- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/ASFListener.java +++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListener.java @@ -44,8 +44,8 @@ import org.apache.tuscany.sca.work.WorkScheduler; *
* @version $Rev: 721811 $ $Date: 2008-11-30 13:46:51 +0000 (Sun, 30 Nov 2008) $
*/
-public class ASFListener implements JMSServiceListener {
- private static final Logger logger = Logger.getLogger(ASFListener.class.getName());
+public class DefaultJMSServiceListener implements JMSServiceListener {
+ private static final Logger logger = Logger.getLogger(DefaultJMSServiceListener.class.getName());
private MessageListener listener;
private String serviceName;
@@ -59,7 +59,7 @@ public class ASFListener implements JMSServiceListener { private Destination destination;
- public ASFListener(MessageListener listener, String serviceName, boolean isCallbackService, JMSBinding jmsBinding, WorkScheduler workScheduler, JMSResourceFactory rf) {
+ public DefaultJMSServiceListener(MessageListener listener, String serviceName, boolean isCallbackService, JMSBinding jmsBinding, WorkScheduler workScheduler, JMSResourceFactory rf) {
this.listener = listener;
this.serviceName = serviceName;
this.isCallbackService = isCallbackService;
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListenerFactoryImpl.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListenerFactory.java index e37c53cb2d..a228f8de1a 100644 --- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListenerFactoryImpl.java +++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultJMSServiceListenerFactory.java @@ -31,11 +31,11 @@ import org.apache.tuscany.sca.host.jms.JMSServiceListenerFactory; import org.apache.tuscany.sca.runtime.RuntimeComponentService;
import org.apache.tuscany.sca.work.WorkScheduler;
-public class JMSServiceListenerFactoryImpl implements JMSServiceListenerFactory {
+public class DefaultJMSServiceListenerFactory implements JMSServiceListenerFactory {
private WorkScheduler workScheduler;
- public JMSServiceListenerFactoryImpl(WorkScheduler workScheduler) {
+ public DefaultJMSServiceListenerFactory(WorkScheduler workScheduler) {
this.workScheduler = workScheduler;
}
@@ -44,12 +44,12 @@ public class JMSServiceListenerFactoryImpl implements JMSServiceListenerFactory JMSResourceFactory rf = ((JMSBindingServiceBindingProvider)jmsSLD).getResourceFactory();
- MessageListener listener = new ServiceInvoker(jmsSLD.getJmsBinding(), jmsSLD.getService(), jmsSLD.getTargetBinding(), jmsSLD.getMessageFactory(), rf);
+ MessageListener listener = new DefaultServiceInvoker(jmsSLD.getJmsBinding(), jmsSLD.getService(), jmsSLD.getTargetBinding(), jmsSLD.getMessageFactory(), rf);
RuntimeComponentService service = jmsSLD.getService();
// return new ASFListener(listener, service.getName(), service.isCallback(), jmsSLD.getJmsBinding(), workScheduler, rf);
// TODO: 2.x migration, service.isCallback()
- return new ASFListener(listener, service.getName(), false, jmsSLD.getJmsBinding(), workScheduler, rf);
+ return new DefaultJMSServiceListener(listener, service.getName(), false, jmsSLD.getJmsBinding(), workScheduler, rf);
} catch (NamingException e) {
throw new JMSBindingException(e);
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/ServiceInvoker.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultServiceInvoker.java index 315a238dfb..02f4f1bf1b 100644 --- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/ServiceInvoker.java +++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/DefaultServiceInvoker.java @@ -40,9 +40,9 @@ import org.apache.tuscany.sca.runtime.RuntimeComponentService; *
* @version $Rev: 721811 $ $Date: 2008-11-30 13:46:51 +0000 (Sun, 30 Nov 2008) $
*/
-public class ServiceInvoker implements MessageListener {
+public class DefaultServiceInvoker implements MessageListener {
- private static final Logger logger = Logger.getLogger(ServiceInvoker.class.getName());
+ private static final Logger logger = Logger.getLogger(DefaultServiceInvoker.class.getName());
private JMSBinding jmsBinding;
private Binding targetBinding;
@@ -50,7 +50,7 @@ public class ServiceInvoker implements MessageListener { private RuntimeComponentService service;
private MessageFactory messageFactory;
- public ServiceInvoker(JMSBinding jmsBinding, RuntimeComponentService service, Binding targetBinding, MessageFactory messageFactory, JMSResourceFactory rf) throws NamingException {
+ public DefaultServiceInvoker(JMSBinding jmsBinding, RuntimeComponentService service, Binding targetBinding, MessageFactory messageFactory, JMSResourceFactory rf) throws NamingException {
this.jmsBinding = jmsBinding;
this.jmsResourceFactory = rf;
this.service = service;
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSHostExtensionPoint.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSHostExtensionPoint.java new file mode 100644 index 0000000000..e4bf31f7ee --- /dev/null +++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSHostExtensionPoint.java @@ -0,0 +1,27 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.jms.host;
+
+
+public interface JMSHostExtensionPoint {
+
+ JMSServiceListenerFactory getJMSServiceListenerFactory();
+
+}
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListener.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListener.java new file mode 100644 index 0000000000..b6ccb5be9b --- /dev/null +++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListener.java @@ -0,0 +1,29 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.jms.host;
+
+public interface JMSServiceListener {
+
+ void start();
+
+ void stop();
+
+ String getDestinationName();
+}
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListenerDetails.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListenerDetails.java new file mode 100644 index 0000000000..2942f93781 --- /dev/null +++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListenerDetails.java @@ -0,0 +1,40 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.jms.host;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.binding.jms.JMSBinding;
+import org.apache.tuscany.sca.invocation.MessageFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+public interface JMSServiceListenerDetails {
+
+ JMSBinding getJmsBinding();
+
+ Binding getTargetBinding();
+
+ RuntimeComponentService getService();
+
+ RuntimeComponent getComponent();
+
+ MessageFactory getMessageFactory();
+
+}
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListenerFactory.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListenerFactory.java new file mode 100644 index 0000000000..5f3f773985 --- /dev/null +++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/host/JMSServiceListenerFactory.java @@ -0,0 +1,27 @@ +/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.jms.host;
+
+
+public interface JMSServiceListenerFactory {
+
+ JMSServiceListener createJMSServiceListener(JMSServiceListenerDetails jmsServiceBindingProvider);
+
+}
|