Skip to content
Permalink
Browse files
Start working on supporting Spring4. Remove JMS102 stuff.
git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1555931 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
dkulp committed Jan 6, 2014
1 parent 669aa67 commit fb8061c8e24710869b963ab68bcfc55aee9ccc2d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 60 deletions.
@@ -60,7 +60,7 @@
<cxf.osgi.import />
<cxf.osgi.symbolic.name>${project.groupId}.${project.artifactId}</cxf.osgi.symbolic.name>
<cxf.osgi.dynamic.import />
<cxf.osgi.spring.version>[3.1,4)</cxf.osgi.spring.version>
<cxf.osgi.spring.version>[3.1,5)</cxf.osgi.spring.version>
<cxf.osgi.commons.lang.version>[2.4,3)</cxf.osgi.commons.lang.version>
<cxf.osgi.slf4j.version>[1.5,2)</cxf.osgi.slf4j.version>
<cxf.osgi.javax.annotation.version>[0.0,2)</cxf.osgi.javax.annotation.version>
@@ -138,7 +138,7 @@
<cxf.servlet-api-2.5.version>1.1.2</cxf.servlet-api-2.5.version>
<cxf.slf4j.version>1.7.5</cxf.slf4j.version>
<cxf.specs.jaxws.api.version>1.1</cxf.specs.jaxws.api.version>
<cxf.spring.version>3.2.5.RELEASE</cxf.spring.version>
<cxf.spring.version>3.2.6.RELEASE</cxf.spring.version>
<cxf.spring.security.version>3.1.4.RELEASE</cxf.spring.security.version>
<cxf.spring.osgi.version>1.2.1</cxf.spring.osgi.version>
<cxf.spring.ldap.version>1.3.1.RELEASE</cxf.spring.ldap.version>
@@ -642,7 +642,7 @@
<dependency>
<groupId>httpunit</groupId>
<artifactId>httpunit</artifactId>
<version>1.6.2</version>
<version>1.7</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
@@ -42,8 +42,6 @@ public class JMSConfiguration implements InitializingBean {
*/
public static final int DEFAULT_VALUE = -1;

static final boolean DEFAULT_USEJMS11 = true;

private boolean usingEndpointInfo = true;

private JmsTemplate jmsTemplate;
@@ -55,7 +53,6 @@ public class JMSConfiguration implements InitializingBean {
private PlatformTransactionManager transactionManager;
private boolean wrapInSingleConnectionFactory = true;
private TaskExecutor taskExecutor;
private boolean useJms11 = DEFAULT_USEJMS11;
private boolean reconnectOnException = true;
private boolean messageIdEnabled = true;
private boolean messageTimestampEnabled = true;
@@ -324,14 +321,6 @@ public void setReplyPubSubDomain(boolean replyPubSubDomain) {
this.replyPubSubDomain = replyPubSubDomain;
}

public boolean isUseJms11() {
return useJms11;
}

public void setUseJms11(boolean useJms11) {
this.useJms11 = useJms11;
}

public DestinationResolver getDestinationResolver() {
return destinationResolver;
}
@@ -458,20 +447,12 @@ public synchronized ConnectionFactory getOrCreateWrappedConnectionFactory() {
}
if (wrapInSingleConnectionFactory && !(connectionFactory instanceof SingleConnectionFactory)) {
SingleConnectionFactory scf;
if (useJms11) {
if (connectionFactory instanceof XAConnectionFactory) {
scf = new XASingleConnectionFactory(connectionFactory);
} else {
scf = new SingleConnectionFactory(connectionFactory);
}
autoWrappedConnectionFactory = true;
if (connectionFactory instanceof XAConnectionFactory) {
scf = new XASingleConnectionFactory(connectionFactory);
} else {
@SuppressWarnings("deprecation")
SingleConnectionFactory scf2
= new org.springframework.jms.connection.SingleConnectionFactory102(connectionFactory,
pubSubDomain);
scf = scf2;
scf = new SingleConnectionFactory(connectionFactory);
}
autoWrappedConnectionFactory = true;
if (getDurableSubscriptionClientId() != null) {
scf.setClientId(getDurableSubscriptionClientId());
}
@@ -101,10 +101,7 @@ public static JmsTemplate createJmsTemplate(JMSConfiguration jmsConfig,
if (jmsConfig.getJmsTemplate() != null) {
return jmsConfig.getJmsTemplate();
}
@SuppressWarnings("deprecation")
JmsTemplate jmsTemplate = jmsConfig.isUseJms11()
? new JmsTemplate()
: new org.springframework.jms.core.JmsTemplate102();
JmsTemplate jmsTemplate = new JmsTemplate();
jmsTemplate.setConnectionFactory(jmsConfig.getOrCreateWrappedConnectionFactory());
jmsTemplate.setPubSubDomain(jmsConfig.isPubSubDomain());
if (jmsConfig.getReceiveTimeout() != null) {
@@ -136,7 +133,6 @@ public static JmsTemplate createJmsTemplate(JMSConfiguration jmsConfig,
* @param destinationName null for temp dest or a destination name
* @return
*/
@SuppressWarnings("deprecation")
public static AbstractMessageListenerContainer createJmsListener(EndpointInfo ei,
JMSConfiguration jmsConfig,
MessageListener listenerHandler,
@@ -157,19 +153,15 @@ public static AbstractMessageListenerContainer createJmsListener(EndpointInfo ei
}
DefaultMessageListenerContainer jmsListener = null;

if (jmsConfig.isUseJms11()) {
//Check to see if transport is being used in JCA RA with XA
Method method = ei.getProperty(JCATransactionalMessageListenerContainer.MDB_TRANSACTED_METHOD,
java.lang.reflect.Method.class);
if (method != null
&&
jmsConfig.getConnectionFactory() instanceof XAConnectionFactory) {
jmsListener = new JCATransactionalMessageListenerContainer(ei);
} else {
jmsListener = new DefaultMessageListenerContainer();
}
//Check to see if transport is being used in JCA RA with XA
Method method = ei.getProperty(JCATransactionalMessageListenerContainer.MDB_TRANSACTED_METHOD,
java.lang.reflect.Method.class);
if (method != null
&&
jmsConfig.getConnectionFactory() instanceof XAConnectionFactory) {
jmsListener = new JCATransactionalMessageListenerContainer(ei);
} else {
jmsListener = new org.springframework.jms.listener.DefaultMessageListenerContainer102();
jmsListener = new DefaultMessageListenerContainer();
}

return createJmsListener(jmsListener,
@@ -193,10 +185,7 @@ public static DefaultMessageListenerContainer createJmsListener(JMSConfiguration
Destination destination,
String messageSelectorPrefix,
boolean userCID) {
@SuppressWarnings("deprecation")
DefaultMessageListenerContainer jmsListener = jmsConfig.isUseJms11()
? new DefaultMessageListenerContainer()
: new org.springframework.jms.listener.DefaultMessageListenerContainer102();
DefaultMessageListenerContainer jmsListener = new DefaultMessageListenerContainer();

return createJmsListener(jmsListener,
jmsConfig,
@@ -211,10 +200,7 @@ public static DefaultMessageListenerContainer createJmsListener(JMSConfiguration
String destination,
String messageSelectorPrefix,
boolean userCID) {
@SuppressWarnings("deprecation")
DefaultMessageListenerContainer jmsListener = jmsConfig.isUseJms11()
? new DefaultMessageListenerContainer()
: new org.springframework.jms.listener.DefaultMessageListenerContainer102();
DefaultMessageListenerContainer jmsListener = new DefaultMessageListenerContainer();

return createJmsListener(jmsListener,
jmsConfig,
@@ -268,7 +268,7 @@ protected JMSConfiguration configureEndpoint(boolean isConduit, JMSEndpoint endp
jmsConfig.setTimeToLive(timeToLive);
}
if (endpoint.isSetUseJMS11()) {
jmsConfig.setUseJms11(endpoint.isUseJMS11());
LOG.log(Level.WARNING, "Use of jms:endpoint[@useJms11] is no longer supported");
}
if (serverBehavior.isSetTransactional()) {
jmsConfig.setSessionTransacted(serverBehavior.isTransactional());
@@ -332,7 +332,7 @@ private static void mapAddressToEndpoint(AddressType address, JMSEndpoint endpoi
endpoint.setReconnectOnException(address.isReconnectOnException());
}
if (address.isSetUseJms11()) {
endpoint.setUseJMS11(address.isUseJms11());
LOG.log(Level.WARNING, "Use of address[@useJms11] is no longer supported");
}
boolean useJndi = address.isSetJndiDestinationName();
if (useJndi) {
@@ -120,15 +120,14 @@ public static Message createAndSetPayload(Object payload, Session session, Strin
* @return the message payload as byte[]
* @throws UnsupportedEncodingException
*/
@SuppressWarnings("deprecation")
public static void retrieveAndSetPayload(org.apache.cxf.message.Message inMessage,
Message message, String encoding)
throws UnsupportedEncodingException {
String messageType = null;
Object converted;
byte[] result;
try {
converted = new org.springframework.jms.support.converter.SimpleMessageConverter102()
converted = new org.springframework.jms.support.converter.SimpleMessageConverter()
.fromMessage(message);
} catch (MessageConversionException e) {
throw new RuntimeException("Conversion failed", e);
@@ -64,7 +64,6 @@ protected void run() {
jmsConfig.setTargetDestination("greeter.queue.noaop");
jmsConfig.setSessionTransacted(true);
jmsConfig.setPubSubDomain(false);
jmsConfig.setUseJms11(true);
jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
jmsConfig.setCacheLevel(3);

@@ -128,7 +127,6 @@ public void testNonAopTransaction() throws Exception {
jmsConfig.setConnectionFactory(connectionFactory);
jmsConfig.setTargetDestination("greeter.queue.noaop");
jmsConfig.setPubSubDomain(false);
jmsConfig.setUseJms11(true);

JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
jmsConfigFeature.setJmsConfig(jmsConfig);
@@ -29,7 +29,7 @@
<ref bean="transactionManager"/>
</property>
<property name="target">
<ref local="testBeanABOImpl"/>
<ref bean="testBeanABOImpl"/>
</property>
<property name="transactionAttributes">
<props>
@@ -51,7 +51,7 @@
<ref bean="transactionManager"/>
</property>
<property name="target">
<ref local="testBeanBBOImpl"/>
<ref bean="testBeanBBOImpl"/>
</property>
<property name="transactionAttributes">
<props>
@@ -72,7 +72,7 @@
<ref bean="transactionManager"/>
</property>
<property name="target">
<ref local="testBeanCBOImpl"/>
<ref bean="testBeanCBOImpl"/>
</property>
<property name="transactionAttributes">
<props>

0 comments on commit fb8061c

Please sign in to comment.