// Precondition checks
assert Proxy.isProxyClass(proxy.getClass()) : "Unexpected proxy, was expecting type " + Proxy.class.getName();
InvocationHandler handler = Proxy.getInvocationHandler(proxy);
assert handler instanceof SessionProxyInvocationHandler : InvocationHandler.class.getSimpleName()
+ " must be of type " + SessionProxyInvocationHandler.class.getName();
SessionProxyInvocationHandler sHandler = (SessionProxyInvocationHandler) handler;
// Get the Target (Session ID)
Object sessionId = sHandler.getTarget();
// Get the appropriate instance
Object obj = this.getBeanInstance((Serializable) sessionId);
// Invoke