Search in sources :

Example 61 with ServiceInfo

use of org.apache.cxf.service.model.ServiceInfo in project cxf by apache.

the class ApplicationContextTest method getEndpointInfo.

private EndpointInfo getEndpointInfo(String serviceNS, String endpointLocal, String address) {
    ServiceInfo serviceInfo2 = new ServiceInfo();
    serviceInfo2.setName(new QName(serviceNS, "Service"));
    EndpointInfo info2 = new EndpointInfo(serviceInfo2, "");
    info2.setName(new QName("urn:test:ns", endpointLocal));
    info2.setAddress(address);
    return info2;
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) QName(javax.xml.namespace.QName)

Example 62 with ServiceInfo

use of org.apache.cxf.service.model.ServiceInfo in project cxf by apache.

the class NettyHttpConduitFactoryTest method testShutdownEventLoopGroup.

@Test
public void testShutdownEventLoopGroup() throws Exception {
    bus = BusFactory.getDefaultBus(true);
    assertNotNull("Cannot get bus", bus);
    // Make sure we got the Transport Factory.
    NettyHttpTransportFactory factory = bus.getExtension(NettyHttpTransportFactory.class);
    assertNotNull("Cannot get NettyHttpTransportFactory", factory);
    ServiceInfo serviceInfo = new ServiceInfo();
    serviceInfo.setName(new QName("bla", "Service"));
    EndpointInfo ei = new EndpointInfo(serviceInfo, "");
    ei.setName(new QName("bla", "Port"));
    ei.setAddress("netty://foo");
    // The EventLoopGroup is put into bus when create a new netty http conduit
    factory.getConduit(ei, null, bus);
    bus.shutdown(true);
    EventLoopGroup eventLoopGroup = bus.getExtension(EventLoopGroup.class);
    assertNotNull("We should find the EventLoopGroup here.", eventLoopGroup);
    assertTrue("The eventLoopGroup should be shutdown.", eventLoopGroup.isShutdown());
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) EventLoopGroup(io.netty.channel.EventLoopGroup) QName(javax.xml.namespace.QName) Test(org.junit.Test)

Example 63 with ServiceInfo

use of org.apache.cxf.service.model.ServiceInfo in project cxf by apache.

the class RMEndpoint method createEndpoint.

void createEndpoint(org.apache.cxf.transport.Destination d, ProtocolVariation protocol) {
    final QName bindingQName = new QName(protocol.getWSRMNamespace(), BINDING_NAME);
    WrappedService service = services.get(protocol);
    ServiceInfo si = service.getServiceInfo();
    buildBindingInfo(si, protocol);
    EndpointInfo aei = applicationEndpoint.getEndpointInfo();
    String transportId = aei.getTransportId();
    EndpointInfo ei = new EndpointInfo(si, transportId);
    if (d != null) {
        ei.setProperty(MAPAggregator.DECOUPLED_DESTINATION, d);
    }
    ei.setAddress(aei.getAddress());
    ei.setName(RMUtils.getConstants(protocol.getWSRMNamespace()).getPortName());
    ei.setBinding(si.getBinding(bindingQName));
    // if addressing was enabled on the application endpoint by means
    // of the UsingAddressing element extensor, use this for the
    // RM endpoint also
    Object ua = getUsingAddressing(aei);
    if (null != ua) {
        ei.addExtensor(ua);
    }
    si.addEndpoint(ei);
    ei.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);
    Endpoint endpoint = new WrappedEndpoint(applicationEndpoint, ei, service);
    if (applicationEndpoint.getEndpointInfo() != null && applicationEndpoint.getEndpointInfo().getProperties() != null) {
        for (String key : applicationEndpoint.getEndpointInfo().getProperties().keySet()) {
            endpoint.getEndpointInfo().setProperty(key, applicationEndpoint.getEndpointInfo().getProperty(key));
        }
    }
    service.setEndpoint(endpoint);
    endpoints.put(protocol, endpoint);
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) Endpoint(org.apache.cxf.endpoint.Endpoint) QName(javax.xml.namespace.QName)

Example 64 with ServiceInfo

use of org.apache.cxf.service.model.ServiceInfo in project cxf by apache.

the class JAXWSFrontEndProcessor method process.

