summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/binding-jms-runtime
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-10-15 09:31:06 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-10-15 09:31:06 +0000
commitd3826b9818a728ecef4391cd38558bd0ede41b72 (patch)
treea8db298e10d24431e7fb4725e85bf422d1f5a9c8 /java/sca/modules/binding-jms-runtime
parent54a87028541800f6a72fc470a02d1bd4aa53d494 (diff)
Create JMSResourceFactory interface in preperation for making it plugable
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@704822 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-jms-runtime')
-rw-r--r--java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingInvoker.java4
-rw-r--r--java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java4
-rw-r--r--java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java2
-rw-r--r--java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java2
-rw-r--r--java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java17
-rw-r--r--java/sca/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/OperationSelectionTestCaseFIXME.java4
6 files changed, 18 insertions, 15 deletions
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingInvoker.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingInvoker.java
index 1d2067055a..9c5fba5de6 100644
--- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingInvoker.java
+++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingInvoker.java
@@ -61,7 +61,7 @@ public class JMSBindingInvoker implements Invoker, DataExchangeSemantics {
protected String operationName;
protected JMSBinding jmsBinding;
- protected JMSResourceFactoryImpl jmsResourceFactory;
+ protected JMSResourceFactory jmsResourceFactory;
protected JMSMessageProcessor requestMessageProcessor;
protected JMSMessageProcessor responseMessageProcessor;
protected Destination bindingRequestDest;
@@ -70,7 +70,7 @@ public class JMSBindingInvoker implements Invoker, DataExchangeSemantics {
protected JMSTokenAuthenticationPolicy jmsTokenAuthenticationPolicy = null;
protected JMSHeaderPolicy jmsHeaderPolicy = null;
- public JMSBindingInvoker(JMSBinding jmsBinding, Operation operation, JMSResourceFactoryImpl jmsResourceFactory, RuntimeComponentReference reference) {
+ public JMSBindingInvoker(JMSBinding jmsBinding, Operation operation, JMSResourceFactory jmsResourceFactory, RuntimeComponentReference reference) {
this.operation = operation;
operationName = operation.getName();
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java
index 1cf9d57bc9..87b1bb21e2 100644
--- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java
+++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingListener.java
@@ -62,7 +62,7 @@ public class JMSBindingListener implements MessageListener {
private static final String ON_MESSAGE_METHOD_NAME = "onMessage";
private JMSBinding jmsBinding;
private Binding targetBinding;
- private JMSResourceFactoryImpl jmsResourceFactory;
+ private JMSResourceFactory jmsResourceFactory;
private RuntimeComponentService service;
private JMSMessageProcessor requestMessageProcessor;
private JMSMessageProcessor responseMessageProcessor;
@@ -70,7 +70,7 @@ public class JMSBindingListener implements MessageListener {
private List<Operation> serviceOperations;
protected JMSTokenAuthenticationPolicy jmsTokenAuthenticationPolicy = null;
- public JMSBindingListener(JMSBinding jmsBinding, JMSResourceFactoryImpl jmsResourceFactory, RuntimeComponentService service, Binding targetBinding) throws NamingException {
+ public JMSBindingListener(JMSBinding jmsBinding, JMSResourceFactory jmsResourceFactory, RuntimeComponentService service, Binding targetBinding) throws NamingException {
this.jmsBinding = jmsBinding;
this.jmsResourceFactory = jmsResourceFactory;
this.service = service;
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
index 9e40456d0b..3184df1e55 100644
--- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
+++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingReferenceBindingProvider.java
@@ -49,7 +49,7 @@ public class JMSBindingReferenceBindingProvider implements ReferenceBindingProvi
private RuntimeComponentReference reference;
private JMSBinding jmsBinding;
private List<JMSBindingInvoker> jmsBindingInvokers = new ArrayList<JMSBindingInvoker>();
- private JMSResourceFactoryImpl jmsResourceFactory;
+ private JMSResourceFactory jmsResourceFactory;
private RuntimeComponent component;
private InterfaceContract wsdlInterfaceContract;
private ExtensionPointRegistry extensions;
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
index e97fef0f45..1e38c597b5 100644
--- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
+++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSBindingServiceBindingProvider.java
@@ -57,7 +57,7 @@ public class JMSBindingServiceBindingProvider implements ServiceBindingProvider
private RuntimeComponentService service;
private Binding targetBinding;
private JMSBinding jmsBinding;
- private JMSResourceFactoryImpl jmsResourceFactory;
+ private JMSResourceFactory jmsResourceFactory;
private MessageConsumer consumer;
private WorkScheduler workScheduler;
private boolean running;
diff --git a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java
index eced286a20..6efcb2010f 100644
--- a/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java
+++ b/java/sca/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/JMSResourceFactoryImpl.java
@@ -37,7 +37,7 @@ import org.apache.tuscany.sca.binding.jms.impl.JMSBindingException;
*
* @version $Rev$ $Date$
*/
-public class JMSResourceFactoryImpl {
+public class JMSResourceFactoryImpl implements JMSResourceFactory {
private String initialContextFactoryName;
private String connectionFactoryName = "ConnectionFactory";
@@ -64,7 +64,7 @@ public class JMSResourceFactoryImpl {
* able to leverage the host environment to provide connection pooling if it can. E.g. if Tuscany is running inside
* an AppServer Then we could leverage the JMS resources it provides
*
- * @see org.apache.tuscany.binding.jms.JMSResourceFactory#getConnection()
+ * @see org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory#getConnection()
*/
public Connection getConnection() throws NamingException, JMSException {
if (connection == null) {
@@ -76,7 +76,7 @@ public class JMSResourceFactoryImpl {
/*
* (non-Javadoc)
*
- * @see org.apache.tuscany.binding.jms.JMSResourceFactory#createSession()
+ * @see org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory#createSession()
*/
public Session createSession() throws JMSException, NamingException {
return getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -85,7 +85,7 @@ public class JMSResourceFactoryImpl {
/*
* (non-Javadoc)
*
- * @see org.apache.tuscany.binding.jms.JMSResourceFactory#startConnection()
+ * @see org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory#startConnection()
*/
public void startConnection() throws JMSException, NamingException {
if (!isConnectionStarted) {
@@ -97,7 +97,7 @@ public class JMSResourceFactoryImpl {
/*
* (non-Javadoc)
*
- * @see org.apache.tuscany.binding.jms.JMSResourceFactory#closeConnection()
+ * @see org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory#closeConnection()
*/
public void closeConnection() throws JMSException {
if (connection != null) {
@@ -154,6 +154,9 @@ public class JMSResourceFactoryImpl {
}
}
+ /* (non-Javadoc)
+ * @see org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory#lookupDestination(java.lang.String)
+ */
public Destination lookupDestination(String destName) throws NamingException {
if (JMSBindingConstants.DEFAULT_DESTINATION_NAME.equals(destName)) {
return null;
@@ -194,8 +197,8 @@ public class JMSResourceFactoryImpl {
return null;
}
- /**
- * You can create a destination in ActiveMQ (and have it appear in JNDI) by putting "dynamicQueues/" in front of the queue name being looked up
+ /* (non-Javadoc)
+ * @see org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory#createDestination(java.lang.String)
*/
public Destination createDestination(String jndiName) throws NamingException {
return lookupDestination("dynamicQueues/" + jndiName);
diff --git a/java/sca/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/OperationSelectionTestCaseFIXME.java b/java/sca/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/OperationSelectionTestCaseFIXME.java
index 7d8f9fd2fc..03cc0bf1c4 100644
--- a/java/sca/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/OperationSelectionTestCaseFIXME.java
+++ b/java/sca/modules/binding-jms-runtime/src/test/java/org/apache/tuscany/sca/binding/jms/OperationSelectionTestCaseFIXME.java
@@ -25,7 +25,7 @@ import javax.jms.TextMessage;
import org.apache.tuscany.sca.binding.jms.impl.JMSBinding;
import org.apache.tuscany.sca.binding.jms.provider.JMSBindingListener;
-import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactoryImpl;
+import org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactory;
import org.apache.tuscany.sca.interfacedef.Interface;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.interfacedef.Operation;
@@ -181,7 +181,7 @@ public class OperationSelectionTestCaseFIXME {
throws Exception {
// Create the test JMS Binding
final JMSBinding jmsBinding = new JMSBinding();
- JMSResourceFactoryImpl jmsResourceFactory = null;
+ JMSResourceFactory jmsResourceFactory = null;
// Extra information for the method we are invoking
final String operationParams = "Hello";