[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>&nbsp;</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>&nbsp;</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>&nbsp;&nbsp; 
Integer lOneMinuteTimer = (Integer) 
lServer.invoke(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
lTimer.getObjectName(),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"addNotification",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new Object[] { 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"IDoNotKnowWhatTypeIs",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "I 
call you with this timer 
once",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // No user 
object<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
null,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // In one minute from 
now<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
lNext,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
new String[] {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"".getClass().getName(),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"".getClass().getName(),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"java.lang.Object",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Date.class.getName()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; 
);<BR>-------------------------------------------------------------------------<BR>lServer.addNotificationListener(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 lTimer.getObjectName(),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Notification 
Listener<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new NotificationListener() 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void 
handleNotification(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 Notification 
pNotification,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Object pHandback <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Add 
here you call any code or application or perform whatever you want 
to<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
System.out.println( "You got a Notification: " + pNotification 
);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 
Filter Listener<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new NotificationFilter() 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public boolean 
isNotificationEnabled( Notification pNotification ) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( 
pNotification instanceof TimerNotification ) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 TimerNotification lTimerNotification = (TimerNotification) 
pNotification;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 return lTimerNotification.getNotificationID().equals( mTimerId 
);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 
false;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // No 
object handback necessary<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; null<BR>&nbsp;&nbsp; 
);<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