我们在一个JBoss EAP6.4中部署了几个开关站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,而不是在第一个rest调用期间手动进行实例化。服务器上的每个esb都管理不同的AnnotationConfigApplicationContext,因此我认为事件侦听器必须位于每个esb中。
有可能吗?你能给我一些提示吗?还需要其他信息吗?
发布于 2018-09-29 02:27:27
我想你有几个选择,我不太确定你想做什么-部署后和后部署,以下是我认为最好的两个:
https://stackoverflow.com/questions/52550283
复制相似问题