Package javax.interceptor

Examples of javax.interceptor.InvocationContext


            }
        }
    }

    public InvocationContext createInvocationContext(Object... parameters) {
        InvocationContext invocationContext = new ReflectionInvocationContext(operation, interceptors, beanInstance, targetMethod, parameters);
        return invocationContext;
    }
View Full Code Here


        return invocationContext;
    }

    public Object invoke(Object... parameters) throws Exception {
        try {
            InvocationContext invocationContext = createInvocationContext(parameters);
            if (ThreadContext.getThreadContext() != null) {
                ThreadContext.getThreadContext().set(InvocationContext.class, invocationContext);
            }
            Object value = invocationContext.proceed();
            return value;
        } finally {
            if (ThreadContext.getThreadContext() != null) {
                ThreadContext.getThreadContext().remove(InvocationContext.class);
            }
View Full Code Here

        }
    }

    public Object invoke(javax.xml.ws.handler.MessageContext messageContext, Object... parameters) throws Exception {
        try {
            InvocationContext invocationContext = new JaxWsInvocationContext(operation, interceptors, beanInstance, targetMethod, messageContext, parameters);
            ThreadContext.getThreadContext().set(InvocationContext.class, invocationContext);
            Object value = invocationContext.proceed();
            return value;
        } finally {
            ThreadContext.getThreadContext().remove(InvocationContext.class);
        }
    }
View Full Code Here

        }
    }

    public Object invoke(javax.xml.rpc.handler.MessageContext messageContext, Object... parameters) throws Exception {
        try {
            InvocationContext invocationContext = new JaxRpcInvocationContext(operation, interceptors, beanInstance, targetMethod, messageContext, parameters);
            ThreadContext.getThreadContext().set(InvocationContext.class, invocationContext);
            Object value = invocationContext.proceed();
            return value;
        } finally {
            ThreadContext.getThreadContext().remove(InvocationContext.class);
        }
    }
View Full Code Here

/*     */     {
/* 119 */       id = ((StatefulBeanContext)ctx).getId();
/*     */     }
/*     */     try
/*     */     {
/* 123 */       InvocationContext ic = LifecycleInvocationContextImpl.getLifecycleInvocationContext(PreDestroy.class, ctx, this.preDestroys, this.beanPreDestroys);
/*     */
/* 128 */       ic.proceed();
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 132 */       throw new RuntimeException(e);
/*     */     }
View Full Code Here

/*     */
/*     */   public void postActivate(BeanContext ctx)
/*     */   {
/*     */     try
/*     */     {
/* 140 */       InvocationContext ic = LifecycleInvocationContextImpl.getLifecycleInvocationContext(PostActivate.class, ctx, this.postActivates, this.beanPostActivates);
/*     */
/* 145 */       ic.proceed();
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 149 */       throw new RuntimeException(e);
/*     */     }
View Full Code Here

/*     */
/*     */   public void prePassivate(BeanContext ctx)
/*     */   {
/*     */     try
/*     */     {
/* 157 */       InvocationContext ic = LifecycleInvocationContextImpl.getLifecycleInvocationContext(PrePassivate.class, ctx, this.prePassivates, this.beanPrePassivates);
/*     */
/* 162 */       ic.proceed();
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 166 */       throw new RuntimeException(e);
/*     */     }
View Full Code Here

/*     */
/*     */   public void postConstruct(BeanContext ctx, Object[] params)
/*     */   {
/*     */     try
/*     */     {
/* 104 */       InvocationContext ic = LifecycleInvocationContextImpl.getLifecycleInvocationContext(PostConstruct.class, ctx, this.postConstructs, this.beanPostConstructs);
/* 105 */       ic.setParameters(params);
/* 106 */       ic.proceed();
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 110 */       throw new RuntimeException(e);
/*     */     }
View Full Code Here

                            Object serviceObject,
                            Method m,
                            List<Object> params) {      
        Object result = null;
       
        InvocationContext invContext = exchange.get(InvocationContext.class);
        if (invContext == null) {
            LOG.debug("PreEJBInvoke");
            result = preEjbInvoke(exchange, serviceObject, m, params);
        } else {
            LOG.debug("EJBInvoke");
View Full Code Here

    }

    public Object directEjbInvoke(Exchange exchange,
                                  Method m,
                                  List<Object> params) throws Exception {
        InvocationContext invContext = exchange.get(InvocationContext.class);
        Object[] paramArray;
        if (params != null) {
            paramArray = params.toArray();
        } else {
            paramArray = new Object[]{};
        }
                   
        invContext.setParameters(paramArray);
        Object res = invContext.proceed();
       
        ContextPropertiesMapping.updateWebServiceContext(exchange,
                                                         (MessageContext)invContext.getContextData());
               
        return res;
    }
View Full Code Here

TOP

Related Classes of javax.interceptor.InvocationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.