org.apache.cxf.endpoint.Server类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中org.apache.cxf.endpoint.Server类的一些代码示例,展示了Server类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server类的具体详情如下:
包路径:org.apache.cxf.endpoint.Server
类名称:Server

Server介绍

暂无

代码示例

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

/**
 * 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);
}

代码示例来源:origin: kiegroup/jbpm

@AfterClass
public static void destroy() throws Exception {
  if (server != null) {
    server.stop();
    server.destroy();
  }
  
  System.clearProperty("org.jbpm.event.emitters.elasticsearch.url");
}

代码示例来源:origin: kiegroup/jbpm

@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);
}

代码示例来源:origin: apache/cxf

@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;
  }
}

代码示例来源:origin: org.apache.servicemix/servicemix-cxf-se

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);

代码示例来源:origin: apache/cxf

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;
}

代码示例来源:origin: org.mule.modules/mule-module-cxf

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;
}

代码示例来源:origin: apache/cxf

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;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-core

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;
}

代码示例来源:origin: apache/cxf

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) {

代码示例来源:origin: apache/cxf

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

代码示例来源:origin: apache/cxf

private boolean isWsDiscoveryServer(Server server) {
  QName sn = ServiceModelUtil.getServiceQName(server.getEndpoint().getEndpointInfo());
  return WS_DISCOVERY_SERVICE_NS.equals(sn.getNamespaceURI());
}

代码示例来源:origin: apache/cxf

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;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-core

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;
}

代码示例来源:origin: apache/cxf

protected void calculateDefaultBasePath(Server server) {
  if (getBasePath() == null || getBasePath().length() == 0) {
    String address = server.getEndpoint().getEndpointInfo().getAddress();
    setBasePathByAddress(address);
  }
}

代码示例来源:origin: apache/cxf

@ManagedOperation
public void start() {
  if (state == State.STARTED) {
    return;
  }
  ServerLifeCycleManager mgr = bus.getExtension(ServerLifeCycleManager.class);
  if (mgr != null) {
    mgr.registerListener(this);
  }
  server.start();
}

代码示例来源:origin: org.talend.esb/locator

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

代码示例来源:origin: org.apache.camel/camel-cxf

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

代码示例来源:origin: apache/cxf

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

代码示例来源:origin: org.apache.cxf/cxf-testutils

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

相关文章

微信公众号

最新文章

更多