Methods Summary |
---|
static java.lang.Object | invokeJavaObjectMethod(java.lang.reflect.InvocationHandler handler, java.lang.reflect.Method method, java.lang.Object[] args)
Object returnValue = null;
// Can only be one of :
// boolean java.lang.Object.equals(Object)
// int java.lang.Object.hashCode()
// String java.lang.Object.toString()
//
// Optimize by comparing as few characters as possible.
switch( method.getName().charAt(0) ) {
case 'e" :
boolean result = false;
if (args[0] != null) {
Object other = Proxy.isProxyClass(args[0].getClass()) ?
Proxy.getInvocationHandler(args[0]) : args[0];
result = handler.equals(other);
}
returnValue = new Boolean(result);
break;
case 'h" :
returnValue = new Integer(handler.hashCode());
break;
case 't" :
returnValue = handler.toString();
break;
default :
throw new EJBException(method.getName());
}
return returnValue;
|
static boolean | isDeclaredException(java.lang.Throwable t, java.lang.Class[] declaredExceptions)
boolean declaredException = false;
for(int i = 0; i < declaredExceptions.length; i++) {
Class next = declaredExceptions[i];
if( next.isAssignableFrom(t.getClass()) ) {
declaredException = true;
break;
}
}
return declaredException;
|
static void | throwLocalException(java.lang.Throwable t, java.lang.Class[] declaredExceptions)
Throwable toThrow = t;
if( (t instanceof java.lang.RuntimeException) ||
(isDeclaredException(t, declaredExceptions)) ) {
toThrow = t;
} else {
toThrow = new EJBException();
toThrow.initCause(t);
}
throw toThrow;
|
static void | throwRemoteException(java.lang.Throwable t, java.lang.Class[] declaredExceptions)
Throwable toThrow = t;
if( (t instanceof java.lang.RuntimeException) ||
(t instanceof java.rmi.RemoteException) ||
(isDeclaredException(t, declaredExceptions)) ) {
toThrow = t;
} else {
toThrow = new RemoteException("", t);
}
throw toThrow;
|