1 22 package org.jboss.test.recover.bean; 23 24 import org.jboss.aop.Dispatcher; 25 import org.jboss.aspects.remoting.Remoting; 26 import org.jboss.system.ServiceMBeanSupport; 27 import org.jboss.test.recover.interfaces.RemoteDummyRecoverable; 28 import org.jboss.tm.recovery.Recoverable; 29 30 36 public class RemoteDummyRecoverableFactory 37 extends ServiceMBeanSupport 38 implements RemoteDummyRecoverableFactoryMBean 39 { 40 public Recoverable create(String id) 41 throws Exception 42 { 43 try 44 { 45 Recoverable target = new RemoteDummyRecoverable(id); 46 47 Dispatcher.singleton.registerTarget("Recoverable/" + id, target); 48 Recoverable proxy = (Recoverable)Remoting.createRemoteProxy( 49 "Recoverable/" + id, 50 RemoteDummyRecoverable.class, 51 "socket://localhost:5150"); 52 return proxy; 53 } 54 catch (Throwable ex) 55 { 56 log.error("failed", ex); 57 throw new RuntimeException (ex.getMessage()); 58 } 59 } 60 } 61 | Popular Tags |