use of org.apache.cxf.service.Service in project cxf by apache.
the class ColocOutInterceptor method isColocated.
protected Server isColocated(List<Server> servers, Endpoint endpoint, BindingOperationInfo boi) {
if (servers != null) {
Service senderService = endpoint.getService();
EndpointInfo senderEI = endpoint.getEndpointInfo();
for (Server s : servers) {
Endpoint receiverEndpoint = s.getEndpoint();
Service receiverService = receiverEndpoint.getService();
EndpointInfo receiverEI = receiverEndpoint.getEndpointInfo();
if (receiverService.getName().equals(senderService.getName()) && receiverEI.getName().equals(senderEI.getName())) {
// Check For Operation Match.
BindingOperationInfo receiverOI = receiverEI.getBinding().getOperation(boi.getName());
if (receiverOI != null && isCompatibleOperationInfo(boi, receiverOI)) {
return s;
}
}
}
}
return null;
}
use of org.apache.cxf.service.Service in project cxf by apache.
the class JAXRSServiceFactoryBean method create.
@Override
public Service create() {
sendEvent(Event.START_CREATE);
initializeServiceModel();
initializeDefaultInterceptors();
if (invoker != null) {
getService().setInvoker(getInvoker());
} else {
getService().setInvoker(createInvoker());
}
if (getExecutor() != null) {
getService().setExecutor(getExecutor());
}
if (getDataBinding() != null) {
getService().setDataBinding(getDataBinding());
}
Service serv = getService();
sendEvent(Event.END_CREATE, serv);
return serv;
}
use of org.apache.cxf.service.Service in project cxf by apache.
the class AbstractJAXRSFactoryBean method createEndpoint.
protected Endpoint createEndpoint() throws BusException, EndpointException {
Service service = serviceFactory.getService();
if (service == null) {
service = serviceFactory.create();
}
EndpointInfo ei = createEndpointInfo(service);
Endpoint ep = new EndpointImpl(getBus(), service, ei);
if (properties != null) {
ep.putAll(properties);
}
if (getInInterceptors() != null) {
ep.getInInterceptors().addAll(getInInterceptors());
}
if (getOutInterceptors() != null) {
ep.getOutInterceptors().addAll(getOutInterceptors());
}
if (getInFaultInterceptors() != null) {
ep.getInFaultInterceptors().addAll(getInFaultInterceptors());
}
if (getOutFaultInterceptors() != null) {
ep.getOutFaultInterceptors().addAll(getOutFaultInterceptors());
}
List<ClassResourceInfo> list = serviceFactory.getRealClassResourceInfo();
for (ClassResourceInfo cri : list) {
initializeAnnotationInterceptors(ep, cri.getServiceClass());
serviceFactory.sendEvent(FactoryBeanListener.Event.ENDPOINT_SELECTED, ei, ep, cri.getServiceClass(), null);
}
ep.put(JAXRSServiceFactoryBean.class.getName(), serviceFactory);
return ep;
}
use of org.apache.cxf.service.Service in project cxf by apache.
the class SimpleAuthorizingInterceptorTest method setUp.
@Before
public void setUp() throws Exception {
method = TestService.class.getMethod("echo", new Class[] {});
Exchange ex = setUpExchange();
Service service = EasyMock.createMock(Service.class);
ex.put(Service.class, service);
MethodDispatcher md = EasyMock.createMock(MethodDispatcher.class);
EasyMock.expect(service.get(MethodDispatcher.class.getName())).andReturn(md);
BindingOperationInfo boi = EasyMock.createMock(BindingOperationInfo.class);
ex.put(BindingOperationInfo.class, boi);
EasyMock.expect(md.getMethod(boi)).andReturn(method);
EasyMock.replay(service, md);
}
use of org.apache.cxf.service.Service in project cxf by apache.
the class CorbaBindingFactoryTest method setupServiceInfo.
protected void setupServiceInfo(String ns, String wsdl, String serviceName, String portName) {
URL wsdlUrl = getClass().getResource(wsdl);
assertNotNull(wsdlUrl);
WSDLServiceFactory f = new WSDLServiceFactory(bus, wsdlUrl.toString(), new QName(ns, serviceName));
Service service = f.create();
endpointInfo = service.getEndpointInfo(new QName(ns, portName));
}
Aggregations