[prev in list] [next in list] [prev in thread] [next in thread]
List: jboss-user
Subject: [JBoss-user] Scheduler MBean Information
From: Thaer Hani Al-Ibaisi <thaer () integrant ! com ! jo>
Date: 2002-12-30 14:15:21
[Download RAW message or body]
Hi All,
About the scheduler in JBoss, I have searched the JBoss Forum, and found the
following link http://www.jboss.org/online-manual/HTML/ch13s58.html
<http://www.jboss.org/online-manual/HTML/ch13s58.html> talking about
Scheduler, but it is talking about some pieces of code without mentioning
where to put thise pieces of code (in which classes, what should be their
names.)
about the pieces of code here is some of them
-------------------------------------------------------------------
Date lNext = new Date( new Date().getTime() + Timer.ONE_MINUTE );
Integer lOneMinuteTimer = (Integer) lServer.invoke(
lTimer.getObjectName(),
"addNotification",
new Object[] {
"IDoNotKnowWhatTypeIs",
"I call you with this timer once",
// No user object
null,
// In one minute from now
lNext,
},
new String[] {
"".getClass().getName(),
"".getClass().getName(),
"java.lang.Object",
Date.class.getName()
}
);
-------------------------------------------------------------------------
lServer.addNotificationListener(
lTimer.getObjectName(),
// Notification Listener
new NotificationListener() {
public void handleNotification(
Notification pNotification,
Object pHandback
) {
// Add here you call any code or application or perform whatever
you want to
System.out.println( "You got a Notification: " + pNotification
);
}
},
// Filter Listener
new NotificationFilter() {
public boolean isNotificationEnabled( Notification pNotification )
{
if( pNotification instanceof TimerNotification ) {
TimerNotification lTimerNotification = (TimerNotification)
pNotification;
return lTimerNotification.getNotificationID().equals(
mTimerId );
}
return false;
}
},
// No object handback necessary
null
);
----------------------------------------------------------------------------
---
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1126" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Hi All,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>About the scheduler in JBoss, I have searched the
JBoss Forum, and found the following link <A
href="http://www.jboss.org/online-manual/HTML/ch13s58.html">http://www.jboss.org/online-manual/HTML/ch13s58.html</A> \
talking about Scheduler, but it is talking about some pieces of code without
mentioning where to put thise pieces of code (in which classes, what should be
their names.)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>about the pieces of code here is some of them
<BR>-------------------------------------------------------------------<BR>Date
lNext = new Date( new Date().getTime() + Timer.ONE_MINUTE );<BR>
Integer lOneMinuteTimer = (Integer)
lServer.invoke(<BR>
lTimer.getObjectName(),<BR>
"addNotification",<BR> new Object[] {
<BR>
"IDoNotKnowWhatTypeIs",<BR> "I
call you with this timer
once",<BR> // No user
object<BR>
null,<BR> // In one minute from
now<BR>
lNext,<BR> },<BR>
new String[] {<BR>
"".getClass().getName(),<BR>
"".getClass().getName(),<BR>
"java.lang.Object",<BR>
Date.class.getName()<BR> }<BR>
);<BR>-------------------------------------------------------------------------<BR>lServer.addNotificationListener(<BR> \
lTimer.getObjectName(),<BR> // Notification
Listener<BR> new NotificationListener()
{<BR> public void
handleNotification(<BR> \
Notification
pNotification,<BR>
Object pHandback <BR> )
{<BR> // Add
here you call any code or application or perform whatever you want
to<BR>
System.out.println( "You got a Notification: " + pNotification
);<BR>
}<BR> },<BR> //
Filter Listener<BR> new NotificationFilter()
{<BR> public boolean
isNotificationEnabled( Notification pNotification )
{<BR> if(
pNotification instanceof TimerNotification )
{<BR> \
TimerNotification lTimerNotification = (TimerNotification)
pNotification;<BR> \
return lTimerNotification.getNotificationID().equals( mTimerId
);<BR>
}<BR> return
false;<BR>
}<BR> },<BR> // No
object handback necessary<BR> null<BR>
);<BR>-------------------------------------------------------------------------------</FONT></DIV></BODY></HTML>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic