public ClassLoader getClassLoader(String codebase) throws MalformedURLException { return delegate.getClassLoader(codebase); }
@Override public Class<?> loadClass(String codebase, String name, ClassLoader defaultLoader) throws MalformedURLException, ClassNotFoundException { return _delegateLoaderSpi.loadClass(_remoteCodebase, name, defaultLoader); }
@Override public Class<?> loadProxyClass(String codebase, String[] interfaces, ClassLoader defaultLoader) throws MalformedURLException, ClassNotFoundException { return _delegateLoaderSpi.loadProxyClass(_remoteCodebase, interfaces, defaultLoader); }
public static String getClassAnnotation(Class<?> cl) { return defRMISpi.getClassAnnotation(cl); } }
public String getClassAnnotation(Class<?> cl) { String annotation = null; try { annotation = delegate.getClassAnnotation(cl); } catch(Throwable t) { // Try the java.rmi.server.codebase property annotation = System.getProperty("java.rmi.server.codebase"); } return annotation; } }
public ClassLoader getClassLoader(String codebase) throws MalformedURLException { return delegate.getClassLoader(codebase); }
@Override public Class<?> loadClass(String codebase, String name, ClassLoader defaultLoader) throws MalformedURLException, ClassNotFoundException { return _delegateLoaderSpi.loadClass(_remoteCodebase, name, defaultLoader); }
@Override public Class<?> loadProxyClass(String codebase, String[] interfaces, ClassLoader defaultLoader) throws MalformedURLException, ClassNotFoundException { return _delegateLoaderSpi.loadProxyClass(_remoteCodebase, interfaces, defaultLoader); }
public String getClassAnnotation(Class<?> cl) { String annotation = null; try { annotation = delegate.getClassAnnotation(cl); } catch(Throwable t) { // Try the java.rmi.server.codebase property annotation = System.getProperty("java.rmi.server.codebase"); } return annotation; } }
@Override public ClassLoader getClassLoader(String codebase) throws MalformedURLException { return _delegateLoaderSpi.getClassLoader(_remoteCodebase); }
/** * Loads a class from a codebase URL path, optionally using the supplied * loader. * @param codebase the list of URLs (separated by spaces) to load the class * from, or <code>null</code> * @param name the name of the class to load * @param defaultLoader additional contextual class loader to use, or * <code>null</code> * @return the <code>Class</code> object representing the loaded class * @throws MalformedURLException if <code>codebase</code> is non-<code>null</code> * and contains an invalid URL, or if <code>codebase</code> is * <code>null</code> and the system property * <code>java.rmi.server.codebase</code> contains an invalid URL * @throws ClassNotFoundException if a definition for the class could not be * found at the specified location */ public Class loadClass(String codebase, String name, ClassLoader defaultLoader) throws MalformedURLException, ClassNotFoundException { return defaultProvider.loadClass(codebase, name, defaultLoader); }
/** * Loads a dynamic proxy class (see {@link java.lang.reflect.Proxy} that * implements a set of interfaces with the given names from a codebase URL * path, optionally using the supplied loader. * @param codebase the list of URLs (space-separated) to load classes from, * or <code>null</code> * @param interfaces the names of the interfaces for the proxy class to * implement * @return a dynamic proxy class that implements the named interfaces * @param defaultLoader additional contextual class loader to use, or * <code>null</code> * @throws MalformedURLException if <code>codebase</code> is non-<code>null</code> * and contains an invalid URL, or if <code>codebase</code> is * <code>null</code> and the system property * <code>java.rmi.server.codebase</code> contains an invalid URL * @throws ClassNotFoundException if a definition for one of the named * interfaces could not be found at the specified location, or if * creation of the dynamic proxy class failed (such as if * {@link java.lang.reflect.Proxy#getProxyClass(ClassLoader,Class[])} * would throw an <code>IllegalArgumentException</code> for the * given interface list) */ public Class loadProxyClass(String codebase, String[] interfaces, ClassLoader defaultLoader) throws MalformedURLException, ClassNotFoundException { return defaultProvider.loadProxyClass(codebase, interfaces, defaultLoader); }
public static String getClassString(Class<?> cl) { ClassLoader loader = cl.getClassLoader(); String result = "<class>\n"; result = result + "<classloader>" + loader.getClass().getName() + "</classloader>\n"; result = result + "<annotations>" + defRMISpi.getClassAnnotation(cl) + "</annotaions>\n"; result += "</class>"; return result; }
@Override public ClassLoader getClassLoader(String codebase) throws MalformedURLException { return _delegateLoaderSpi.getClassLoader(_remoteCodebase); }
public Class<?> loadClass(String codebase, String name, ClassLoader ignored) throws MalformedURLException, ClassNotFoundException { return delegate.loadClass(codebase, name, Thread.currentThread().getContextClassLoader()); }
public Class<?> loadProxyClass(String codebase, String[] interfaces, ClassLoader ignored) throws MalformedURLException, ClassNotFoundException { return delegate.loadProxyClass(codebase, interfaces, Thread.currentThread().getContextClassLoader()); }
/** * Returns the annotation string (representing a location for the class * definition) that RMI will use to annotate the class descriptor when * marshalling objects of the given class.<br> * By default, remove rmi annotations of JClassLoader class. Between two * JOnAS, commons classes are the same, don't need t have a bigger * annotation. When local call is set, always disable annotation. * @param cl the class to obtain the annotation for * @return a string to be used to annotate the given class when it gets * marshalled, or <code>null</code> */ public String getClassAnnotation(Class cl) { ClassLoader loader = cl.getClassLoader(); // Init values if (!carolIsInitialized) { String sValue = System.getProperty(CarolDefaultValues.LOCALREG_JRMP_PROPERTY, "init"); if (!sValue.equals("init")) { carolIsOptimized = new Boolean(sValue).booleanValue(); carolIsInitialized = true; } } if (loader instanceof JClassLoader) { return null; } else if ((loader instanceof URLClassLoader) && (carolIsOptimized)) { return null; } else { return defaultProvider.getClassAnnotation(cl); } }
/** * Returns a class loader that loads classes from the given codebase URL * path. * @param codebase the list of URLs (space-separated) from which the * returned class loader will load classes from, or <code>null</code> * @return a class loader that loads classes from the given codebase URL * path * @throws MalformedURLException if <code>codebase</code> is non-<code>null</code> * and contains an invalid URL, or if <code>codebase</code> is * <code>null</code> and the system property * <code>java.rmi.server.codebase</code> contains an invalid URL */ public ClassLoader getClassLoader(String codebase) throws MalformedURLException { return defaultProvider.getClassLoader(codebase); }
public Class<?> loadClass(String codebase, String name, ClassLoader ignored) throws MalformedURLException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); return delegate.loadClass(codebase, name, loader); }
public Class<?> loadProxyClass(String codebase, String[] interfaces, ClassLoader ignored) throws MalformedURLException, ClassNotFoundException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); return delegate.loadProxyClass(codebase, interfaces, loader); }