RE: [JBoss-user] mbean question

2003-09-25 Thread Adrian Brock
Message- > From: Andreas Mecky [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 25, 2003 3:20 AM > To: [EMAIL PROTECTED] > Subject: Re: [JBoss-user] mbean question > > > You must use setDaemon(true); > Now your thread is generated as a child process of your thread and

RE: [JBoss-user] mbean question

2003-09-25 Thread JD Brennan
I should have looked at the code first. You could A) make running a member variable and set it to false before calling interrupt(), or B) use "while (!interrupted())" instead of "while (running)" If you do A) you should wrap the set and check inside a synchronized block. One problem with B) i

RE: [JBoss-user] mbean question

2003-09-25 Thread JD Brennan
: Andreas Mecky [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 3:20 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] mbean question You must use setDaemon(true); Now your thread is generated as a child process of your thread and can be stopped by the JVM. Default is false and then the

Re: [JBoss-user] mbean question

2003-09-25 Thread Adrian Brock
private void sleep(long howlong) throws InterruptedException { Thread.sleep(howLong); } public void run() { try { ... } catch (InterruptedException e) { System.out.println("I am stopped"); } } Checking the running flag is better if a thread can be interrupted for

RE: [JBoss-user] mbean question

2003-09-25 Thread Danny . Yates
: [JBoss-user] mbean question You must use setDaemon(true); Now your thread is generated as a child process of your thread and can be stopped by the JVM. Default is false and then the thread just lives on. HTH Andreas - Original Message - From: <[EMAIL PROTECTED]> To: "jboss m

Re: [JBoss-user] mbean question

2003-09-25 Thread Andreas Mecky
You must use setDaemon(true); Now your thread is generated as a child process of your thread and can be stopped by the JVM. Default is false and then the thread just lives on. HTH Andreas - Original Message - From: <[EMAIL PROTECTED]> To: "jboss mailing list " <[EMAIL PROTECTED]> Sent: T

RE: [JBoss-user] mbean question

2003-09-25 Thread Stephane Nicoll
Don't use thread inside MBean for periodic tasks. Write your MBean with your business method and use the MBean Scheduler provided by JBoss to invoke it when you need to (every 60 secs for instance) In your method you can specify a way to interrupt it if needed (if you are looping on some files for

RE: [JBoss-user] mbean question

2003-09-25 Thread Danny . Yates
Where do you set running = false? Change running to a member (and probably mark it 'volatile' too) and then set it to false in stopService(). -- Danny Yates -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 25 September 2003 09:09 To: jboss mailing list Subj

Re: [JBoss-user] mbean question

2003-09-25 Thread Martin Vilcans
Change running to an instance variable and set it to false in stopService(). Simply interrupting the thread is not enough as it only interrupts the Thread.sleep call. Check the documentation for Thread.interrupt and InterruptedException for clarification. Declare running as volatile just in cas

Re: [JBoss-user] MBean Question

2002-11-05 Thread Greg Turner
Thanks.  But that was not the question.  The question was whether or not XMBean had to be in same package as X.  The answer turns out to be yes, but the manual from the advanced training says no.  The incorrect info in the manual was the source of my confusion. Scott M Stark wrote: Its th

Re: [JBoss-user] MBean Question

2002-11-05 Thread Scott M Stark
Its the definition of how JMX standard mbeans are identified. Its a pure naming convention that requires there be an interface XMbean for class X. Scott Stark Chief Technology Officer JBoss Group, LLC - Original Message - From: "Greg Tur

RE: [JBoss-user] MBean Question

2002-11-04 Thread James Higginbotham
Title: Message  >  Oh well, perhaps this could be thought of as a flaw in JMX spec.  Agreed. I'd even consider the entire lack of the service lifecycle API that jboss provides as a big flaw in the JMX spec.It just makes sense to offer lifecycle support to any good framework, esp management AP

Re: [JBoss-user] MBean Question

2002-11-04 Thread Greg Turner
ent: Monday, November 04, 2002 11:40 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] MBean Question Thanks James, I skimmed the spec and could not find any specs on the package of the interface. Furthermore, the manual from the adanced JBoss training has a diagram of a sar file that shows

RE: [JBoss-user] MBean Question

2002-11-04 Thread James Higginbotham
HTH, James -Original Message- From: Greg Turner [mailto:gturner@;tiburon-e-systems.com] Sent: Monday, November 04, 2002 11:40 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] MBean Question Thanks James, I skimmed the spec and could not find any specs on the package of the interface

Re: [JBoss-user] MBean Question

2002-11-04 Thread Greg Turner
Thanks James, I skimmed the spec and could not find any specs on the package of the interface. Furthermore, the manual from the adanced JBoss training has a diagram of a sar file that shows the MBean and its interface as being in different packages. Scott or Juha want to weigh in here ? Gre

RE: [JBoss-user] MBean Question

2002-11-04 Thread James Higginbotham
I believe the mbean spec from Sun requires the interface and impl to be in the same package, with a specific naming convention. Check the spec for details.. James -Original Message- From: Greg Turner [mailto:gturner@;tiburon-e-systems.com] Sent: Monday, November 04, 2002 10:21 AM To: [E

Re: [JBoss-user] MBean Question

2002-06-15 Thread David Jencks
The easy way is to either -- descend from ServiceMBeanSupport and call your method something other than start or startService -- not descend from ServiceMBeanSupport and call your method something other than start. The slightly more difficult way, which preserves the state checking behavior of S

Re: [JBoss-user] MBean Question

2002-06-14 Thread G.L. Grobe
Be careful when reading my advice as I'm in the middle of trying to understand MBeans myself ... but from what I understand ... if you extend from the ServiceMBean class which calls the init, start, stop, and destroy ... each one of these then calls that specific subclasses initService, startServi

RE: [JBoss-user] MBean Question

2002-06-14 Thread Starsinic, Frank
Title: RE: [JBoss-user] MBean Question you could have the startService method not do a whole lot. then in the JMX Interface have an addtional method called startServiceNoKidding() that really does the startup that you're looking for. then you just go to :8082 and click o