}
// The real stuff ...
public synchronized RMEndpoint getReliableEndpoint(Message message) {
Endpoint endpoint = message.getExchange().get(Endpoint.class);
QName name = endpoint.getEndpointInfo().getName();
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Getting RMEndpoint for endpoint with info: " + name);
}
if (name.equals(RMConstants.getPortName())) {
WrappedEndpoint wrappedEndpoint = (WrappedEndpoint)endpoint;
endpoint = wrappedEndpoint.getWrappedEndpoint();
}
RMEndpoint rme = reliableEndpoints.get(endpoint);
if (null == rme) {
rme = createReliableEndpoint(endpoint);
org.apache.cxf.transport.Destination destination = message.getExchange().getDestination();
org.apache.cxf.ws.addressing.EndpointReferenceType replyTo = null;
if (null != destination) {
AddressingPropertiesImpl maps = RMContextUtils.retrieveMAPs(message, false, false);
replyTo = maps.getReplyTo();
}
Endpoint ei = message.getExchange().get(Endpoint.class);
org.apache.cxf.transport.Destination dest
= ei == null ? null : ei.getEndpointInfo()
.getProperty(MAPAggregator.DECOUPLED_DESTINATION,
org.apache.cxf.transport.Destination.class);
rme.initialise(message.getExchange().getConduit(message), replyTo, dest);
reliableEndpoints.put(endpoint, rme);
LOG.fine("Created new RMEndpoint.");