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;
}
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());
}
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);
}
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);
}
}
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);
}
}
Aggregations