public Object invoke(final Invocation mi) throws Exception { // assert mi != null; return getNext().invoke(mi); }
public Object internalInvoke(Invocation mi) throws Exception { // Invoke through interceptors return getInterceptor().invoke(mi); }
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); }
public Object invoke(Invocation mi) throws Exception { // nothing to see here... move along return getNext().invoke(mi); } }
return getNext().invoke(mi); else return getNext().invokeHome(mi);
/** * This method does invocation interpositioning of tx and security, * retrieves the instance from an object table, and invokes the method * on the particular instance */ public Object internalInvoke(Invocation mi) throws Exception { // Invoke through interceptors return getInterceptor().invoke(mi); }
public Object invokeHome(Invocation mi) throws Exception { // Invoke through interceptors Object retVal = getNext().invokeHome(mi); // Is the context now with an identity? // This means that a create method was called, so invoke ejbPostCreate. EntityEnterpriseContext ctx = (EntityEnterpriseContext) mi.getEnterpriseContext(); if(ctx != null && ctx.getId() != null) { // copy from the context into the mi // interceptors down the chain look in the mi for the id not the ctx. mi.setId(ctx.getId()); // invoke down the invoke chain // the final interceptor in EntityContainer will redirect this // call to postCreateEntity, which calls ejbPostCreate getNext().invoke(mi); // now it's ready and can be scheduled for the synchronization if(TxUtils.isActive(mi.getTransaction())) { GlobalTxEntityMap.NONE.scheduleSync(mi.getTransaction(), ctx); } } return retVal; }
public Object invoke(Invocation mi) throws Exception { // Authenticate the subject and apply any declarative security checks checkSecurityAssociation(mi); Object returnValue = getNext().invoke(mi); return returnValue; }
public Object invoke(Invocation mi) throws Exception { extractSessionPrincipal(mi); Object returnValue = getNext().invoke(mi); return returnValue; }
public Object invoke(final Invocation mi) throws Exception { validateArguments(mi); Object obj = getNext().invoke(mi); return validateReturnValue(mi, obj); }
public Object invoke(Invocation mi) throws Exception { EnterpriseContext ctx = (EnterpriseContext) mi.getEnterpriseContext(); if(ctx == null) throw new IllegalStateException("EJBContext is null"); //Set the current security information ctx.setPrincipal(mi.getPrincipal()); try { // Invoke through interceptors return getNext().invoke(mi); } finally { } }
/** * This method does invocation interpositioning of tx and security, * retrieves the instance from an object table, and invokes the method * on the particular instance */ public Object internalInvoke(Invocation mi) throws Exception { SecurityContext cachedContext = null; try { cachedContext = SecurityActions.getSecurityContext(); //For message driven beans, there is no security context SecurityActions.setSecurityContext(null); // Invoke through interceptors return getInterceptor().invoke(mi); } finally { SecurityActions.setSecurityContext(cachedContext); } }
return getNext ().invoke (mi);
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); } }
return getNext().invoke(mi);
return getNext().invoke(mi);
public Object invoke(Invocation mi) throws Exception { // Apply any custom security checks if( securityProxy != null ) { EnterpriseContext ectx = (EnterpriseContext)mi.getEnterpriseContext(); Object bean = ectx.getInstance(); EJBContext ctx = ectx.getEJBContext(); Object[] args = mi.getArguments(); securityProxy.setEJBContext(ctx); try { securityProxy.invoke(mi.getMethod(), args, bean); } catch(SecurityException e) { Principal principal = mi.getPrincipal(); String msg = "SecurityProxy.invoke exception, principal="+principal; log.error(msg, e); throw e; } } return getNext().invoke(mi); } }
public Object invoke(Invocation mi) throws Exception { String invokerBinding = (String)mi.getAsIsValue(InvocationKey.INVOKER_PROXY_BINDING); setProxyFactory(invokerBinding, mi); String oldInvokerBinding = ENCThreadLocalKey.getKey(); // Only override current ENC binding if we're not local or there has not been a previous call // if ((!BeanMetaData.LOCAL_INVOKER_PROXY_BINDING.equals(invokerBinding)) || oldInvokerBinding == null) if (invokerBinding != null || oldInvokerBinding == null) { ENCThreadLocalKey.setKey(invokerBinding); } Interceptor next = getNext(); Object value = null; try { value = next.invoke(mi); } finally { ENCThreadLocalKey.setKey(oldInvokerBinding); // JBAS-4192 clear the container's thread local container.setProxyFactory(null); } return value; }