⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jbootstrap.java

📁 JAMPACK Grid programming
💻 JAVA
字号:
/**
 *
 * Program         : JBootStrap.java
 *
 * Author          : Vijayakrishnan Menon
 *
 * Date            : 20th Dec 2005
 *
 * Organization    : Centre for Excellence in 
 *						Computational Engineering and Networking (CEN),
 *                   		Amrita Viswa Vidyapeetham
 **/

package JAMPack;

/** This is a static class, of use both by the server side and the client side
  * componets. IT initialises the dynamic class loading feature by boot straping
  * such a class loader (It sets a codebase and a security manager. The policy
  * file has to be supplied  */

public class JBootStrap {

    public static Task getBootStrapedTask (String className) {
        Task clientObject = null ;
        
        try {
            Class type = java.rmi.server.RMIClassLoader.loadClass("", className);
            clientObject = (Task) (type.newInstance());
        }
        catch(java.net.MalformedURLException e) { e.printStackTrace(); }
        catch(java.lang.InstantiationException e) { e.printStackTrace(); }
        catch(java.lang.ClassNotFoundException e) { e.printStackTrace(); }
        catch(java.lang.IllegalAccessException e) { e.printStackTrace(); }
        
        return clientObject;
    }

    public static void setCodeBase() {
        try {     System.setProperty("java.rmi.server.codebase",
        		"http://"+java.net.InetAddress.getLocalHost().getHostAddress()+
        			":"+JEnvironment.WEB_PORT+"/"); }
        catch(java.net.UnknownHostException e) { e.printStackTrace(); }
    }

    public static void setSecurity(String policyFile) {
        System.setProperty("java.security.policy", policyFile);
        System.setSecurityManager(new java.rmi.RMISecurityManager());
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -