public Object invokeHome(final Invocation mi) throws Exception { // assert mi != null; return getNext().invokeHome(mi); }
public Object invokeHome(Invocation mi) throws Exception { // Invoke through interceptors return getNext().invokeHome(mi); }
public Object invokeHome(Invocation mi) throws Exception { extractSessionPrincipal(mi); Object returnValue = getNext().invokeHome(mi); return returnValue; }
public Object invokeHome(Invocation mi) throws Exception { // Apply any declarative security checks checkSecurityAssociation(mi); Object returnValue = getNext().invokeHome(mi); return returnValue; }
public Object invokeHome(Invocation mi) throws Exception { // stateless: no context, no transaction, no call to the instance if (stateless || mi.getEnterpriseContext() == null) return getNext().invokeHome(mi); else return invokeNext(mi); }
public Object invokeHome(final Invocation mi) throws Exception { validateArguments(mi); Object obj = getNext().invokeHome(mi); return validateReturnValue(mi, obj); }
public Object invokeHome(Invocation mi) throws Exception { Method getEJBObject = Handle.class.getMethod("getEJBObject", new Class[0]); //Invocation on the handle, we don't need a bean instance if (getEJBObject.equals(mi.getMethod())) return getNext().invokeHome(mi); 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().invokeHome(mi); } finally { } } }
public Object internalInvokeHome(Invocation mi) throws Exception { Method method = mi.getMethod(); if (method != null && method.getName().equals("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(); ejbObject.remove(); return null; } else throw new RemoveException("EJBHome.remove(Object) not allowed for session beans"); } // Invoke through interceptors return getInterceptor().invokeHome(mi); }
return getNext().invokeHome(mi); else try return getNext().invokeHome(mi);
public Object invokeHome (Invocation mi) throws Exception { EnterpriseContext ctx = (EnterpriseContext)mi.getEnterpriseContext (); try { // Invoke through interceptors return getNext ().invokeHome (mi); } finally { if ( (ctx != null) && (ctx.getId () != null) ) // Still a valid instance and instance not removed // { // Everything went ok (at least no J2EE problem) and the instance will most probably be called // many more times. Consequently, we need to synchronize the state of our bean instance with // our persistant store (which will forward this to its HASessionState implementation) for clustering // behaviour. This is only necessary for "create" calls (which is the case because ctx.getId() != null) // synchronizeState (ctx); } } }
return getNext().invoke(mi); else return getNext().invokeHome(mi); return getNext().invoke(mi); else return getNext().invokeHome(mi);
public Object invokeHome(final Invocation mi) throws Exception { InstancePool pool = container.getInstancePool(); StatelessSessionEnterpriseContext ctx = null; try { // Acquire an instance in case the ejbCreate throws a CreateException ctx = (StatelessSessionEnterpriseContext) pool.get(); mi.setEnterpriseContext(ctx); // Dispatch the method to the container return getNext().invokeHome(mi); } finally { mi.setEnterpriseContext(null); // If an instance was created, return it to the pool if( ctx != null ) pool.free(ctx); } }
public Object invokeHome(Invocation mi) throws Exception { // Apply any custom security checks if( securityProxy != null ) { EJBContext ctx = null; EnterpriseContext ectx = (EnterpriseContext)mi.getEnterpriseContext(); if( ectx != null ) ctx = ectx.getEJBContext(); Object[] args = mi.getArguments(); securityProxy.setEJBContext(ctx); try { securityProxy.invokeHome(mi.getMethod(), args); } catch(SecurityException e) { Principal principal = mi.getPrincipal(); String msg = "SecurityProxy.invokeHome exception, principal=" + principal; log.error(msg, e); throw e; } } return getNext().invokeHome(mi); }
return getNext().invokeHome(mi); return getNext().invokeHome(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); }
return getNext().invoke(mi); else return getNext().invokeHome(mi);
public Object invokeHome(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 // 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.invokeHome(mi); } finally { ENCThreadLocalKey.setKey(oldInvokerBinding); // JBAS-4192 clear the container's thread local container.setProxyFactory(null); } return value; }
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 invokeHome(Invocation mi) throws Exception { EntityEnterpriseContext ctx = (EntityEnterpriseContext)mi.getEnterpriseContext(); Transaction tx = mi.getTransaction(); Object rtn = getNext().invokeHome(mi); // An anonymous context was sent in, so if it has an id it is a real instance now if(ctx.getId() != null) { // it doesn't need to be read, but it might have been changed from the db already. ctx.setValid(true); if(tx != null) { BeanLock lock = container.getLockManager().getLock(ctx.getCacheKey()); try { lock.schedule(mi); register(ctx, tx); // Set tx lock.endInvocation(mi); } finally { container.getLockManager().removeLockRef(lock.getId()); } } } return rtn; }
result = getNext().invokeHome(mi);