I take that as a yes, then. Sacha, I was wondering why you mount your service as “jboss:service=…” are you not supposed to use “user:service=…”? Additionally I was wondering if the fact that we both have a class and an MBean interface is a JMX requirement – otherwise I would just not write the interface class (since it is rather trivial).

 

 

Yours truly,

 

Randahl

 

PS: Well then, I think I will bring the code to the pub next time…

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Sacha Labourey
Sent: 1. oktober 2002 23:38
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] Can MBeans have a Swing interface

 

try this thing in attachement... an old trick to impress ladies.

 

Cheers,

 

 

sacha

-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De la part de Randahl Fink Isaksen
Envoy� : mardi, 1 octobre 2002 16:45
� : [EMAIL PROTECTED]
Objet : [JBoss-user] Can MBeans have a Swing interface

I was thinking of creating a service MBean for monitoring certain parts of the server side of my application. Is it valid behavior of such an MBean to launch a Swing interface, say, in its startService() method (supposing it extends ServiceMBeanSupport)?

 

To find out, I created a simple MBean (see below) but unfortunately it makes JBoss hang when I try to shut down JBoss. I have added and removed the JFrame related code several times, and the result is always the same: With the JFrame code, JBoss hangs when shutting down.

 

Showing the JFrame is no problem – it pops up just like I wanted it.

 

Randahl

 

 

 

 

 

public class Server extends ServiceMBeanSupport implements ServerMBean {

            JFrame serverFrame;

 

            public void startService() {

                        serverFrame = new JFrame("Server");

                        serverFrame.show();

                        System.out.println("Server is started");

            }

           

            public void stopService() {

                        serverFrame.hide();

                        System.out.println("Server is stopped");

            }

}

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE server>

 

<server>

            <mbean code="dk.my.package.tree.Server" name="user:service=Test">

                        <depends>jboss:service=Naming</depends>

            </mbean>

</server>

Reply via email to