/** * Invoke the user defined static method in the nested "Duck" class so that the user can define * convenience methods on the config beans. */ Object invokeDuckMethod(Method method, Object proxy, Object[] args) throws Exception { Method duckMethod = model.getDuckMethod(method); Object[] duckArgs; if (args == null) { duckArgs = new Object[] {proxy}; } else { duckArgs = new Object[args.length + 1]; duckArgs[0] = proxy; System.arraycopy(args, 0, duckArgs, 1, args.length); } try { return duckMethod.invoke(null, duckArgs); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t instanceof Exception) throw (Exception) t; if (t instanceof Error) throw (Error) t; throw e; } }
@Override public ConfigBeanProxy compute(final Class<?> proxyType) throws ComputationErrorException { ClassLoader cl; if (System.getSecurityManager() != null) { cl = AccessController.doPrivileged( new PrivilegedAction<ClassLoader>() { @Override public ClassLoader run() { return proxyType.getClassLoader(); } }); } else { cl = proxyType.getClassLoader(); } ConfigBeanProxy retVal = (ConfigBeanProxy) Proxy.newProxyInstance(cl, new Class[] {proxyType}, dom); return retVal; }
public int hashCode() { return System.identityHashCode(this); }
@Override public String toString() { return "Dom.Child(" + name + "," + System.identityHashCode(this) + ")"; }