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>

Attachment: Pop.sar
Description: Binary data

Reply via email to