English 中文(简体)
执行多边开发银行 联合目录
原标题:Implementing MDB Pool Listener in JBoss JMS

我在博览会部署了多个多边开发银行,利用博览会执行,每个都配置不同的银团。 我期待着某种机制,我们能够在多边开发银行的每个组合规模上拥有一位听众,如果在任何时间利用多边开发银行的人才库,我们就可以加以检查。 这将有助于分析和配置每个多边开发银行的适当多边开发银行集合规模。

问题回答

We use Jamon to monitor instances of MDBs, like this:

    @MessageDriven
@TransactionManagement(value = TransactionManagementType.CONTAINER)
@TransactionAttribute(value = TransactionAttributeType.REQUIRED)
@ResourceAdapter("wmq.jmsra.rar")
@AspectDomain("YourDomainName")
public class YourMessageDrivenBean implements MessageListener
{
    // jamon package constant
    protected static final String WB_ONMESSAGE = "wb.onMessage";

    // instance counter
    private static AtomicInteger counter = new AtomicInteger(0);
    private int instanceIdentifier = 0;

    @Resource
    MessageDrivenContext ctx;

    @Override
    public void onMessage(Message message)
    {
        final Monitor monall = MonitorFactory.start(WB_ONMESSAGE);
        final Monitor mon = MonitorFactory.start(WB_ONMESSAGE + "." + toString()
                + "; mdb instance identifier=" + instanceIdentifier);

        try {
// process your  message here
            }

        } catch (final Exception x) {
            log.error("Error onMessage " + x.getMessage(), x);
            ctx.setRollbackOnly();
        } finally {
            monall.stop();
            mon.stop();
        }

    }

    @PostConstruct
    public void init()
    {
        instanceIdentifier = counter.incrementAndGet();
        log.debug("constructed instance #" + instanceIdentifier);
    }
}

之后,在马贡-蒙蒂尔,你可以看到多边开发银行的每一个创建者。





相关问题
Implementing SSO with SAML and JBoss

I want to implement SSO with SAML tokens in JBossAS. The scenario is as follows. I have 2 applications app1 and app2 running on 2 JBoss instances. Login into app1 and enter username / password ...

How do you efficiently repeat an action every x minutes?

I have an application that runs in JBoss. I have an incoming web service request that will update an ArrayList. I want to poll this list from another class every 60 seconds. What would be the most ...

jsp:how to hide folder structure of website from users?

how to hide folder structure of website from users. i have developed a website on jave platform (jsp). website is deployed on jboss. suppose my website s home page url is dummy.com/dummyFolder/...

JBoss Web Services Behind IIS Through HTTPs

This is a tangled web that s woven, I suppose, but it really shouldn t be all that hard. Let me see if I can paint the picture: I have written a web service, starting with a WSDL, which is to run in ...

Flex: image scale stopped working after deploy to server

I have some code to scale an image s width according to its height after the image is being loaded. It works fine on my development PC if I point to the wrapper html using local file system path. ...

How in jboss write traces to separate trace file

How in JBoss to write traces to separate file? I would like to see traces about org.hibernate.SQL and org.hibernate.type in separate trace file. I added next appender and categories to jboss-log4j....

热门标签