You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by eg...@apache.org on 2007/01/30 13:21:07 UTC
svn commit: r501388 [2/2] - in /incubator/cxf/trunk:
api/src/main/java/org/apache/cxf/wsdl/
integration/jbi/src/main/java/org/apache/cxf/jbi/transport/
rt/core/src/main/java/org/apache/cxf/transport/
rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws...
Modified: incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java?view=diff&rev=501388&r1=501387&r2=501388
==============================================================================
--- incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java (original)
+++ incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportBase.java Tue Jan 30 04:21:03 2007
@@ -31,6 +31,7 @@
import org.apache.cxf.Bus;
+import org.apache.cxf.configuration.Configurable;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.transport.jms.base.JMSTransportBaseConfigBean;
@@ -40,7 +41,7 @@
import org.apache.cxf.transports.jms.jms_conf.JMSSessionPoolConfigPolicy;
-public class JMSTransportBase extends JMSTransportBaseConfigBean {
+public class JMSTransportBase extends JMSTransportBaseConfigBean implements Configurable {
protected Destination targetDestination;
protected Destination replyDestination;
@@ -48,12 +49,14 @@
protected Bus bus;
//protected EndpointReferenceType targetEndpoint;
protected EndpointInfo endpointInfo;
+ protected String beanNameSuffix;
//--Constructors------------------------------------------------------------
- public JMSTransportBase(Bus b, EndpointInfo endpoint, boolean isServer) {
+ public JMSTransportBase(Bus b, EndpointInfo endpoint, boolean isServer, String suffix) {
bus = b;
endpointInfo = endpoint;
+ beanNameSuffix = suffix;
setAddressPolicy(endpointInfo.getTraversedExtensor(new JMSAddressPolicyType(),
JMSAddressPolicyType.class));
@@ -65,6 +68,11 @@
configurer.configureBean(this);
}
}
+
+ public String getBeanName() {
+ return endpointInfo.getName().toString() + beanNameSuffix;
+ }
+
/**
* Callback from the JMSProviderHub indicating the ClientTransport has
Modified: incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java?view=diff&rev=501388&r1=501387&r2=501388
==============================================================================
--- incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSTransportFactory.java Tue Jan 30 04:21:03 2007
@@ -59,12 +59,8 @@
}
public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target) throws IOException {
- Conduit conduit =
+ JMSConduit conduit =
target == null ? new JMSConduit(bus, endpointInfo) : new JMSConduit(bus, endpointInfo, target);
- Configurer configurer = bus.getExtension(Configurer.class);
- if (null != configurer) {
- configurer.configureBean(conduit);
- }
return conduit;
}
Modified: incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java?view=diff&rev=501388&r1=501387&r2=501388
==============================================================================
--- incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java (original)
+++ incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java Tue Jan 30 04:21:03 2007
@@ -57,16 +57,16 @@
"HelloWorldQueueBinMsgService",
"HelloWorldQueueBinMsgPort");
JMSConduit conduit = setupJMSConduit(false, false);
- assertNotNull(conduit.jmsConduitConfigBean);
+ assertNotNull(conduit.config);
assertEquals("Can't get the right ClientReceiveTimeout",
500,
- conduit.jmsConduitConfigBean.getClientConfig().getClientReceiveTimeout());
+ conduit.config.getClientConfig().getClientReceiveTimeout());
assertEquals("Can't get the right SessionPoolConfig's LowWaterMark",
10,
- conduit.getSessionPoolConfig().getLowWaterMark());
+ conduit.base.getSessionPoolConfig().getLowWaterMark());
assertEquals("Can't get the right AddressPolicy's ConnectionPassword",
"testPassword",
- conduit.getAddressPolicy().getConnectionPassword());
+ conduit.base.getAddressPolicy().getConnectionPassword());
bf.setDefaultBus(null);
}
Modified: incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java?view=diff&rev=501388&r1=501387&r2=501388
==============================================================================
--- incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java (original)
+++ incubator/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java Tue Jan 30 04:21:03 2007
@@ -27,6 +27,8 @@
import junit.framework.TestSuite;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.ExchangeImpl;
import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageImpl;
import org.apache.cxf.transport.Conduit;
@@ -81,7 +83,10 @@
if (send) {
// setMessageObserver
observer = new MessageObserver() {
- public void onMessage(Message m) {
+ public void onMessage(Message m) {
+ Exchange exchange = new ExchangeImpl();
+ exchange.setInMessage(m);
+ m.setExchange(exchange);
destMessage = m;
}
};
@@ -102,16 +107,16 @@
JMSDestination destination = setupJMSDestination(false);
assertEquals("Can't get the right ServerConfig's MessageTimeToLive ",
500,
- destination.jmsDestinationConfigBean.getServerConfig().getMessageTimeToLive());
+ destination.config.getServerConfig().getMessageTimeToLive());
assertEquals("Can't get the right Server's MessageSelector",
"cxf_message_selector",
- destination.jmsDestinationConfigBean.getServer().getMessageSelector());
+ destination.config.getServer().getMessageSelector());
assertEquals("Can't get the right SessionPoolConfig's LowWaterMark",
10,
- destination.getSessionPoolConfig().getLowWaterMark());
+ destination.base.getSessionPoolConfig().getLowWaterMark());
assertEquals("Can't get the right AddressPolicy's ConnectionPassword",
"testPassword",
- destination.getAddressPolicy().getConnectionPassword());
+ destination.base.getAddressPolicy().getConnectionPassword());
bf.setDefaultBus(null);
}
@@ -199,6 +204,9 @@
//set up MessageObserver for handlering the conduit message
MessageObserver observer = new MessageObserver() {
public void onMessage(Message m) {
+ Exchange exchange = new ExchangeImpl();
+ exchange.setInMessage(m);
+ m.setExchange(exchange);
verifyReceivedMessage(m);
verifyHeaders(m, outMessage);
//setup the message for
Modified: incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java?view=diff&rev=501388&r1=501387&r2=501388
==============================================================================
--- incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java (original)
+++ incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalConduit.java Tue Jan 30 04:21:03 2007
@@ -23,44 +23,31 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PipedInputStream;
+import java.util.logging.Logger;
import org.apache.cxf.attachment.CachedOutputStream;
+import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.io.AbstractCachedOutputStream;
import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.ExchangeImpl;
import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageImpl;
-import org.apache.cxf.transport.Conduit;
-import org.apache.cxf.transport.Destination;
-import org.apache.cxf.transport.MessageObserver;
-import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.transport.AbstractConduit;
-public class LocalConduit implements Conduit {
+public class LocalConduit extends AbstractConduit {
public static final String IN_CONDUIT = LocalConduit.class.getName() + ".inConduit";
public static final String IN_EXCHANGE = LocalConduit.class.getName() + ".inExchange";
+ private static final Logger LOG = LogUtils.getL7dLogger(LocalConduit.class);
+
private LocalDestination destination;
- private MessageObserver observer;
public LocalConduit(LocalDestination destination) {
+ super(destination.getAddress());
this.destination = destination;
}
-
- public void close(Message msg) throws IOException {
- msg.getContent(OutputStream.class).close();
- }
- public void close() {
- }
-
- public Destination getBackChannel() {
- return null;
- }
-
- public EndpointReferenceType getTarget() {
- return destination.getAddress();
- }
-
+
public void send(final Message message) throws IOException {
final PipedInputStream stream = new PipedInputStream();
final LocalConduit conduit = this;
@@ -92,12 +79,8 @@
// TODO: put on executor
new Thread(receiver).start();
}
-
- public void setMessageObserver(MessageObserver o) {
- this.observer = o;
- }
-
- public MessageObserver getMessageObserver() {
- return observer;
+
+ protected Logger getLogger() {
+ return LOG;
}
}
Modified: incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java?view=diff&rev=501388&r1=501387&r2=501388
==============================================================================
--- incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java (original)
+++ incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalDestination.java Tue Jan 30 04:21:03 2007
@@ -24,31 +24,41 @@
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
+import java.util.logging.Logger;
+import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.AbstractConduit;
+import org.apache.cxf.transport.AbstractDestination;
import org.apache.cxf.transport.Conduit;
-import org.apache.cxf.transport.Destination;
-import org.apache.cxf.transport.MessageObserver;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
-public class LocalDestination implements Destination {
+public class LocalDestination extends AbstractDestination {
+
+ private static final Logger LOG = LogUtils.getL7dLogger(LocalDestination.class);
+
private LocalTransportFactory localDestinationFactory;
- private MessageObserver messageObserver;
- private EndpointReferenceType epr;
- public LocalDestination(LocalTransportFactory localDestinationFactory, EndpointReferenceType epr) {
- super();
+ public LocalDestination(LocalTransportFactory localDestinationFactory,
+ EndpointReferenceType epr,
+ EndpointInfo ei) {
+ super(epr, ei);
this.localDestinationFactory = localDestinationFactory;
- this.epr = epr;
}
- public EndpointReferenceType getAddress() {
- return epr;
+ public void shutdown() {
+ localDestinationFactory.remove(this);
}
-
- public Conduit getBackChannel(Message inMessage, Message partialResponse, EndpointReferenceType address) {
+
+ protected Logger getLogger() {
+ return LOG;
+ }
+
+ @Override
+ protected Conduit getInbuiltBackChannel(Message inMessage) {
Conduit conduit = (Conduit)inMessage.get(LocalConduit.IN_CONDUIT);
if (conduit instanceof LocalConduit) {
return new SynchronousConduit((LocalConduit)conduit);
@@ -56,39 +66,13 @@
return null;
}
- public void shutdown() {
- localDestinationFactory.remove(this);
- }
-
- public void setMessageObserver(MessageObserver observer) {
- this.messageObserver = observer;
- }
-
- public MessageObserver getMessageObserver() {
- return messageObserver;
- }
-
- static class SynchronousConduit implements Conduit {
+ static class SynchronousConduit extends AbstractConduit {
private LocalConduit conduit;
public SynchronousConduit(LocalConduit conduit) {
- super();
+ super(null);
this.conduit = conduit;
}
- public void close(Message msg) throws IOException {
- msg.getContent(OutputStream.class).close();
- }
-
- public void close() {
- }
-
- public Destination getBackChannel() {
- return null;
- }
-
- public EndpointReferenceType getTarget() {
- return null;
- }
public void send(final Message message) throws IOException {
@@ -110,8 +94,9 @@
new Thread(receiver).start();
}
-
- public void setMessageObserver(MessageObserver observer) {
+
+ protected Logger getLogger() {
+ return LOG;
}
}
}
Modified: incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java?view=diff&rev=501388&r1=501387&r2=501388
==============================================================================
--- incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/local/src/main/java/org/apache/cxf/transport/local/LocalTransportFactory.java Tue Jan 30 04:21:03 2007
@@ -59,21 +59,23 @@
}
public Destination getDestination(EndpointInfo ei) throws IOException {
- return getDestination(createReference(ei));
+ return getDestination(ei, createReference(ei));
}
- public Destination getDestination(EndpointReferenceType reference) throws IOException {
+ protected Destination getDestination(EndpointInfo ei,
+ EndpointReferenceType reference)
+ throws IOException {
Destination d = destinations.get(reference.getAddress().getValue());
if (d == null) {
- d = createDestination(reference);
+ d = createDestination(ei, reference);
destinations.put(reference.getAddress().getValue(), d);
}
return d;
}
- private Destination createDestination(EndpointReferenceType reference) {
+ private Destination createDestination(EndpointInfo ei, EndpointReferenceType reference) {
LOG.info("Creating destination for address " + reference.getAddress().getValue());
- return new LocalDestination(this, reference);
+ return new LocalDestination(this, reference, ei);
}
void remove(LocalDestination destination) {
@@ -81,11 +83,11 @@
}
public Conduit getConduit(EndpointInfo ei) throws IOException {
- return new LocalConduit((LocalDestination)getDestination(createReference(ei)));
+ return new LocalConduit((LocalDestination)getDestination(ei));
}
public Conduit getConduit(EndpointInfo ei, EndpointReferenceType target) throws IOException {
- return new LocalConduit((LocalDestination)getDestination(target));
+ return new LocalConduit((LocalDestination)getDestination(ei, target));
}
EndpointReferenceType createReference(EndpointInfo ei) {
Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java?view=diff&rev=501388&r1=501387&r2=501388
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java (original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java Tue Jan 30 04:21:03 2007
@@ -529,9 +529,8 @@
*/
private void restoreExchange(SoapMessage message, AddressingProperties maps) {
if (maps.getRelatesTo() != null) {
- // REVISIT remove if not partial response
Exchange correlatedExchange =
- uncorrelatedExchanges.get(maps.getRelatesTo().getValue());
+ uncorrelatedExchanges.remove(maps.getRelatesTo().getValue());
if (correlatedExchange != null) {
synchronized (correlatedExchange) {
Exchange tmpExchange = message.getExchange();