use of org.apache.cxf.endpoint.EndpointImpl in project cxf by apache.
the class ReflectionServiceFactoryBean method createEndpoint.
public Endpoint createEndpoint(EndpointInfo ei) throws EndpointException {
Endpoint ep = new EndpointImpl(getBus(), getService(), ei);
sendEvent(Event.ENDPOINT_CREATED, ei, ep, getServiceClass());
return ep;
}
use of org.apache.cxf.endpoint.EndpointImpl in project cxf by apache.
the class SimpleBatchSTSClient method createClient.
protected void createClient() throws BusException, EndpointException {
if (client != null) {
return;
}
bus.getExtension(Configurer.class).configureBean(name, this);
if (wsdlLocation != null) {
WSDLServiceFactory factory = new WSDLServiceFactory(bus, wsdlLocation, serviceName);
SourceDataBinding dataBinding = new SourceDataBinding();
factory.setDataBinding(dataBinding);
Service service = factory.create();
service.setDataBinding(dataBinding);
EndpointInfo ei = service.getEndpointInfo(endpointName);
Endpoint endpoint = new EndpointImpl(bus, service, ei);
client = new ClientImpl(bus, endpoint);
} else {
Endpoint endpoint = STSUtils.createSTSEndpoint(bus, namespace, null, location, soapVersion, policy, endpointName);
client = new ClientImpl(bus, endpoint);
}
client.getInFaultInterceptors().addAll(inFault);
client.getInInterceptors().addAll(in);
client.getOutInterceptors().addAll(out);
client.getOutFaultInterceptors().addAll(outFault);
in = null;
out = null;
inFault = null;
outFault = null;
if (features != null) {
for (AbstractFeature f : features) {
f.initialize(client, bus);
}
}
}
use of org.apache.cxf.endpoint.EndpointImpl in project fabric8 by jboss-fuse.
the class ManagedApiFeature method initializeProvider.
@Override
protected void initializeProvider(InterceptorProvider provider, final Bus bus) {
if (provider instanceof Endpoint) {
EndpointImpl endpointImpl = (EndpointImpl) provider;
List<Feature> features = endpointImpl.getActiveFeatures();
if (features == null) {
features = new ArrayList<Feature>();
features.add(this);
endpointImpl.initializeActiveFeatures(features);
} else {
features.add(this);
}
} else if (provider instanceof Bus) {
FactoryBeanListenerManager factoryBeanListenerManager = bus.getExtension(FactoryBeanListenerManager.class);
if (factoryBeanListenerManager == null) {
factoryBeanListenerManager = new FactoryBeanListenerManager(bus);
}
factoryBeanListenerManager.addListener(new FactoryBeanListener() {
@Override
public void handleEvent(Event arg0, AbstractServiceFactoryBean arg1, Object... arg2) {
if (arg0.equals(Event.SERVER_CREATED) && (arg2[0] instanceof Server)) {
Server server = (Server) arg2[0];
initialize(server, bus);
}
}
});
} else {
List<Feature> features = (List<Feature>) bus.getFeatures();
if (features == null) {
features = new ArrayList<Feature>();
features.add(this);
} else {
features.add(this);
}
}
}
use of org.apache.cxf.endpoint.EndpointImpl in project cxf by apache.
the class STSTokenOutInterceptorTest method prepareMessage.
private MessageImpl prepareMessage(Bus bus, STSClient stsClient, String serviceAddress) throws EndpointException {
MessageImpl message = new MessageImpl();
message.put(SecurityConstants.STS_CLIENT, stsClient);
message.put(Message.ENDPOINT_ADDRESS, serviceAddress);
Exchange exchange = new ExchangeImpl();
ServiceInfo si = new ServiceInfo();
Service s = new ServiceImpl(si);
EndpointInfo ei = new EndpointInfo();
Endpoint ep = new EndpointImpl(bus, s, ei);
ei.setBinding(new BindingInfo(si, null));
message.setExchange(exchange);
exchange.put(Endpoint.class, ep);
return message;
}
use of org.apache.cxf.endpoint.EndpointImpl in project cxf by apache.
the class TestBase method setUp.
@Before
public void setUp() throws Exception {
bus = BusFactory.newInstance().createBus();
BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
IMocksControl control = createNiceControl();
BindingFactory bf = control.createMock(BindingFactory.class);
Binding binding = control.createMock(Binding.class);
expect(bf.createBinding(null)).andStubReturn(binding);
expect(binding.getInFaultInterceptors()).andStubReturn(new ArrayList<Interceptor<? extends Message>>());
expect(binding.getOutFaultInterceptors()).andStubReturn(new ArrayList<Interceptor<? extends Message>>());
bfm.registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bf);
String ns = "http://apache.org/hello_world_soap_http";
WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass().getResource("/org/apache/cxf/jaxb/resources/wsdl/hello_world.wsdl").toString(), new QName(ns, "SOAPService"));
service = factory.create();
endpointInfo = service.getEndpointInfo(new QName(ns, "SoapPort"));
endpoint = new EndpointImpl(bus, service, endpointInfo);
JAXBDataBinding db = new JAXBDataBinding();
db.setContext(JAXBContext.newInstance(new Class[] { GreetMe.class, GreetMeResponse.class }));
service.setDataBinding(db);
operation = endpointInfo.getBinding().getOperation(new QName(ns, "greetMe"));
operation.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(GreetMe.class);
operation.getOperationInfo().getOutput().getMessagePartByIndex(0).setTypeClass(GreetMeResponse.class);
message = new MessageImpl();
Exchange exchange = new ExchangeImpl();
message.setExchange(exchange);
exchange.put(Service.class, service);
exchange.put(Endpoint.class, endpoint);
exchange.put(Binding.class, endpoint.getBinding());
}
Aggregations