1 22 package org.jboss.test.asynch; 23 24 import org.jboss.aop.Dispatcher; 25 import org.jboss.aspects.asynch.AsynchRemoting; 26 import org.jboss.aspects.jmx.MBean; 27 import org.jboss.remoting.InvokerLocator; 28 29 import javax.naming.InitialContext ; 30 31 37 @MBean 38 public class Service 39 { 40 public void start() throws Exception 41 { 42 InitialContext ctx = new InitialContext (); 43 POJO pojo = new POJO(); 44 Dispatcher.singleton.registerTarget("pojo", pojo); 45 System.out.println("*** hello ***"); 46 47 ctx.rebind("pojo", AsynchRemoting.createRemoteProxy("pojo", POJO.class, new InvokerLocator("socket://localhost:5150"))); 48 } 49 50 public void stop() 51 { 52 System.out.println("**** STOP ***"); 53 Dispatcher.singleton.unregisterTarget("pojo"); 54 } 55 } 56 | Popular Tags |