Jakarta ee 如何设置JMX通知侦听器?
这是一个后续行动 我想为取消部署事件配置JMX通知侦听器,但不知道如何正确设置mbean名称。我们目前正在使用JBoss4.2.3。以下尝试不会触发任何通知Jakarta ee 如何设置JMX通知侦听器?,jakarta-ee,jboss,jmx,Jakarta Ee,Jboss,Jmx,这是一个后续行动 我想为取消部署事件配置JMX通知侦听器,但不知道如何正确设置mbean名称。我们目前正在使用JBoss4.2.3。以下尝试不会触发任何通知 <mbean code="jboss.example.NotificationListener" name="jboss.example:name=NotificationListener"> <attribute name="SubscriptionList"> <s
<mbean code="jboss.example.NotificationListener"
name="jboss.example:name=NotificationListener">
<attribute name="SubscriptionList">
<subscription-list>
<mbean name="jboss.j2ee:service=EjbModule,type=jmx.attribute.change">
</mbean>
<notification type="JBOSS_MONITOR_NOTIFICATION"></notification>
</subscription-list>
</attribute>
</mbean>
我想最好能赶上第一场比赛,所以我想赶上:
2011-05-05 09:06:09,022 INFO [STDOUT] Got notification: javax.management.AttributeChangeNotification[source=jboss.j2ee:service=EjbModule,module=simple-mdb-ejb-1.0.0-SNAPSHOT.jar][type=jmx.attribute.change][message=EjbModule stopping], handback: null
有什么建议吗?使用JBoss NotificationListener示例并假设EJB3 MDB部署如下:
- 耳朵:myear.EAR
- JAR:myjar.JAR
- MDB名称:MyMDB
<server>
<mbean code="jboss.example.NotificationListener"
name="jboss.example:name=NotificationListener">
<attribute name="SubscriptionList">
<subscription-list>
<mbean name="jboss.j2ee:ear=myear.ear,jar=myjar.jar,service=EJB3,name=MyMDB" handback="MyMDB">
<notification type="jmx.attribute.change">
</mbean>
</subscription-list>
</attribute>
</mbean>
</server>
如果您只是在停止MDB时记录通知的toString,它将如下所示:
<server>
<mbean code="jboss.example.NotificationListener"
name="jboss.example:name=NotificationListener">
<attribute name="SubscriptionList">
<subscription-list>
<mbean name="jboss.j2ee:ear=myear.ear,jar=myjar.jar,service=EJB3,name=MyMDB" handback="MyMDB">
<notification type="jmx.attribute.change">
</mbean>
</subscription-list>
</attribute>
</mbean>
</server>
状态3(已启动)-->状态1(停止)
通知:
状态1(停止)-->状态0(停止)
通知:
使用示例JBoss NotificationListener并假设EJB3 MDB部署如下:
- 耳朵:myear.EAR
- JAR:myjar.JAR
- MDB名称:MyMDB
<server>
<mbean code="jboss.example.NotificationListener"
name="jboss.example:name=NotificationListener">
<attribute name="SubscriptionList">
<subscription-list>
<mbean name="jboss.j2ee:ear=myear.ear,jar=myjar.jar,service=EJB3,name=MyMDB" handback="MyMDB">
<notification type="jmx.attribute.change">
</mbean>
</subscription-list>
</attribute>
</mbean>
</server>
如果您只是在停止MDB时记录通知的toString,它将如下所示:
<server>
<mbean code="jboss.example.NotificationListener"
name="jboss.example:name=NotificationListener">
<attribute name="SubscriptionList">
<subscription-list>
<mbean name="jboss.j2ee:ear=myear.ear,jar=myjar.jar,service=EJB3,name=MyMDB" handback="MyMDB">
<notification type="jmx.attribute.change">
</mbean>
</subscription-list>
</attribute>
</mbean>
</server>
状态3(已启动)-->状态1(停止)
通知:
状态1(停止)-->状态0(停止)
通知:
你好,克里斯;您正在使用EJB2.x吗?我问这个问题是因为EJB2.xmdb管理接口比EJB3的要复杂一些,因为它在对象名中包含一个序列号,当我在日志摘录中看到这个时,它让我觉得您在EJB2:jndiName=local中/SimpleMessageEJB@30208588Oh,我使用了我在网上找到的一个示例项目。我会重构它。在实际项目中,我们使用EJB3;您正在使用EJB2.x吗?我问这个问题是因为EJB2.xmdb管理接口比EJB3的要复杂一些,因为它在对象名中包含一个序列号,当我在日志摘录中看到这个时,它让我觉得您在EJB2:jndiName=local中/SimpleMessageEJB@30208588Oh,我使用了我在网上找到的一个示例项目。我会重构它。在实际项目中,我们使用EJB3。谢谢。你的知识是从哪里来的?我搜索了几个小时,但没有找到订阅列表元素的唯一解释。谢谢。你的知识是从哪里来的?我搜索了几个小时,但没有找到订阅列表元素的唯一解释。