public static String getClassAnnotation(Class clas){ try { return ClassLoading.getClassAnnotation(clas); } catch (NoSuchMethodError e){ // Ignore, earlier version of River. } return RMIClassLoader.getClassAnnotation(clas); }
private void writeAnnotation(final Class c) throws IOException { String cb = ClassLoading.getClassAnnotation(c); writeObject(cb); if (bcb.equals(cb)) { AccessController.doPrivileged(new PrivilegedAction() { @Override public Object run() { if (c.getClassLoader() != bcl) { replace = true; } return null; } }); } } }
/** * Annotates the stream descriptor for the class <code>cl</code>. * * <p><code>MarshalOutputStream</code> implements this method as * follows: * * <p>This method invokes {@link RMIClassLoaderSpi#getClassAnnotation * RMIClassLoaderSpi.getClassAnnotation} with <code>cl</code> to get * the appropriate class annotation string value (possibly * <code>null</code>), and then it invokes this stream's {@link * #writeAnnotation writeAnnotation} method with that string to * record the annotation. * * @param cl the class to annotate * * @throws IOException if <code>writeAnnotation</code> throws an * <code>IOException</code> * * @throws NullPointerException if <code>cl</code> is * <code>null</code> **/ @Override protected void annotateClass(Class cl) throws IOException { writeAnnotation(ClassLoading.getClassAnnotation(cl)); }
/** * Annotates the stream descriptor for the proxy class * <code>cl</code>. * * <p><code>MarshalOutputStream</code> implements this method as * follows: * * <p>This method invokes {@link RMIClassLoaderSpi#getClassAnnotation * RMIClassLoaderSpi.getClassAnnotation} with <code>cl</code> to get * the appropriate class annotation string value (possibly * <code>null</code>), and then it invokes this stream's {@link * #writeAnnotation writeAnnotation} method with that string to * record the annotation. * * @param cl the proxy class to annotate * * @throws IOException if <code>writeAnnotation</code> throws an * <code>IOException</code> * * @throws NullPointerException if <code>cl</code> is * <code>null</code> **/ @Override protected void annotateProxyClass(Class cl) throws IOException { writeAnnotation(ClassLoading.getClassAnnotation(cl)); }
new Object[] { leaseToRenew.getClass(), ClassLoading.getClassAnnotation(lc) });
final String bcb = ClassLoading.getClassAnnotation(base); if (bcb == null || bcb.length() == 0) { return null;