public Server getServerForAddress(String address) throws WSDLException { ServerRegistry svrMan = bus.getExtension(ServerRegistry.class); for (Server s : svrMan.getServers()) { if (address.equals(s.getEndpoint().getEndpointInfo().getAddress())) { return s; } } return null; }
ServerRegistry registry = serverBus.getExtension(ServerRegistry.class); List<Server> servers = registry.getServers(); for (Server sr : servers) { EndpointInfo ei = sr.getEndpoint().getEndpointInfo(); if (null != ei && ei.getAddress().endsWith(server.getAddress())){ registry.unregister(sr); sr.destroy();
public Server getServerForService(QName serviceName) throws WSDLException { ServerRegistry svrMan = bus.getExtension(ServerRegistry.class); for (Server s : svrMan.getServers()) { Service svc = s.getEndpoint().getService(); if (svc.getName().equals(serviceName)) { return s; } } return null; }
table.column("BusID"); for (Bus b : busses) { ServerRegistry reg = b.getExtension(ServerRegistry.class); List<Server> servers = reg.getServers(); for (Server serv : servers) { String qname = serv.getEndpoint().getEndpointInfo().getName().getLocalPart(); String started = serv.isStarted() ? "Started" : "Stopped"; String address = serv.getEndpoint().getEndpointInfo().getAddress(); if (fullAddress) { address = toFullAddress(address); String busId = b.getId(); table.addRow().addContent(qname, started, address, busId);
@Override public void initialize(Bus bus) { List<Server> servers = new ArrayList<Server>(); ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class); servers.addAll(serverRegistry.getServers()); for (Iterator<Server> iter = servers.iterator(); iter.hasNext();) { Server server = (Server) iter.next(); ManagedApi mApi = new ManagedApi(bus, server.getEndpoint(), server); InstrumentationManager iMgr = bus.getExtension(InstrumentationManager.class); if (iMgr == null) { iMgr = new InstrumentationManagerImpl(bus); } ((InstrumentationManagerImpl)iMgr).setUsePlatformMBeanServer(true); ((InstrumentationManagerImpl)iMgr).setCreateMBServerConnectorFactory(false); ((InstrumentationManagerImpl)iMgr).setEnabled(true); ((InstrumentationManagerImpl)iMgr).init(); if (iMgr != null) { try { iMgr.register(mApi); } catch (JMException jmex) { jmex.printStackTrace(); LOG.log(Level.WARNING, "Registering ManagedApi failed.", jmex); } } } }
Bus b = ex.getBus(); if (b.getFeatures().contains(EventFeature.class)) { ai.setAsserted(true); return; .getExtension(ServerRegistry.class); List<Server> servers = registry.getServers(); if (MessageUtils.isOutbound(message)) { // RESP_OUT if ((appliesToType == AppliesToType.provider || appliesToType == AppliesToType.always)) { for (Server sr : servers) { EndpointInfo ei = sr.getEndpoint() .getEndpointInfo(); if (null != ei && ei.getAddress().equals( ep.getEndpointInfo() .getAddress())) { eventFeature.initialize(sr, b);
private void registerAvailableServers() { ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class); List<Server> servers = serverRegistry.getServers(); for (Server server : servers) { registerServer(server); } }
.getExtension(ServerRegistry.class) .getServers() .iterator() .next() .getEndpoint() .get(JAXRSServiceFactoryBean.class.getName())); final HTTPTransportFactory transportFactory = HTTPTransportFactory.class .cast(bus .getExtension(DestinationFactoryManager.class) .getDestinationFactory("http://cxf.apache.org/transports/http" + "/configuration")); registry = transportFactory.getRegistry();
private void stopServer() { ServerRegistry reg = serverBus.getExtension(ServerRegistry.class); List<Server> servers = reg.getServers(); for (Server serv : servers) { serv.stop(); } }
private void startServer() { ServerRegistry reg = serverBus.getExtension(ServerRegistry.class); List<Server> servers = reg.getServers(); for (Server serv : servers) { serv.start(); } }
public void start() { if (!stopped) { return; } LOG.fine("Server is starting."); bindingFactory.addListener(destination, endpoint); // register the active server to run if (null != serverRegistry) { LOG.fine("register the server to serverRegistry "); serverRegistry.register(this); } if (slcMgr == null) { slcMgr = bus.getExtension(ServerLifeCycleManager.class); if (slcMgr != null && mep != null) { slcMgr.registerListener(mep); } } if (slcMgr != null) { slcMgr.startServer(this); } stopped = false; }
/** * This determines if the service has already been published on the CXF bus. * * @return true if cxf server exists for this service. */ protected boolean isServicePublished(String serviceAddress) { ServerRegistry serverRegistry = getCXFServerRegistry(); List<Server> servers = serverRegistry.getServers(); for (Server server:servers){ String endpointAddress = server.getEndpoint().getEndpointInfo().getAddress(); if (endpointAddress.contains(serviceAddress)){ LOG.info("Service already published on CXF, not republishing: " + serviceAddress); return true; } } return false; }
ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class); servers.addAll(serverRegistry.getServers()); JettyHTTPDestination jhd = (JettyHTTPDestination)server.getDestination(); if (cxfBcComponent != null && !cxfBcComponent.isShowAllServices()
public void destroy() { stop(); // we should shutdown the destination here getDestination().shutdown(); if (null != serverRegistry) { LOG.fine("unregister the server to serverRegistry "); serverRegistry.unregister(this); } if (iMgr != null) { try { iMgr.unregister(mep); } catch (JMException jmex) { LOG.log(Level.WARNING, "Unregistering ManagedEndpoint failed.", jmex); } iMgr = null; } }
ServerRegistry registry = serverBus.getExtension(ServerRegistry.class); List<Server> servers = registry.getServers(); for (Server sr : servers) { EndpointInfo ei = sr.getEndpoint().getEndpointInfo(); if (null != ei && ei.getAddress().endsWith(server.getAddress())){ registry.unregister(sr); sr.destroy();
public Server getServerForService(QName serviceName) throws WSDLException { ServerRegistry svrMan = bus.getExtension(ServerRegistry.class); for (Server s : svrMan.getServers()) { Service svc = s.getEndpoint().getService(); if (svc.getName().equals(serviceName)) { return s; } } return null; }
table.column("BusID"); for (Bus b : busses) { ServerRegistry reg = b.getExtension(ServerRegistry.class); List<Server> servers = reg.getServers(); for (Server serv : servers) { String qname = serv.getEndpoint().getEndpointInfo().getName().getLocalPart(); String started = serv.isStarted() ? "Started" : "Stopped"; String address = serv.getEndpoint().getEndpointInfo().getAddress(); if (fullAddress) { address = toFullAddress(address); String busId = b.getId(); table.addRow().addContent(qname, started, address, busId);
List<Server> servers = new ArrayList<Server>(); ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class); servers.addAll(serverRegistry.getServers()); ManagedApi mApi = new ManagedApi(bus, server.getEndpoint(), server); ManagedEndpoint mEndpoint = new ManagedEndpoint(bus, server.getEndpoint(), server); InstrumentationManager iMgr = bus.getExtension(InstrumentationManager.class); if (iMgr == null) { iMgr = new InstrumentationManagerImpl(bus);
private void registerAvailableServers() { ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class); List<Server> servers = serverRegistry.getServers(); for (Server server : servers) { registerServer(server); } }
public void start() { if (!stopped) { return; } LOG.fine("Server is starting."); bindingFactory.addListener(destination, endpoint); // register the active server to run if (null != serverRegistry) { LOG.fine("register the server to serverRegistry "); serverRegistry.register(this); } if (slcMgr == null) { slcMgr = bus.getExtension(ServerLifeCycleManager.class); if (slcMgr != null && mep != null) { slcMgr.registerListener(mep); } } if (slcMgr != null) { slcMgr.startServer(this); } stopped = false; }