public Object invoke(Invocation mi) throws Exception { // nothing to see here... move along return getNext().invoke(mi); } }
public Object invokeHome(Invocation mi) throws Exception { // Invoke through interceptors return getNext().invokeHome(mi); }
/** Initialize the interceptors by calling the chain */ protected void createInterceptors() throws Exception { Interceptor in = interceptor; while (in != null) { in.setContainer(this); in.create(); in = in.getNext(); } }
log.trace("Bypass security for invoke or invokeHome"); if (isInvoke) return getNext().invoke(mi); else return getNext().invokeHome(mi); return getNext().invoke(mi); else return getNext().invokeHome(mi);
protected void destroyInterceptors() { // Destroy all the interceptors in the chain Interceptor in = interceptor; while (in != null) { in.destroy(); in.setContainer(null); in = in.getNext(); } }
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); }
while (in != null) in.setContainer(this); in.create(); in = in.getNext();
while (in != null) in.destroy(); in.setContainer(null); in = in.getNext();
/** * 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); }
return getNext().invoke(mi); else return getNext().invokeHome(mi); return getNext().invoke(mi); else return getNext().invokeHome(mi);
while (in != null) in.setContainer(this); in.create(); in = in.getNext();
while (in != null) in.destroy(); in.setContainer(null); in = in.getNext();