public Method getMethod() { return wrapped.getMethod(); }
public <T extends Annotation> T resolveTypedAnnotation(Class<T> annotation) { T val = super.resolveTypedAnnotation(annotation); if (val != null) return val; if (getAdvisor() != null) { val = getAdvisor().resolveTypedAnnotation(getMethodHash(), getMethod(), annotation); if (val != null) return val; } return null; }
public SimpleMetaData getAllMetaData(Invocation invocation) { MethodInvocation methodInvocation = (MethodInvocation)invocation; return methodMetaData.get(methodInvocation.getMethod().toString()); }
/** * */ public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable { if (invocation instanceof MethodInvocation) { org.jboss.aop.joinpoint.MethodInvocation methodInvocation = (org.jboss.aop.joinpoint.MethodInvocation)invocation; long methodHash = methodInvocation.getMethodHash(); Method managerMethod = manager.isManagerMethod(methodHash); if (managerMethod != null) { Object[] args = methodInvocation.getArguments(); return managerMethod.invoke(manager, args); } Object target = methodInvocation.getTargetObject(); Method method = methodInvocation.getMethod(); if (method == null) { HashMap methodMap = manager.getMethodMap(); MethodPersistentReference ref = (MethodPersistentReference)methodMap.get(new Long(methodHash)); method = (Method)ref.get(); } return method.invoke(target, methodInvocation.getArguments()); } return invocation.invokeNext(); }
public Object resolve(Invocation invocation, Object tag, Object attr) { MethodInvocation methodInvocation = (MethodInvocation)invocation; return getMethodMetaData(methodInvocation.getMethod(), tag, attr); }
public InvocationContextAdapter(MethodInvocation delegate) { super(delegate.getMethod(), delegate.getArguments()); this.delegate = delegate; }
/** * Creates a new instance * * @param invokedBusinessInterface * @param delegate * @param asyncExecutor Used to dispatch asynchronous invocations; required */ public SessionInvocationContextAdapter(Class<?> invokedBusinessInterface, MethodInvocation delegate, final ExecutorService asyncExecutor,final AsyncCancellableContext container) { super(invokedBusinessInterface, delegate.getMethod(), delegate.getArguments()); this.delegate = delegate; // Set Async Executor and Container this.asyncExecutor = asyncExecutor; this.container = container; }
/** * @see #calculateName() */ public String calculateName() { if (invocation instanceof ConstructorInvocation) { Constructor constructor = ((ConstructorInvocation) invocation).getConstructor(); return calculateShortName(constructor.getDeclaringClass()) + "::" + constructor.getName(); } else if (invocation instanceof MethodInvocation) { Method method = ((MethodInvocation) invocation).getMethod(); return calculateName(method.getDeclaringClass(), method.getName()); } else { return "Unsupported JBossAOP invocation type: " + invocation.getClass(); } }
public static boolean isApplicationException(Throwable t, MethodInvocation invocation) { return getEJBContainer(invocation).getApplicationException(t.getClass(), invocation.getMethod()) != null; }
@Override public ApplicationException getApplicationException(Class<?> e) { //return TxUtil.getApplicationException(e, delegate); return AbstractInterceptor.getEJBContainer(delegate).getApplicationException(e, delegate.getMethod()); }
@Override public ApplicationException getApplicationException(Class<?> e) { //return TxUtil.getApplicationException(e, delegate); return AbstractInterceptor.getEJBContainer(delegate).getApplicationException(e, delegate.getMethod()); }
/** * Invokes the target joinpoint for this invocation skipping any subsequent * interceptors in the chain. */ public Object invokeTarget() throws Throwable { try { return getActualMethod().invoke(getTargetObject(), arguments); } catch (Throwable t) { throw handleErrors(getTargetObject(), getMethod(), arguments, t); } }
public <T extends Annotation> T resolveTypedAnnotation(Class<T>[] annotations) { T val = super.resolveTypedAnnotation(annotations); if (val != null) return val; if (getAdvisor() != null) { val = getAdvisor().resolveTypedAnnotation(getMethod(), annotations); if (val != null) return val; } return null; }
public Object invoke(Invocation invocation) throws Throwable { Method method = ((MethodInvocation) invocation).getMethod(); TransactionRetry txRetry = getAnnotation(invocation, method, TransactionRetry.class); int numRetries = txRetry.numRetries(); long waitTime = TimeUnit.MILLISECONDS.convert(txRetry.waitTime(), txRetry.waitTimeUnit()); while(true) { try { return invocation.invokeNext(); } catch(EJBTransactionRolledbackException e) { Thread.sleep(waitTime); if(--numRetries <= 0) throw e; } } } }
/** * This method resolves an annotation based on the context of the invocation. */ public Object resolveAnnotation(Class<? extends Annotation>[] annotations) { Object val = super.resolveAnnotation(annotations); if (val != null) return val; if (getAdvisor() != null) { val = getAdvisor().resolveAnnotation(getMethod(), annotations); if (val != null) return val; } return null; }
PointcutMethodMatch pmatch = p.matchesExecution(mi.getAdvisor(), mi.getMethod()); if (pmatch == null)
Method method = mi.getMethod(); if(shelper.isEJBTimeOutCallback(method) || shelper.containsTimeoutAnnotation(container, method) ||
if(shelper.isEJBTimeOutCallback(((MethodInvocation) invocation).getMethod())) return invocation.invokeNext();
return new MethodJoinpoint(((MethodInvocation)invocation).getMethod());