@Override protected void before() throws Exception { // Mark the current invocation both on the executing Thread and the Invocation CurrentAsyncAOPInvocation.markCurrentInvocation(this.id, this.invocation); }
public AsyncAOPInvocationTask(final Invocation invocation, final SecurityContext sc, final AsyncInvocationId id) { super(sc, id, SecurityActions.getTccl()); assert invocation != null : "Invocation must be supplied"; this.invocation = invocation; }
@Override protected void after() throws Exception { // Unmark the current invocation both on the executing Thread and the Invocation CurrentAsyncAOPInvocation.unmarkCurrentInvocation(this.invocation); }
final ExecutorService executorService = this.getAsyncExecutor(invocation); final SecurityContext sc = SecurityActions.getSecurityContext(); final Callable<Object> asyncTask = new AsyncAOPInvocationTask<Object>(nextInvocation, sc, id); CurrentAsyncAOPInvocation.markCurrentInvocation(id, nextInvocation); task = executorService.submit(asyncTask); if (log.isTraceEnabled())
/** * {@inheritDocs} * @see org.jboss.aop.advice.Interceptor#invoke(org.jboss.aop.joinpoint.Invocation) */ public Object invoke(final Invocation invocation) throws Throwable { // If asynchronous if (this.isAsyncInvocation(invocation)) { // Spawn return this.invokeAsync(invocation); } // Regular synchronous call else { // Continue along the chain return invocation.invokeNext(); } }
/** * {@inheritDoc} * @see org.jboss.aop.advice.AspectFactory#createPerClass(org.jboss.aop.Advisor) */ public Object createPerClass(final Advisor advisor) { // Get the container final EJBContainer container = EJBContainer.getEJBContainer(advisor); // Get the metadata final JBossEnterpriseBeanMetaData md = container.getXml(); // Create the interceptor instance AsyncMethodsMetaData asyncMethods = this.getAsyncMethods(md); if (asyncMethods == null) { asyncMethods = new AsyncMethodsMetaData(); } final Object interceptor = new AsynchronousClientInterceptor(asyncMethods); return interceptor; }
InvokeRemoteInterceptor.INVOKER_LOCATOR); final Object oid = invocation.getMetaData().getMetaData(Dispatcher.DISPATCHER, Dispatcher.OID); final PojiProxy proxy = new PojiProxyHack(oid, locator, new Interceptor[] {}); final AsyncEndpoint container = (AsyncEndpoint) Proxy.newProxyInstance(Thread.currentThread()
final AsyncInvocationId id = CurrentAsyncAOPInvocation.getCurrentAsyncInvocationId(invocation);