super(beanContext, interfaceType, interfaces, mainInterface);
}
public Object createProxy(final Object primaryKey, final Class mainInterface) {
final Object proxy = super.createProxy(primaryKey, mainInterface);
EjbObjectProxyHandler handler = null;
try {
handler = (EjbObjectProxyHandler) ProxyManager.getInvocationHandler(proxy);
} catch (final Exception e) {
// try getting the invocation handler from the localbean
try {
final Field field = proxy.getClass().getDeclaredField("invocationHandler");
field.setAccessible(true);
handler = (EjbObjectProxyHandler) field.get(proxy);
} catch (final Exception e1) {
// no-op
}
}
registerHandler(handler.getRegistryId(), handler);
return proxy;
}