/** * Are you local? */ public boolean isLocal(Invocation invocation) { InvocationType type = invocation.getType(); if (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME) return true; return false; }
/** * Helper method to determine whether an invocation is local * * @return true when local, false otherwise */ public boolean isLocal() { InvocationType type = getType(); return (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME || type == InvocationType.SERVICE_ENDPOINT); }
/** Do some validation of the return value */ protected Object validateReturnValue(Invocation mi, Object retValue) { if (mi.getType() == InvocationType.REMOTE) { if (retValue instanceof TimerHandle) throw new IllegalArgumentException("Cannot return TimerHandle from remote interface"); } return retValue; }
/** Do some validation of the incoming parameters */ protected void validateArguments(Invocation mi) { if (mi.getType() == InvocationType.REMOTE) { Object[] params = mi.getArguments(); for (int i = 0; i < params.length; i++) { Object obj = params[i]; if (obj instanceof TimerHandle) throw new IllegalArgumentException("Cannot pass TimerHandle through remote interface"); } } }
public MarshalledInvocation(Invocation invocation) { this.payload = invocation.payload; this.as_is_payload = invocation.as_is_payload; this.method = invocation.getMethod(); this.objectName = invocation.getObjectName(); this.args = invocation.getArguments(); this.invocationType = invocation.getType(); this.transient_payload = invocation.transient_payload; this.invocationContext = invocation.invocationContext; }
log.trace("Invocation failed", e); InvocationType type = invocation.getType(); if ((maxRetries > -1 && retryCount >= maxRetries) || reestablishInvokerProxy(ctx, type) == false)
InvocationType iface = mi.getType(); Set methodRoles = container.getMethodPermissions(mi.getMethod(), iface); if (methodRoles == null)
public Object invoke(Invocation mi) throws Exception { Object key = ((EnterpriseContext) mi.getEnterpriseContext()).getInstance(); try { ccm.pushMetaAwareObject(key, unsharableResources); try { return getNext().invoke(mi); } finally { ccm.popMetaAwareObject(unsharableResources); } } catch (ResourceException e) { InvocationType type = mi.getType(); boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME); if (isLocal) throw new EJBException("Resource problem during invoke", e); else throw new RemoteException("Resource problem during invoke", e); } }
public Object internalInvokeHome(Invocation mi) throws Exception { Method method = mi.getMethod(); if (method != null && method.getName().equals("remove")) { // Map to EJBHome.remove(Object) to EJBObject.remove() InvocationType type = mi.getType(); if (type == InvocationType.HOME) mi.setType(InvocationType.REMOTE); else if (type == InvocationType.LOCALHOME) mi.setType(InvocationType.LOCAL); mi.setMethod(EJBOBJECT_REMOVE); // Handle or primary key? Object arg = mi.getArguments()[0]; if (arg instanceof Handle) { if (arg == null) throw new RemoteException("Null handle"); Handle handle = (Handle) arg; EJBObject ejbObject = handle.getEJBObject(); mi.setId(ejbObject.getPrimaryKey()); } else mi.setId(arg); mi.setArguments(new Object[0]); return getInterceptor().invoke(mi); } // Invoke through interceptors return getInterceptor().invokeHome(mi); }
InvocationType type = mi.getType(); boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME); if (isLocal)
contextID = SecurityActions.setContextID(contextID); if (mi.getType() != InvocationType.SERVICE_ENDPOINT) type = mi.getType(); InvocationType calltype = mi.getType(); boolean isLocal = calltype == InvocationType.LOCAL || calltype == InvocationType.LOCALHOME; if (mi.getType() == InvocationType.SERVICE_ENDPOINT)
if (mi.getType() == InvocationType.REMOTE)
throws Exception InvocationType type = invocation.getType(); try
InvocationType type = mi.getType(); boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME); if (isLocal)
InvocationType type = mi.getType(); boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME); if (isLocal)
log.trace("Current transaction in MI is " + oldTransaction); InvocationType type = invocation.getType(); byte transType = container.getBeanMetaData().getTransactionMethod(invocation.getMethod(), type);
InvocationType type = mi.getType(); boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME); if (isLocal)
InvocationType type = mi.getType(); boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME); if (isLocal)