public void addListener(Destination d, Endpoint e) { ChainInitiationObserver observer = new ChainInitiationObserver(e, bus); d.setMessageObserver(observer); }
public void addListener(Destination d, Endpoint e) { ChainInitiationObserver observer = new ChainInitiationObserver(e, bus); d.setMessageObserver(observer); }
public void addListener(Destination d, Endpoint e) { ChainInitiationObserver observer = new ChainInitiationObserver(e, bus); d.setMessageObserver(observer); }
public void addListener(Destination d, Endpoint e) { ChainInitiationObserver observer = new ChainInitiationObserver(e, bus); d.setMessageObserver(observer); }
public void stop() { if (stopped) { return; } LOG.fine("Server is stopping."); if (slcMgr != null) { slcMgr.stopServer(this); } MessageObserver mo = getDestination().getMessageObserver(); if (mo instanceof MultipleEndpointObserver) { ((MultipleEndpointObserver)mo).getEndpoints().remove(endpoint); if (((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) { getDestination().setMessageObserver(null); } } else { getDestination().setMessageObserver(null); } stopped = true; }
public void stop() { if (stopped) { return; } LOG.fine("Server is stopping."); if (slcMgr != null) { slcMgr.stopServer(this); } MessageObserver mo = getDestination().getMessageObserver(); if (mo instanceof MultipleEndpointObserver) { ((MultipleEndpointObserver)mo).getEndpoints().remove(endpoint); if (((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) { getDestination().setMessageObserver(null); } } else { getDestination().setMessageObserver(null); } stopped = true; }
public void stop() { if (stopped) { return; } LOG.fine("Server is stopping."); for (Closeable c : endpoint.getCleanupHooks()) { try { c.close(); } catch (IOException e) { //ignore } } if (slcMgr != null) { slcMgr.stopServer(this); } MessageObserver mo = getDestination().getMessageObserver(); if (mo instanceof MultipleEndpointObserver) { ((MultipleEndpointObserver)mo).getEndpoints().remove(endpoint); if (((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) { getDestination().setMessageObserver(null); } } else { getDestination().setMessageObserver(null); } stopped = true; }
public void clientDestroyed(Client client) { Destination dest = client.getEndpoint().getEndpointInfo() .getProperty(DECOUPLED_DESTINATION, Destination.class); if (dest != null) { dest.setMessageObserver(null); dest.shutdown(); } }
public void stop() { if (stopped) { return; } LOG.fine("Server is stopping."); for (Closeable c : endpoint.getCleanupHooks()) { try { c.close(); } catch (IOException e) { //ignore } } if (slcMgr != null) { slcMgr.stopServer(this); } MessageObserver mo = getDestination().getMessageObserver(); if (mo instanceof MultipleEndpointObserver) { ((MultipleEndpointObserver)mo).getEndpoints().remove(endpoint); if (((MultipleEndpointObserver)mo).getEndpoints().isEmpty()) { getDestination().setMessageObserver(null); } } else { getDestination().setMessageObserver(null); } stopped = true; }
public void clientDestroyed(Client client) { Destination dest = client.getEndpoint().getEndpointInfo() .getProperty(DECOUPLED_DESTINATION, Destination.class); if (dest != null) { dest.setMessageObserver(null); dest.shutdown(); } }
public void startServer(Server server) { Endpoint endpoint = server.getEndpoint(); Service service = endpoint.getService(); // synthesize a new binding BindingInfo bi = bindingFactory.createBindingInfo(service, ObjectBindingFactory.BINDING_ID, configuration); Binding binding = bindingFactory.createBinding(bi); String uri = "local://" + server.toString(); EndpointInfo ei = new EndpointInfo(); ei.setAddress(uri); try { // Register a new Destination locally for the Server Destination destination = getDestinationFactory().getDestination(ei, bus); destination.setMessageObserver(new OverrideBindingObserver(endpoint, binding, bus)); } catch (IOException e1) { LOG.log(Level.WARNING, "Could not create local destination.", e1); } }
/** * @param address the address * @return a Destination for the address */ private Destination getDestination(Bus bus, String address, Message message) throws IOException { Destination destination = null; DestinationFactoryManager factoryManager = bus.getExtension(DestinationFactoryManager.class); DestinationFactory factory = factoryManager.getDestinationFactoryForUri(address); if (factory != null) { Endpoint ep = message.getExchange().getEndpoint(); EndpointInfo ei = new EndpointInfo(); ei.setName(new QName(ep.getEndpointInfo().getName().getNamespaceURI(), ep.getEndpointInfo().getName().getLocalPart() + ".decoupled")); ei.setAddress(address); destination = factory.getDestination(ei, bus); Conduit conduit = ContextUtils.getConduit(null, message); if (conduit != null) { MessageObserver ob = conduit.getMessageObserver(); ob = new InterposedMessageObserver(bus, ob); destination.setMessageObserver(ob); } } return destination; } protected static class InterposedMessageObserver implements MessageObserver {
/** * @param address the address * @return a Destination for the address */ private Destination getDestination(Bus bus, String address, Message message) throws IOException { Destination destination = null; DestinationFactoryManager factoryManager = bus.getExtension(DestinationFactoryManager.class); DestinationFactory factory = factoryManager.getDestinationFactoryForUri(address); if (factory != null) { Endpoint ep = message.getExchange().getEndpoint(); EndpointInfo ei = new EndpointInfo(); ei.setName(new QName(ep.getEndpointInfo().getName().getNamespaceURI(), ep.getEndpointInfo().getName().getLocalPart() + ".decoupled")); ei.setAddress(address); destination = factory.getDestination(ei, bus); Conduit conduit = ContextUtils.getConduit(null, message); if (conduit != null) { MessageObserver ob = conduit.getMessageObserver(); ob = new InterposedMessageObserver(bus, ob); destination.setMessageObserver(ob); } } return destination; } protected static class InterposedMessageObserver implements MessageObserver {
private void unregisterServStatic(String add) throws Exception { Bus bus = getStaticBus(); DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class); DestinationFactory df = dfm .getDestinationFactory("http://cxf.apache.org/transports/http/configuration"); EndpointInfo ei = new EndpointInfo(); ei.setAddress(add); Destination d = df.getDestination(ei, bus); d.setMessageObserver(null); }
d.setMessageObserver(new MessageObserver() {