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
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
: 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
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
: [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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
19 matches
Mail list logo