public Object readResolve() throws ObjectStreamException { try { ClassLoader cl = null; if (advisor.getInstance() != null) { cl = SecurityActions.getClassLoader(advisor.getInstance().getClass()); } //FIXME: When will instance not be null? if (cl == null) { //Fall back to the context classloader cl = SecurityActions.getContextClassLoader(); } return ProxyFactory.createInterfaceProxy(guid, cl, interfaces, mixins, advisor); } catch (Exception e) { throw new RuntimeException(e); } } }