@SuppressWarnings("unchecked")
public void process() throws ToolException {
    checkJaxwsClass();
    List<ServiceInfo> services = (List<ServiceInfo>) context.get(ToolConstants.SERVICE_LIST);
    ServiceInfo serviceInfo = services.get(0);
    JavaInterface jinf = JavaFirstUtil.serviceInfo2JavaInf(serviceInfo);
    String className = (String) context.get(ToolConstants.IMPL_CLASS);
    if (className != null && className.equals(jinf.getFullClassName())) {
        jinf.setName(jinf.getName() + SEI_SUFFIX);
    }
    JavaModel jm = new JavaModel();
    jm.addInterface("inf", jinf);
    jinf.setJavaModel(jm);
    context.put(JavaModel.class, jm);
    context.put(ToolConstants.SERVICE_NAME, serviceInfo.getName());
    EndpointInfo endpointInfo = serviceInfo.getEndpoints().iterator().next();
    context.put(ToolConstants.PORT_NAME, endpointInfo.getName());
    generators.add(new JaxwsSEIGenerator());
    generators.add(new JaxwsImplGenerator());
    generators.add(new JaxwsServerGenerator());
    generators.add(new JaxwsClientGenerator());
    generators.add(new AntGenerator());
    for (AbstractGenerator generator : generators) {
        generator.generate(context);
    }
}
Also used : JavaInterface(org.apache.cxf.tools.common.model.JavaInterface) JaxwsServerGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsServerGenerator) AbstractGenerator(org.apache.cxf.tools.wsdlto.core.AbstractGenerator) JaxwsImplGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsImplGenerator) JaxwsClientGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsClientGenerator) ServiceInfo(org.apache.cxf.service.model.ServiceInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) JaxwsSEIGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsSEIGenerator) JavaModel(org.apache.cxf.tools.common.model.JavaModel) ArrayList(java.util.ArrayList) List(java.util.List) AntGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.AntGenerator)

Example 65 with ServiceInfo

use of org.apache.cxf.service.model.ServiceInfo in project cxf by apache.

the class SimpleFrontEndProcessor method process.

@SuppressWarnings("unchecked")
public void process() throws ToolException {
    List<ServiceInfo> services = (List<ServiceInfo>) context.get(ToolConstants.SERVICE_LIST);
    ServiceInfo serviceInfo = services.get(0);
    JavaInterface jinf = JavaFirstUtil.serviceInfo2JavaInf(serviceInfo);
    JavaModel jm = new JavaModel();
    jm.addInterface("inf", jinf);
    jinf.setJavaModel(jm);
    context.put(JavaModel.class, jm);
    generators.add(new SimpleSEIGenerator());
    generators.add(new SimpleImplGenerator());
    generators.add(new SimpleServerGenerator());
    generators.add(new SimpleClientGenerator());
    generators.add(new AntGenerator());
    for (AbstractGenerator generator : generators) {
        generator.generate(context);
    }
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) SimpleSEIGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleSEIGenerator) SimpleImplGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleImplGenerator) SimpleClientGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleClientGenerator) JavaInterface(org.apache.cxf.tools.common.model.JavaInterface) SimpleServerGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleServerGenerator) JavaModel(org.apache.cxf.tools.common.model.JavaModel) AbstractGenerator(org.apache.cxf.tools.wsdlto.core.AbstractGenerator) ArrayList(java.util.ArrayList) List(java.util.List) AntGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.AntGenerator)

Aggregations

ServiceInfo (org.apache.cxf.service.model.ServiceInfo)195 QName (javax.xml.namespace.QName)89 Test (org.junit.Test)76 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)63 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)47 BindingInfo (org.apache.cxf.service.model.BindingInfo)43 OperationInfo (org.apache.cxf.service.model.OperationInfo)37 InterfaceInfo (org.apache.cxf.service.model.InterfaceInfo)36 Service (org.apache.cxf.service.Service)33 Endpoint (org.apache.cxf.endpoint.Endpoint)31 MessagePartInfo (org.apache.cxf.service.model.MessagePartInfo)29 File (java.io.File)28 ArrayList (java.util.ArrayList)27 Bus (org.apache.cxf.Bus)26 InputStream (java.io.InputStream)23 Definition (javax.wsdl.Definition)20 Method (java.lang.reflect.Method)16 SchemaCollection (org.apache.cxf.common.xmlschema.SchemaCollection)15 HTTPTransportFactory (org.apache.cxf.transport.http.HTTPTransportFactory)15 IOException (java.io.IOException)12