javax.xml.ws.Binding.setHandlerChain()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(114)

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

Binding.setHandlerChain介绍

[英]Sets the handler chain for the protocol binding instance.
[中]设置协议绑定实例的处理程序链。

代码示例

代码示例来源:origin: stackoverflow.com

final Binding binding = ((BindingProvider) servicePort).getBinding();
List<Handler> handlerList = binding.getHandlerChain();
if (handlerList == null)
  handlerList = new ArrayList<Handler>();

handlerList.add(new SecurityHandler());
binding.setHandlerChain(handlerList); // <- important!

代码示例来源:origin: stagemonitor/stagemonitor

@Advice.OnMethodExit
private static void setHandlerChain(@Advice.Return Object portOrDispatch) {
  if (portOrDispatch instanceof BindingProvider) {
    final Binding binding = ((BindingProvider) portOrDispatch).getBinding();
    final List<Handler> handlerChain = binding.getHandlerChain();
    if (handlerChain != null) {
      binding.setHandlerChain(handlerChain);
    } else {
      binding.setHandlerChain(new ArrayList<Handler>());
    }
  }
}

代码示例来源:origin: stackoverflow.com

// HandlerChain installieren
Binding binding = ((BindingProvider) port).getBinding();
List hchain = binding.getHandlerChain();
if (hchain == null) {
 hchain = new ArrayList();
}
hchain.add(new HTTPUserAgentHandler());
binding.setHandlerChain(hchain);

代码示例来源: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: org.apache.cxf/cxf-rt-frontend-jaxws

private void buildHandlerChain(JaxWsClientProxy cp) {
  AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder();
  JaxWsServiceFactoryBean sf = (JaxWsServiceFactoryBean)getServiceFactory();
  @SuppressWarnings("rawtypes")
  List<Handler> chain = new ArrayList<>(handlers);
  if (loadHandlers) {
    chain.addAll(builder.buildHandlerChainFromClass(sf.getServiceClass(),
                            sf.getEndpointInfo().getName(),
                            sf.getServiceQName(),
                            this.getBindingId()));
  }
  if (!chain.isEmpty()) {
    ResourceManager resourceManager = getBus().getExtension(ResourceManager.class);
    List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
    resourceManager = new DefaultResourceManager(resolvers);
    resourceManager.addResourceResolver(new WebServiceContextResourceResolver());
    ResourceInjector injector = new ResourceInjector(resourceManager);
    for (Handler<?> h : chain) {
      if (Proxy.isProxyClass(h.getClass()) && getServiceClass() != null) {
        injector.inject(h, getServiceClass());
        injector.construct(h, getServiceClass());
      } else {
        injector.inject(h);
        injector.construct(h);
      }
    }
  }
  cp.getBinding().setHandlerChain(chain);
}

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

