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 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 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; }
public String getClassAnnotation(Class type) { Object obj = type.getClassLoader(); if (obj instanceof ClassLoaderServerAware) { ClassLoaderServerAware classLoader = (ClassLoaderServerAware) obj; URL urls[] = classLoader.getClassLoaderServerURLs(); if (null == urls) { return delegate.getClassAnnotation(type); } StringBuffer codebase = new StringBuffer(); for (int i = 0; i < urls.length; i++) { URL url = normalizeURL(urls[i]); if (codebase.length() != 0) { codebase.append(' '); } codebase.append(url); } return codebase.toString(); } return delegate.getClassAnnotation(type); }
/** * 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); } }
public String getClassAnnotation(Class type) { Object obj = type.getClassLoader(); if (obj instanceof ClassLoaderServerAware) { ClassLoaderServerAware classLoader = (ClassLoaderServerAware) obj; URL urls[] = classLoader.getClassLoaderServerURLs(); if (null == urls) { return delegate.getClassAnnotation(type); } StringBuffer codebase = new StringBuffer(); for (int i = 0; i < urls.length; i++) { URL url = normalizeURL(urls[i]); if (codebase.length() != 0) { codebase.append(' '); } codebase.append(url); } return codebase.toString(); } return delegate.getClassAnnotation(type); }
return null; } else { return defaultProvider.getClassAnnotation(cl);
/** * Returns the annotation string (representing a location for * the class definition as a single or space delimited list of * RFC3986 compliant URI) that JERI will use to annotate the class * descriptor when marshalling objects of the given class. * * <p>This method delegates to the * {@link RMIClassLoaderSpi#getClassAnnotation(Class)} method * of the provider instance, passing <code>cl</code> as the argument. * * @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> * * @throws NullPointerException if <code>cl</code> is <code>null</code> * @since 3.0 */ public static String getClassAnnotation(Class<?> cl) { if (provider != null) return provider.getClassAnnotation(cl); return RMIClassLoader.getClassAnnotation(cl); }