Hi all,
I am using JBoss-3.0.6 on Mac OS X (Tiger) with code below invoke for each
message received by SLSB
Integer eventId = (Integer)this.mBeanServer.invoke(
| this.timer.getObjectName(),
| "addNotification",
| new Object[] {
| "IDoNotKnowWhatTypeIs",
| "",
| null,
| new Date(new Date().getTime() + Timer.ONE_MINUTE),
| new Long(Timer.ONE_MINUTE),
| new Long(2)
| },
| new String[]{
| "".getClass().getName(),
| "".getClass().getName(),
| "java.lang.Object",
| Date.class.getName(),
| Long.TYPE.getName(),
| Long.TYPE.getName()
| }
|
| // Listener
| this.mbeanServer.addNotificationListener(
| this.timer.getObjectName(),
| new NotificationListener {
| private void handleNotification(Notification notification, Object
callback){
| TimerNotification timerNotification = (TimerNotification)notification;
| System.out.println("Event generated using event ID " +
timerNotification.getTimerID());
| }
| }
| )
|
|
| )
For each message a new timer and a new listener are added which produce 2
events each 1 minute apart.
It seems the events are not de-registerd since first time through I get
Event generated using event ID 1
Event generated using event ID 1
(so far so good)
Second message and
Event generated using event ID 1
Event generated using event ID 2
Event generated using event ID 1
Event generated using event ID 2
i.e the listener is still receiving events from event id 1 event though the
jmx-console only reports event 2 as active. Any ideas? Am I using the listener
correctly and any thoughts on the whole approach of creating new events and
listeners for each message time .. is this a robust strategy? The reason I am
doing this is because I need exactly 1 min delay for each message.
Regards
Lea.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3894425#3894425
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3894425
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user