Thanks for the reply.
Further questions inside.

Annegret

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Julien Viet
Sent: Donnerstag, 11. März 2004 12:17
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] MBean questions


On Mar 11, 2004, at 11:42 AM, Sternagel Annegret (MPI/ADB) wrote:

> Hello,
>
> I have 2 questions about MBeans:
>
> We have an MBean that looks every 30 seconds in the database if there 
> is an action to perform.
> If there is an entry for an action, the action will be performed, this 
> may take several minutes.
> Maybe there are a lot of action entries in the database which should 
> be performed sequential.
>
> 1. If we use the javax.management.timer.Timer and register for 
> notification every 30 seconds, what happens if a notification occures 
> and the MBean is still busy performing one action ?
> Is the notification scipped ? (would be ok)
> Are the notifications waiting ? (up to an overflow ?)
>

yes, if you want to avoid it you need to have a construct like :


       import EDU.oswego.cs.dl.util.concurrent.Mutex;
       private final Mutex mutex = new Mutex();
       public final void run()
       {
          try
          {
             if (mutex.attempt(0))
             {
                try
                {
                   execute();
                }
                finally
                {
                   mutex.release();
                }
             }
          }
          catch(InterruptedException ignore)
          {
          }
       }


=> Does this work for each MBean instance separately ?
=> What about "synchronize" ?

>
> 2. We would like to create several instances of this service on JBoss 
> startup, dependent on a configuration located in the database, and 
> maybe change it during runtime. These instances should look at 
> different specific action entries.
> Is it possible to create several MBean instances at runtime using the 
> JMX-interface ?
> What's the best way to provide the information to the MBean instance 
> which action entry each instance should look for ?
> E.g. write an AbcFactoryMBean that creates the MBean instances,
> add the action-information to the ServiceName
> or set a propery with the action-information ?
>

why not package the different instances as services in xxx-service.xml ?

=> I do not know at installation time how many instances I need. And it may change at 
runtime if further configuration is added.

> We use jboss 3.2.3.
>
> Any ideas appreciated.
>
> Annegret
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=ick
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to