【问题标题】:Creating Deploy Listener ESB in JBoss EAP 6.4在 JBoss EAP 6.4 中创建部署监听器 ESB
【发布时间】:2018-09-28 07:18:01
【问题描述】:

我们在 JBoss EAP 6.4 中部署了几个 switchyard jar。一切正常,但我们想创建一个事件侦听器以在应用程序部署后执行一些代码,在取消部署后执行一些其他代码,但真的我不知道从哪里开始。 这是我们的基本 switchyard.xml

    <?xml version="1.0" encoding="UTF-8"?>
<sy:switchyard xmlns:bean="urn:switchyard-component-bean:config:2.0" xmlns:resteasy="urn:switchyard-component-resteasy:config:2.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:sy="urn:switchyard-config:switchyard:2.0" name="esb-empty" targetNamespace="urn:it.empty.esb:esb-empty:1.0">
  <sca:composite name="esb-empty" targetNamespace="urn:it.empty.esb:esb-empty:1.0">
    <sca:component name="Component">
      <bean:implementation.bean class="it.empty.esb.service.EmptyServiceBean"/>
      <sca:service name="EmptyService">
        <sca:interface.java interface="it.empty.esb.service.EmptyService"/>
      </sca:service>
    </sca:component>
    <sca:service name="EmptyService" promote="Component/EmptyService">
      <sca:interface.java interface="it.empty.esb.service.EmptyService"/>
      <resteasy:binding.rest name="REST">
        <resteasy:contextMapper class="it.empty.esb.util.RestContextMapper"/>
        <resteasy:interfaces>it.empty.esb.service.EmptyResource</resteasy:interfaces>
        <resteasy:contextPath>esb-empty</resteasy:contextPath>
      </resteasy:binding.rest>
    </sca:service>
  </sca:composite>
    <sy:domain>
      <sy:properties>
        <sy:property name="org.switchyard.handlers.messageTrace.enabled" value="false"/>
      </sy:properties>
    </sy:domain>
</sy:switchyard>

我想要做的是自动实例化一个 org.springframework.context.annotation.AnnotationConfigApplicationContext 而不是在第一次休息呼叫期间手动实例化。 服务器上的每个 esb 管理一个不同的 AnnotationConfigApplicationContext,所以我认为事件监听器必须在每个 esb 中。

有可能吗?你能给我一些提示吗? 还需要其他信息吗?

【问题讨论】:

    标签: deployment listener jboss-eap-6 switchyard


    【解决方案1】:

    我认为您有几个选择,我不确定您在部署后和取消部署后要做什么,这是我认为最好的两个:

    • 将 SwitchYard 应用程序部署为 WAR 或 EAR,并使用依赖项来订购 SwitchYard 应用程序和部署后应用程序。我猜您甚至不必将 SwitchYard 应用程序部署为 WAR 或 EAR - 如果您制作 WAR 或 EAR 模块依赖于您的 switchyard 应用程序被加载以获得部署挂钩就足够了。

    • 最简单:使用您用来部署/取消部署的任何脚本,或您用来启动/停止 EAP 的任何脚本来做某事

    【讨论】:

    • 我正在尝试在部署完成后实例化一个 org.springframework.context.annotation.AnnotationConfigApplicationContext 并在取消部署期间将其销毁。实际上,我们在调用第一个 rest 服务时将其实例化,但我们希望使其更清洁并在部署完成时自动化该过程。
    猜你喜欢
    • 2023-04-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-12
    • 1970-01-01
    • 2015-12-12
    • 1970-01-01
    • 2019-02-17
    相关资源
    最近更新 更多