Hi Adrian,

    Thank you.  I got to the point where my notification are all handled on
the server not on the client.
Here is what I have done:

public class JMXClient
 implements RMINotificationListener, Serializable
{
 .....

 public static void main(String[] args)
 {

  try
  {


   RMIAdaptor server = (RMIAdaptor)
    ctx.lookup("jmx/rmi/RMIAdaptor");

//Server will print "handling here", why?
ObjectName myObjectName = new
ObjectName("mercury.farming:service=FarmHandPoolService");
   server.addNotificationListener (myObjectName,
           new JMXClient(),
           null,
           null);

   Object[] params = new Object[] {};

   String[] signature = {};

   Thread.currentThread().sleep(5 * 1000);

//This causes one notification to be sent and server prints "Handling here"
   Object result =  server.invoke(myObjectName, "testNotification",
    params, signature);
   System.out.println("Result: " + result);

   Thread.currentThread().sleep(30 * 1000);
  }
  catch (Exception e)
  {
   e.printStackTrace();
  }
 }

 public void handleNotification(Notification notification, Object handback)
 {
  System.out.println("Handling here");
 }
}

Thanks!

Simone
----- Original Message ----- 
From: "Adrian Brock" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 24, 2003 10:48 AM
Subject: RE: [JBoss-user] JMX notifications


> What does "without luck" mean?
>
> Have you seen this (it applies to 2.4 but you
> be able to make it work).
> http://jboss.sourceforge.net/doc-24/ch11s39.html
>
> Regards,
> Adrian
>
> xxxxxxxxxxxxxxxxxxxxxxxx
> Adrian Brock
> Director of Support
> Back Office
> JBoss Group, LLC
> xxxxxxxxxxxxxxxxxxxxxxxx
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of
> > Simone Milani
> > Sent: 24 June 2003 09:36
> > To: [EMAIL PROTECTED]
> > Subject: Re: [JBoss-user] JMX notifications
> >
> >
> > Thanks!
> >
> > One more question if I can.  I wonder if is possible to have
> > notifications
> > sent to an external JVM.  I tried using the
> > RMINotificationListener but
> > witouth luck.
> >
> > Thanks
> >
> > Simone
> > ----- Original Message ----- 
> > From: "Adrian Brock" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, June 23, 2003 6:35 PM
> > Subject: RE: [JBoss-user] JMX notifications
> >
> >
> > >
> > http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jmx/src/m
> > ain/test/c
> > > ompliance/server/MBeanServerTEST.java?annotate=1.14.4.1
> > >
> > > Any of the testAddNotificationListener* tests
> > >
> > > Regards,
> > > Adrian
> > >
> > > xxxxxxxxxxxxxxxxxxxxxxxx
> > > Adrian Brock
> > > Director of Support
> > > Back Office
> > > JBoss Group, LLC
> > > xxxxxxxxxxxxxxxxxxxxxxxx
> > >
> > >
> > > > -----Original Message-----
> > > > From: [EMAIL PROTECTED]
> > > > [mailto:[EMAIL PROTECTED] On Behalf Of
> > > > Simone Milani
> > > > Sent: 23 June 2003 17:42
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [JBoss-user] JMX notifications
> > > >
> > > >
> > > > Hi,
> > > >
> > > >     Could please someone point me at some examples of
> > > > registering for JMX
> > > > notifications?
> > > >
> > > > Thanks!!!
> > > >
> > > > Simone
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.Net email is sponsored by: INetU
> > > > Attention Web Developers & Consultants: Become An INetU
> > > > Hosting Partner.
> > > > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly
> > > > Commission!
> > > > INetU Dedicated Managed Hosting
> > http://www.inetu.net/partner/index.php
> > > >
> > _______________________________________________
> > > > JBoss-user mailing list
> > > > [EMAIL PROTECTED]
> > > > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > > >
> > >
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by: INetU
> > > Attention Web Developers & Consultants: Become An INetU
> > Hosting Partner.
> > > Refer Dedicated Servers. We Manage Them. You Get 10%
> > Monthly Commission!
> > > INetU Dedicated Managed Hosting
> > http://www.inetu.net/partner/index.php
> > >
> > _______________________________________________
> > > JBoss-user mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/jboss-user
> > >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: INetU
> > Attention Web Developers & Consultants: Become An INetU
> > Hosting Partner.
> > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly
> > Commission!
> > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: INetU
> Attention Web Developers & Consultants: Become An INetU Hosting Partner.
> Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
> INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to