此内容没有您所选择的语言版本。

16.2. Overview of Handlers and Handler Chains


Each endpoint config may be associated with PRE and POST handler chains. Each handler chain may include JAXWS-compliant handlers. For outbound messages, PRE handler chain handlers are executed before any handler attached to the endpoints using standard JAXWS means, such as the @HandlerChain annotation. POST handler chain handlers are executed after usual endpoint handlers. For inbound messages, the opposite applies. JAX-WS is a standard API for XML-based web services, and is documented at http://jcp.org/en/jsr/detail?id=224.
A handler chain may also include a protocol-bindings attribute, which sets the protocols which trigger the chain to start.
A JAXWS handler is a child element handler within a handler chain. The handler takes a class attribute, which is the fully-qualified classname of the handler class. When the endpoint is deployed, an instance of that class is created for each referencing deployment. Either the deployment class loader or the class loader for module org.jboss.as.webservices.server.integration must be able to load the handler class.

Procedure 16.1. How to add handler-chains and handlers via the CLI

  1. Start the JBoss EAP CLI
    EAP_HOME/bin/jboss-cli.sh
    
    Copy to Clipboard Toggle word wrap
  2. Add handler chain and handlers via JBoss CLI:

    Example 16.1. Add a handler chain

    [standalone@localhost:9999 /] /subsystem=webservices/endpoint-config=Standard-Endpoint-Config/post-handler-chain=my-handlers:add(protocol-bindings="##SOAP11_HTTP")
    Copy to Clipboard Toggle word wrap

    Example 16.2. Add a handler

    [standalone@localhost:9999 /] /subsystem=webservices/endpoint-config=Standard-Endpoint-Config/post-handler-chain=my-handlers/handler=foo-hander:add(class="org.jboss.ws.common.invocation.RecordingServerHandler")
    Copy to Clipboard Toggle word wrap

    Example 16.3. Add a handler

    [standalone@localhost:9999 /] /subsystem=webservices/endpoint-config=Standard-Endpoint-Config/post-handler-chain=my-handlers/handler=bar-handler:add(class="com.arjuna.webservices11.wsarj.handler.InstanceIdentifierInHandler")
    Copy to Clipboard Toggle word wrap
  3. Reload the server:
    [standalone@localhost:9999 /] reload
    Copy to Clipboard Toggle word wrap
  4. Confirm the handler-chain and handlers were added correctly:

    Example 16.4. Read a handler-chain

    [standalone@localhost:9999 /] /profile=default/subsystem=webservices/endpoint-config=Standard-Endpoint-Config/post-handler-chain=my-handlers:read-resource
    Copy to Clipboard Toggle word wrap

    Example 16.5. Read a handler

    [standalone@localhost:9999 /] /profile=default/subsystem=webservices/endpoint-config=Standard-Endpoint-Config/post-handler-chain=my-handlers/handler=bar-handler:read-resource
    Copy to Clipboard Toggle word wrap
The options used in the commands above can be modified as required to add or modify handlers.
The handlers available in JBoss EAP can be found in the API Documentation javadocs:
More information about handlers, handler-chains, endpoints and related issues can be also found in the JBoss EAP Development Guide available at https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/?version=6.4
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat