1 6 7 package org.sapia.ubik.rmi.server; 8 9 import java.lang.reflect.Proxy ; 10 11 import org.sapia.ubik.rmi.Consts; 12 13 17 public class RmiUtils { 18 19 public static final String CODE_BASE = System.getProperty("java.rmi.server.codebase"); 20 21 public static final boolean MARSHALLING = (System.getProperty(Consts.MARSHALLING) != null) && 22 System.getProperty(Consts.MARSHALLING).equals("true"); 23 24 public static final boolean CODE_DOWNLOAD = (System.getProperty(Consts.ALLOW_CODE_DOWNLOAD) != null) && 25 System.getProperty(Consts.ALLOW_CODE_DOWNLOAD).equals("true"); 26 27 33 public static boolean isStub(Object o){ 34 return o instanceof Stub; 35 } 36 37 41 public static StubInvocationHandler getInvocationHandlerFor(Object stub){ 42 if(stub instanceof Stub && Proxy.isProxyClass(stub.getClass())){ 43 return (StubInvocationHandler)Proxy.getInvocationHandler(stub); 44 } 45 return null; 46 } 47 48 } 49 | Popular Tags |