Refine search
/** * Obtain handler chain from annotations. * @param server * */ private void buildHandlerChain(Server server) { AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder(); @SuppressWarnings("rawtypes") List<Handler> chain = new ArrayList<>(handlers); chain.addAll(builder.buildHandlerChainFromClass(getServiceBeanClass(), server.getEndpoint().getEndpointInfo().getName(), server.getEndpoint().getService().getName(), this.getBindingId())); for (Handler<?> h : chain) { injectResources(h); } ((JaxWsEndpointImpl)server.getEndpoint()).getJaxwsBinding().setHandlerChain(chain); }
@BeforeClass public static void initialize() throws Exception { dateFormatStr = "yyyy-MM-dd"; System.setProperty("org.jbpm.event.emitters.elasticsearch.date_format", dateFormatStr); FakeElasticSearchRESTApplication application = new FakeElasticSearchRESTApplication(responseCollector); RuntimeDelegate delegate = RuntimeDelegate.getInstance(); JAXRSServerFactoryBean bean = delegate.createEndpoint(application, JAXRSServerFactoryBean.class); String url = "http://localhost:9998" + bean.getAddress(); bean.setAddress(url); server = bean.create(); server.start(); System.setProperty("org.jbpm.event.emitters.elasticsearch.url", url); }
@Override public Object execute() throws Exception { Bus b = getBus(busName); ServerRegistry reg = b.getExtension(ServerRegistry.class); List<Server> servers = reg.getServers(); for (Server serv : servers) { if (endpoint.equals(serv.getEndpoint().getEndpointInfo().getName().getLocalPart())) { serv.start(); } } return null; } }
definition = new ServiceWSDLBuilder(getBus(), server.getEndpoint().getService().getServiceInfos() .iterator().next()).build(); EndpointInfo ei = server.getEndpoint().getService().getServiceInfos().iterator().next() .getEndpoints().iterator().next(); for (ServiceInfo serviceInfo : server.getEndpoint().getService().getServiceInfos()) { if (serviceInfo.getName().equals(service) && getEndpoint() != null && serviceInfo.getEndpoint(new QName(serviceInfo.getName().getNamespaceURI(), getEndpoint())) != null) { ei = serviceInfo.getEndpoint(new QName(serviceInfo.getName().getNamespaceURI(), schemaUtil.getSchemas(definition, serInfo); serInfo = ei.getService(); List<ServiceInfo> serviceInfos = new ArrayList<ServiceInfo>(); serviceInfos.add(serInfo);
private static boolean portNameMatches(Server s, String portName) { boolean ret = false; if (null == portName || portName.equals(s.getEndpoint().getEndpointInfo().getName().getLocalPart())) { return true; } return ret; }
protected boolean shouldSoapActionHeader() { // Only add soap headers if we can validate the bindings. if not, cxf will throw a fault in SoapActionInInterceptor // we cannot validate the bindings if we're using mule's pass-through invoke proxy service boolean isGenericProxy = "http://support.cxf.module.mule.org/" .equals(getServer().getEndpoint().getService().getName().getNamespaceURI()) && "ProxyService".equals(getServer().getEndpoint().getService().getName().getLocalPart()); return !isGenericProxy; }
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; }
public Server getServerForService(QName serviceName) throws WSDLException { ServerRegistry svrMan = bus.getExtension(ServerRegistry.class); for (Server s : svrMan.getServers()) { Service svc = s.getEndpoint().getService(); if (svc.getName().equals(serviceName)) { return s; } } return null; }
public void startServer(Server server) { org.apache.cxf.endpoint.Endpoint endpoint = server.getEndpoint(); updateMap(startNotificationMap, endpoint.getEndpointInfo().getAddress()); String portName = endpoint.getEndpointInfo().getName().getLocalPart(); if ("SoapPort".equals(portName)) { List<Feature> active = endpoint.getActiveFeatures(); assertNotNull(active); assertEquals(1, active.size()); assertTrue(active.get(0) instanceof WSAddressingFeature); assertSame(active.get(0), AbstractFeature.getActive(active, WSAddressingFeature.class)); } else { List<Feature> active = endpoint.getActiveFeatures(); assertNotNull(active); assertEquals(0, active.size()); assertNull(AbstractFeature.getActive(active, WSAddressingFeature.class)); } } public void stopServer(Server server) {
public void startServer(Server serv) { if (serv.getEndpoint().getBinding() instanceof SoapBinding) { QName qn = serv.getEndpoint().getService().getName(); if (!"http://mex.ws.cxf.apache.org/".equals(qn.getNamespaceURI())) { serv.getEndpoint().getInInterceptors().add(new MEXInInterceptor(serv)); } } }
private boolean isWsDiscoveryServer(Server server) { QName sn = ServiceModelUtil.getServiceQName(server.getEndpoint().getEndpointInfo()); return WS_DISCOVERY_SERVICE_NS.equals(sn.getNamespaceURI()); }
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; }
public Server getServerForAddress(String address) throws WSDLException { ServerRegistry svrMan = bus.getExtension(ServerRegistry.class); for (Server s : svrMan.getServers()) { if (address.equals(s.getEndpoint().getEndpointInfo().getAddress())) { return s; } } return null; }
protected void calculateDefaultBasePath(Server server) { if (getBasePath() == null || getBasePath().length() == 0) { String address = server.getEndpoint().getEndpointInfo().getAddress(); setBasePathByAddress(address); } }
@ManagedOperation public void start() { if (state == State.STARTED) { return; } ServerLifeCycleManager mgr = bus.getExtension(ServerLifeCycleManager.class); if (mgr != null) { mgr.registerListener(this); } server.start(); }
boolean isSecured = false; EndpointInfo ei = server.getEndpoint().getEndpointInfo(); PolicyEngine pe = bus.getExtension(PolicyEngine.class); if (null == pe) { LOG.finest("No Policy engine found"); Destination destination = server.getDestination(); EndpointPolicy ep = pe.getServerEndpointPolicy(ei, destination, null); Collection<Assertion> assertions = ep.getChosenAlternative();
removeInterceptorWhichIsOutThePhases(server.getEndpoint().getService().getInInterceptors(), REMAINING_IN_PHASES, getInInterceptorNames()); removeInterceptorWhichIsOutThePhases(server.getEndpoint().getInInterceptors(), REMAINING_IN_PHASES, getInInterceptorNames()); server.getEndpoint().getBinding().getInInterceptors().clear(); removeInterceptorWhichIsOutThePhases(server.getEndpoint().getService().getOutInterceptors(), REMAINING_OUT_PHASES, getOutInterceptorNames()); removeInterceptorWhichIsOutThePhases(server.getEndpoint().getOutInterceptors(), REMAINING_OUT_PHASES, getOutInterceptorNames()); server.getEndpoint().getBinding().getOutInterceptors().clear(); server.getEndpoint().getOutInterceptors().add(new RawMessageContentRedirectInterceptor()); server.getEndpoint().getInInterceptors().add(RawMessageWSDLGetInterceptor.INSTANCE); for (Interceptor<? extends Message> i : server.getEndpoint().getService().getInInterceptors()) { if (i.getClass().getName().equals("org.apache.cxf.interceptor.OutgoingChainInterceptor")) { toRemove = i; server.getEndpoint().getService().getInInterceptors().remove(toRemove); server.getEndpoint().getInInterceptors().add(new OneWayOutgoingChainInterceptor()); server.getEndpoint().getInInterceptors().add(new OneWayProcessorInterceptor());
private void deregisterServants(Bus aBus) { synchronized (servantsCache) { for (Server servant : servantsCache) { //REVISIT: seems using server.stop() doesn't release resource properly. servant.destroy(); LOG.info("Shutdown the EJB Endpoint: " + servant.getEndpoint().getEndpointInfo().getName()); } servantsCache.clear(); } }
/** * Return a WSDL definition model for a server. * * @param server the server. * @return the definition. * @throws WSDLException */ public Definition getWSDLDefinition(Server server) throws WSDLException { Service service = server.getEndpoint().getService(); ServiceWSDLBuilder wsdlBuilder = new ServiceWSDLBuilder(bus, service.getServiceInfos().get(0)); wsdlBuilder.setUseSchemaImports(false); return wsdlBuilder.build(); }