Mercurial > hg > blitz_condensed
view src/org/dancres/blitz/remote/debug/DebugILFactory.java @ 22:b7e52953b7a6
Add some cache/memory statistics to help spot potential exhaustion and other tuning issues.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Fri, 28 Aug 2009 17:23:33 +0100 |
parents | 3dc0c5604566 |
children |
line wrap: on
line source
package org.dancres.blitz.remote.debug; import java.rmi.Remote; import java.rmi.server.ExportException; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import net.jini.jeri.ProxyTrustILFactory; import net.jini.jeri.ObjectEndpoint; import net.jini.core.constraint.MethodConstraints; /** <p>A custom <code>InvocationLayerFactory</code> for JERI which allows a Blitz instance to be debugged or monitored in custom fashions. Simply replace the <code>BasicILFactory</code> or <code>ProxyTrustILFactory</code> in the configuration file with an instance of <code>DebugILFactory</code> (which accepts the same paramters).</p> <p>This factory inserts a custom <code>InvocationHandler</code>, <code>TimingInvocationHandler</code>. </p> @see org.dancres.blitz.remote.test.debug.TimingInvocationHandler */ public class DebugILFactory extends ProxyTrustILFactory { public DebugILFactory(MethodConstraints aConstraints, Class aPermissionsClass) { super(aConstraints, aPermissionsClass, null); } public DebugILFactory(MethodConstraints aConstraints, Class aPermissionsClass, ClassLoader aLoader) { super(aConstraints, aPermissionsClass, aLoader); } protected InvocationHandler createInvocationHandler(Class[] aSetOfInterfaces, Remote anImpl, ObjectEndpoint anEndpoint) throws ExportException { for (int i = aSetOfInterfaces.length; --i >= 0; ) { if (aSetOfInterfaces[i] == null) { throw new NullPointerException(); } } if (anImpl == null) { throw new NullPointerException(); } return new TimingInvocationHandler(anEndpoint, getServerConstraints()); } }