1 16 17 package org.apache.axis.providers.java; 18 19 import org.apache.axis.Constants; 20 import org.apache.axis.Handler; 21 import org.apache.axis.MessageContext; 22 import org.apache.axis.components.logger.LogFactory; 23 import org.apache.commons.logging.Log; 24 25 import java.rmi.Naming ; 26 import java.rmi.RMISecurityManager ; 27 28 33 public class RMIProvider extends RPCProvider { 34 protected static Log log = 35 LogFactory.getLog(RMIProvider.class.getName()); 36 37 protected static Log entLog = 41 LogFactory.getLog(Constants.ENTERPRISE_LOG_CATEGORY); 42 43 public static final String OPTION_NAMING_LOOKUP = "NamingLookup"; 44 public static final String OPTION_INTERFACE_CLASSNAME = "InterfaceClassName"; 45 46 53 protected Object makeNewServiceObject(MessageContext msgContext, 54 String clsName) 55 throws Exception { 56 String namingLookup = getStrOption(OPTION_NAMING_LOOKUP, msgContext.getService()); 58 if (System.getSecurityManager() == null) { 59 System.setSecurityManager(new RMISecurityManager ()); 60 } 61 Object targetObject = Naming.lookup(namingLookup); 62 return targetObject; 63 } 64 65 69 protected String getServiceClassNameOptionName() { 70 return OPTION_INTERFACE_CLASSNAME; 71 } 72 73 83 protected String getStrOption(String optionName, Handler service) { 84 String value = null; 85 if (service != null) 86 value = (String ) service.getOption(optionName); 87 if (value == null) 88 value = (String ) getOption(optionName); 89 return value; 90 } 91 } 92 | Popular Tags |