Package javax.interceptor

Examples of javax.interceptor.InvocationContext


            AbstractAccessDecisionVoter bean = getBean(voter.trim());

            if (bean == null) {
                return false;
            }
            InvocationContext ic = new InvocationContextImpl(secureComponentData
                    .getTargetComponent(), contextParameters);
            Set<SecurityViolation> securityViolations = bean.checkPermission(ic);

            partialResult = securityViolations.isEmpty();
            if (secureComponentData.isNot()) {
View Full Code Here


        String[] voters = (String[]) mappedValue;

        BeanManager bm = BeanManagerProvider.getInstance().getBeanManager();

        String url = ((HttpServletRequest) request).getRequestURL().toString();
        InvocationContext ic = new InvocationContextImpl(url, new Object[]{request});

        boolean permitted = true;

        for (String voter : voters) {
            AbstractGenericVoter voterObj = CDIUtil.getContextualReferenceByName(bm, voter, AbstractGenericVoter.class);
View Full Code Here

    protected Object invoke(Exchange exchange, 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"); // calls performInvocation()
View Full Code Here

        return result;
    }

    protected Object performInvocation(Exchange exchange, Object serviceObject,
            Method m, Object[] paramArray) throws Exception {
        InvocationContext invContext = exchange.get(InvocationContext.class);
        invContext.setParameters(paramArray);
        Object res = invContext.proceed();

        EjbMessageContext ctx = (EjbMessageContext) invContext.getContextData();

        Map<String, Object> handlerProperties = (Map<String, Object>) exchange
                .get(HANDLER_PROPERTIES);
        addHandlerProperties(ctx, handlerProperties);
View Full Code Here

        return new ReflectionInvocationContext(operation, interceptors, beanInstance, targetMethod, parameters);
    }

    public Object invoke(Object... parameters) throws Exception {
        try {
            InvocationContext invocationContext = createInvocationContext(parameters);
            if (ThreadContext.getThreadContext() != null) {
                ThreadContext.getThreadContext().set(InvocationContext.class, invocationContext);
            }
            return invocationContext.proceed();
        } 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);
            return invocationContext.proceed();
        } 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);
            return invocationContext.proceed();
        } finally {
            ThreadContext.getThreadContext().remove(InvocationContext.class);
        }
    }
View Full Code Here

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

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

   public void postActivate(BeanContext ctx)
   {
      try
      {
         InvocationContext ic = LifecycleInvocationContextImpl.getLifecycleInvocationContext(
               PostActivate.class,
               ctx,
               postActivates,
               beanPostActivates);
         ic.proceed();
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
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.