use of org.apache.cxf.endpoint.Server in project cxf by apache.
the class ServerRegistryImpl method preShutdown.
@PreDestroy
public void preShutdown() {
// Shutdown the service.
// To avoid the CurrentModificationException, do not use serversList directly
Object[] servers = serversList.toArray();
for (int i = 0; i < servers.length; i++) {
Server server = (Server) servers[i];
server.destroy();
}
}
use of org.apache.cxf.endpoint.Server in project cxf by apache.
the class EndpointReferenceUtils method getMatchingMultiplexDestination.
private static MultiplexDestination getMatchingMultiplexDestination(QName serviceQName, String portName, Bus bus) {
MultiplexDestination destination = null;
ServerRegistry serverRegistry = bus.getExtension(ServerRegistry.class);
if (null != serverRegistry) {
List<Server> servers = serverRegistry.getServers();
for (Server s : servers) {
QName targetServiceQName = s.getEndpoint().getEndpointInfo().getService().getName();
if (serviceQName.equals(targetServiceQName) && portNameMatches(s, portName)) {
Destination dest = s.getDestination();
if (dest instanceof MultiplexDestination) {
destination = (MultiplexDestination) dest;
break;
}
}
}
} else {
LOG.log(Level.WARNING, "Failed to locate service matching " + serviceQName + ", because the bus ServerRegistry extension provider is null");
}
return destination;
}
use of org.apache.cxf.endpoint.Server in project cxf by apache.
the class ServerRegistryImpTest method testServerRegistryPreShutdown.
@Test
public void testServerRegistryPreShutdown() {
ServerRegistryImpl serverRegistryImpl = new ServerRegistryImpl();
Server server = new DummyServer(serverRegistryImpl);
server.start();
assertEquals("The serverList should have one service", serverRegistryImpl.serversList.size(), 1);
serverRegistryImpl.preShutdown();
assertEquals("The serverList should be clear ", serverRegistryImpl.serversList.size(), 0);
serverRegistryImpl.postShutdown();
assertEquals("The serverList should be clear ", serverRegistryImpl.serversList.size(), 0);
}
use of org.apache.cxf.endpoint.Server in project cxf by apache.
the class TypeCreationOptionsSpringTest method testMinOccurs.
@Test
public void testMinOccurs() throws Exception {
TestUtilities testUtilities = new TestUtilities(TypeCreationOptionsSpringTest.class);
testUtilities.setBus(getBean(Bus.class, "cxf"));
testUtilities.addDefaultNamespaces();
testUtilities.addNamespace("ts", "http://cxf.org.apache/service");
// {urn:org.apache.cxf.aegis}arrayService
Server s = testUtilities.getServerForService(new QName("urn:org.apache.cxf.aegis", "arrayService"));
Document wsdl = testUtilities.getWSDLDocument(s);
assertXPathEquals("//xsd:complexType[@name='ArrayOfInt']/" + "xsd:sequence/xsd:element[@name='int']/@minOccurs", "3", wsdl);
}
use of org.apache.cxf.endpoint.Server in project cxf by apache.
the class AnnotatedTypeTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
Server s = createService(AnnotatedService.class);
service = s.getEndpoint().getService();
databinding = (AegisDatabinding) service.getDataBinding();
tm = databinding.getAegisContext().getTypeMapping();
}
Aggregations