What's wrong with this example?

http://www.jboss.org/wiki/Wiki.jsp?page=ExampleHelloWorldService

To run an app as an mbean in jboss you just need:

Thread thread;


  | protected void startServce() throws Exception
  | {
  |    thread = new Thread(new Runnable()
  |    {
  |       public void run()
  |       {    
  |             try
  |             {
  |                 MyApp.main(new String[0]); // replace with command line args
  |             }
  |             catch (InterruptedException e)
  |             {
  |                 log.debug("Application interrupted", e);
  |             }
  |             catch (Throwable t)
  |             {
  |                 log.warn("Unexpected error in application", t);
  |             }
  |             thread = null;
  |       }
  |    }
  |    );
  |    thread.setDaemon(true);
  |    thread.start();
  | }
  | 
  | protected void stopService() throws Exception
  | {
  |    if (thread != null)
  |    {
  |       // Optionally interrupt the application
  |       thread.interrupt();
  |       // Optionally wait for it to finish
  |       thread.join();
  |    }
  | } 
  | 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3836760#3836760

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3836760



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to