| Commit in servicemix/base on MAIN | |||
| project.xml | +1 | -1 | 1.89 -> 1.90 |
| src/main/java/org/servicemix/components/jms/JmsInUsingJCABinding.java | +13 | -5 | 1.3 -> 1.4 |
| src/main/java/org/servicemix/jbi/nmr/flow/jca/JCAFlow.java | +5 | -16 | 1.3 -> 1.4 |
| src/test/resources/org/servicemix/components/wsif/example.xml | +3 | -1 | 1.5 -> 1.6 |
| +22 | -23 | ||
Upgrade to jencks 1.1 and fix wsif failing test case
servicemix/base
diff -u -r1.89 -r1.90 --- project.xml 4 Oct 2005 08:37:40 -0000 1.89 +++ project.xml 4 Oct 2005 15:46:40 -0000 1.90 @@ -631,7 +631,7 @@
<!-- JCA container and transaction manaqer -->
<dependency>
<id>jencks+all</id>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<properties>
<lib>true</lib>
<war.bundle>true</war.bundle>
servicemix/base/src/main/java/org/servicemix/components/jms
diff -u -r1.3 -r1.4 --- JmsInUsingJCABinding.java 17 Aug 2005 10:34:25 -0000 1.3 +++ JmsInUsingJCABinding.java 4 Oct 2005 15:46:41 -0000 1.4 @@ -22,22 +22,23 @@
import org.jencks.SingletonEndpointFactory; import org.springframework.beans.factory.InitializingBean;
+import javax.jbi.JBIException;
import javax.resource.spi.ActivationSpec; import javax.transaction.TransactionManager; /** * Uses the JCA Container for better inbound subscription. *
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
-public class JmsInUsingJCABinding extends JmsInBinding implements InitializingBean {
+public class JmsInUsingJCABinding extends JmsInBinding {
private JCAContainer jcaContainer;
private ActivationSpec activationSpec;
private TransactionManager transactionManager;
private JCAConnector jcaConnector;
- public void afterPropertiesSet() throws Exception {
+ protected void init() throws JBIException {
if (jcaContainer == null) {
throw new IllegalArgumentException("Must specify a jcaContainer property");
}
@@ -46,11 +47,18 @@
}
jcaConnector = jcaContainer.addConnector();
jcaConnector.setActivationSpec(activationSpec);
+ if (transactionManager == null) {
+ transactionManager = (TransactionManager) getContext().getTransactionManager();
+ }
if (transactionManager != null) {
jcaConnector.setTransactionManager(transactionManager);
}
- jcaConnector.setEndpointFactory(new SingletonEndpointFactory(this)); - jcaConnector.afterPropertiesSet();
+ jcaConnector.setEndpointFactory(new SingletonEndpointFactory(this, transactionManager));
+ try {
+ jcaConnector.afterPropertiesSet();
+ } catch (Exception e) {
+ throw new JBIException("Unable to start jca connector", e);
+ }
}
public JCAContainer getJcaContainer() {
servicemix/base/src/main/java/org/servicemix/jbi/nmr/flow/jca
diff -u -r1.3 -r1.4 --- JCAFlow.java 4 Oct 2005 09:42:07 -0000 1.3 +++ JCAFlow.java 4 Oct 2005 15:46:41 -0000 1.4 @@ -35,7 +35,6 @@
import javax.resource.spi.ConnectionManager; import javax.resource.spi.ResourceAdapter; import javax.resource.spi.ResourceAdapterInternalException;
-import javax.resource.spi.UnavailableException;
import javax.transaction.TransactionManager; import org.activemq.advisories.ConsumerAdvisor;
@@ -53,8 +52,8 @@
import org.apache.geronimo.connector.outbound.connectionmanagerconfig.XATransactions; import org.apache.geronimo.connector.work.GeronimoWorkManager; import org.apache.geronimo.transaction.context.TransactionContextManager;
-import org.jencks.EndpointFactorySupport;
import org.jencks.JCAConnector;
+import org.jencks.SingletonEndpointFactory;
import org.jencks.factory.ConnectionManagerFactoryBean; import org.servicemix.jbi.framework.ComponentConnector; import org.servicemix.jbi.framework.ComponentNameSpace;
@@ -74,7 +73,7 @@
/** * Use for message routing among a network containers. All routing/registration happens automatically *
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class JCAFlow extends SedaFlow implements ConsumerAdvisoryEventListener, MessageListener {
private static final Log log = LogFactory.getLog(JCAFlow.class);
@@ -190,16 +189,6 @@
return (TransactionManager) broker.getContainer().getTransactionManager();
}
- protected class JCAFlowEndpointFactory extends EndpointFactorySupport {
- public JCAFlowEndpointFactory(TransactionManager tm) {
- transactionManager = tm;
- }
- protected MessageListener createMessageListener() throws UnavailableException {
- return JCAFlow.this;
- }
-
- }
-
/**
* Initialize the Region
*
@@ -219,7 +208,7 @@
containerConnector.setBootstrapContext(getBootstrapContext());
containerConnector.setActivationSpec(ac);
containerConnector.setResourceAdapter(resourceAdapter);
- containerConnector.setEndpointFactory(new JCAFlowEndpointFactory(getTransactionManager()));
+ containerConnector.setEndpointFactory(new SingletonEndpointFactory(this, getTransactionManager()));
containerConnector.afterPropertiesSet();
// Outbound connector
@@ -236,7 +225,7 @@
broadcastConnector.setBootstrapContext(getBootstrapContext());
broadcastConnector.setActivationSpec(ac);
broadcastConnector.setResourceAdapter(resourceAdapter);
- broadcastConnector.setEndpointFactory(new JCAFlowEndpointFactory(null));
+ broadcastConnector.setEndpointFactory(new SingletonEndpointFactory(this));
broadcastConnector.afterPropertiesSet();
// Outbound broadcast
@@ -358,7 +347,7 @@
connector.setBootstrapContext(getBootstrapContext());
connector.setActivationSpec(ac);
connector.setResourceAdapter(resourceAdapter);
- connector.setEndpointFactory(new JCAFlowEndpointFactory(getTransactionManager()));
+ connector.setEndpointFactory(new SingletonEndpointFactory(this, getTransactionManager()));
connector.afterPropertiesSet();
connectorMap.put(componentName, connector);
} else if (event.getStatus() == ComponentPacketEvent.DEACTIVATED){
servicemix/base/src/test/resources/org/servicemix/components/wsif
diff -u -r1.5 -r1.6 --- example.xml 17 Aug 2005 10:34:26 -0000 1.5 +++ example.xml 4 Oct 2005 15:46:41 -0000 1.6 @@ -40,7 +40,9 @@
<!--
|| an inbound message connector using a stateless, thread safe MessageListener
-->
- <bean id="inboundMessageA" factory-method="addConnector" factory-bean="jencks" singleton="true">
+ <bean id="inboundMessageA" class="org.jencks.JCAConnector"> + + <property name="jcaContainer" ref="jencks" />
<!-- subscription details -->
<property name="activationSpec">
