1 6 7 package org.jfox.ioc.connector.jrmp; 8 9 import java.rmi.RemoteException ; 10 import java.rmi.server.UnicastRemoteObject ; 11 12 import org.jfox.ioc.connector.AbstractConnectorRemote; 13 import org.jfox.ioc.connector.ServerNode; 14 15 18 19 public class JRMPConnectorRemote extends AbstractConnectorRemote { 20 21 protected void doInit() throws Exception { 22 try { 23 UnicastRemoteObject.unexportObject(this, true); 24 } 25 catch(Exception e) { 26 } 28 } 29 30 35 protected void doStart() throws Exception { 36 UnicastRemoteObject.exportObject(this,getPort()); 37 ServerNode.THE_NODE.registerConnector(getProtocol(),this); 39 40 Thread pingThread = new Thread (this, getName()); 42 pingThread.setPriority(Thread.MIN_PRIORITY); 43 pingThread.start(); 44 } 45 46 protected void doStop() throws Exception { 47 ServerNode.THE_NODE.removeConnector(getProtocol()); 48 UnicastRemoteObject.unexportObject(this, true); 49 } 50 51 public String getProtocol() throws RemoteException { 52 return "JRMP"; 53 } 54 55 protected void doDestroy() throws Exception { 56 try { 57 UnicastRemoteObject.unexportObject(this, true); 58 } 59 catch(Exception e) { 60 } 62 } 63 64 } 65 | Popular Tags |