jaxwsEndpoint.getJaxwsBinding().setHandlerChain(hc);
LOG.log(Level.FINE, "created proxy", obj);
if (portInfo == null) {

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

endpoint.getJaxwsBinding().setHandlerChain(hc);

代码示例来源:origin: stackoverflow.com

Endpoint endpoint = Endpoint.create(new MyWebService());
   Binding binding = endpoint.getBinding();
   List<Handler> handlerChain = new ArrayList<Handler>(1);
   handlerChain.add(new MyHandler());
   binding.setHandlerChain(handlerChain);
   URL url = new URL("http://localhost:7777/MyWebService");
   endpoint.publish(url.toString());

代码示例来源:origin: be.fedict.eid-idp/eid-idp-sp-protocol-saml2

protected void registerSoapHandler(SOAPHandler soapHandler) {
  BindingProvider bindingProvider = (BindingProvider) this.port;
  Binding binding = bindingProvider.getBinding();
  @SuppressWarnings("unchecked")
  List<Handler> handlerChain = binding.getHandlerChain();
  handlerChain.add(soapHandler);
  binding.setHandlerChain(handlerChain);
}

代码示例来源:origin: stackoverflow.com

ServerImplService service = new ServerImplService();
Server port = imgService.getServerImplPort();
/**********for tracing xml inbound and outbound******************************/
Binding binding = ((BindingProvider)port).getBinding();
List<Handler> handlerChain = binding.getHandlerChain();
handlerChain.add(new SOAPLoggingHandler());
binding.setHandlerChain(handlerChain);

代码示例来源:origin: stackoverflow.com

BindingProvider bindingProvider = (BindingProvider) eventPortType;      
final Binding binding = bindingProvider.getBinding();

List<Handler> handlerList = binding.getHandlerChain();
if (handlerList == null)
  handlerList = new ArrayList<Handler>();

handlerList.add(new ActionHandler());

binding.setHandlerChain(handlerList);

代码示例来源:origin: stackoverflow.com

ProcessEngineServiceProxy pewsServiceProxy = new ProcessEngineServiceProxy();
pewsServiceProxy._getDescriptor().setEndpoint(url);

// install the handler chain
BindingProvider bp = (BindingProvider) pewsServiceProxy._getDescriptor().getProxy();
Binding pewsBinding = bp.getBinding();
List<Handler> handlerChain = new java.util.ArrayList<Handler>();
PEWSClientHeaderHandler wsSecurity = new PEWSClientHeaderHandler();
handlerChain.add(wsSecurity);
pewsBinding.setHandlerChain(handlerChain);

代码示例来源:origin: be.e_contract.mycarenet/mycarenet-ehealth-etk

@SuppressWarnings("unchecked")
private void configureBindingProvider(BindingProvider bindingProvider,
    String location) {
  bindingProvider.getRequestContext().put(
      BindingProvider.ENDPOINT_ADDRESS_PROPERTY, location);
  Binding binding = bindingProvider.getBinding();
  @SuppressWarnings("rawtypes")
  List handlerChain = binding.getHandlerChain();
  handlerChain.add(new LoggingHandler());
  handlerChain.add(this.payloadLogicalHandler);
  binding.setHandlerChain(handlerChain);
}

代码示例来源:origin: be.fedict.eid-trust-service/eid-trust-service-client

/**
 * Registers the logging SOAP handler on the given JAX-WS port component.
 */
private void registerLoggerHandler(Object port) {
  BindingProvider bindingProvider = (BindingProvider) port;
  Binding binding = bindingProvider.getBinding();
  @SuppressWarnings("rawtypes")
  List<Handler> handlerChain = binding.getHandlerChain();
  handlerChain.add(new LoggingSoapHandler());
  binding.setHandlerChain(handlerChain);
}

代码示例来源:origin: be.fedict.eid-trust-service/eid-trust-service-client

private void registeredWSSecurityHandler(Object port) {
  BindingProvider bindingProvider = (BindingProvider) port;
  Binding binding = bindingProvider.getBinding();
  @SuppressWarnings("rawtypes")
  List<Handler> handlerChain = binding.getHandlerChain();
  this.wsSecurityClientHandler = new WSSecurityClientHandler();
  handlerChain.add(this.wsSecurityClientHandler);
  binding.setHandlerChain(handlerChain);
}

代码示例来源:origin: org.objectweb.celtix/celtix-rt

private <T> void createHandlerChainForBinding(Class<T> serviceEndpointInterface,
                       QName portName, Binding binding) {
  LOG.fine("loading handler chain for service");
  assert handlerResolver != null;
  PortInfoImpl portInfo = new PortInfoImpl(serviceName, portName, null);
  List<Handler> handlers = handlerResolver.getHandlerChain(portInfo);
  AnnotationHandlerChainBuilder handlerChainBuilder = new AnnotationHandlerChainBuilder();
  handlers = handlerChainBuilder.buildHandlerChainFor(serviceEndpointInterface, handlers);
  binding.setHandlerChain(handlers);
}

代码示例来源:origin: jenkinsci/coverity-plugin

/**
 * Attach an authentication handler to the web service, that uses the configured user and password
 */
private void attachAuthenticationHandler(BindingProvider service, CIMInstance cimInstance) {
  service.getBinding().setHandlerChain(Arrays.<Handler>asList(new ClientAuthenticationHandlerWSS(
      cimInstance.getCoverityUser(), cimInstance.getCoverityPassword())));
}

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

private void addHandlersProgrammatically(BindingProvider bp, Handler<?>...handlers) {
  @SuppressWarnings("rawtypes")
  List<Handler> handlerChain = bp.getBinding().getHandlerChain();
  assertNotNull(handlerChain);
  for (Handler<?> h : handlers) {
    handlerChain.add(h);
  }
  bp.getBinding().setHandlerChain(handlerChain);
}

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

public void addHandlersProgrammatically(BindingProvider bp, Handler<?>...handlers) {
  @SuppressWarnings("rawtypes")
  List<Handler> handlerChain = bp.getBinding().getHandlerChain();
  assertNotNull(handlerChain);
  for (Handler<?> h : handlers) {
    handlerChain.add(h);
  }
  bp.getBinding().setHandlerChain(handlerChain);
}

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

void addHandlersToChain(BindingProvider bp, Handler<?>... handlers) {
  @SuppressWarnings("rawtypes")
  List<Handler> handlerChain = bp.getBinding().getHandlerChain();
  assertNotNull(handlerChain);
  for (Handler<?> h : handlers) {
    handlerChain.add(h);
  }
  bp.getBinding().setHandlerChain(handlerChain);
}

相关文章