Package org.jboss.weld.interceptor.spi.model

Examples of org.jboss.weld.interceptor.spi.model.InterceptionModel


            SlimAnnotatedType<?> type = (SlimAnnotatedType<?>) manager.createAnnotatedType(componentClass);
            if (!manager.getInterceptorModelRegistry().containsKey(type)) {
                EnhancedAnnotatedType<?> enhancedType = manager.getServices().get(ClassTransformer.class).getEnhancedAnnotatedType(type);
                InterceptionModelInitializer.of(manager, enhancedType, null).init();
            }
            InterceptionModel model = manager.getInterceptorModelRegistry().get(type);
            if (model != null) {
                return new InterceptorBindingsAdapter(manager.getInterceptorModelRegistry().get(type));
            }
        }
        return null;
View Full Code Here


    }

    @Test
    public void testInterceptionModelForConstructor() {
        SessionBeanInjectionTarget<?> it = (SessionBeanInjectionTarget<?>) manager.createInjectionTarget(manager.getEjbDescriptor(Foo.class.getSimpleName()));
        InterceptionModel model = manager.getInterceptorModelRegistry().get(it.getAnnotated());
        assertNotNull(model);
        assertTrue(model.hasExternalConstructorInterceptors());
    }
View Full Code Here

    @Override
    public void initializeAfterBeanDiscovery(EnhancedAnnotatedType<T> annotatedType) {
        initializeInterceptionModel(annotatedType);

        InterceptionModel interceptionModel = null;
        if (isInterceptionCandidate()) {
            interceptionModel = beanManager.getInterceptorModelRegistry().get(getType());
        }
        boolean hasNonConstructorInterceptors = interceptionModel != null && (interceptionModel.hasExternalNonConstructorInterceptors() || interceptionModel.hasTargetClassInterceptors());

        List<Decorator<?>> decorators = null;
        if (getBean() != null && isInterceptionCandidate()) {
            decorators = beanManager.resolveDecorators(getBean().getTypes(), getBean().getQualifiers());
        }
View Full Code Here

        this.proxyInstantiator = new SessionBeanProxyInstantiator<T>(enhancedAnnotatedItem, this);
        registerInterceptors();
    }

    protected void registerInterceptors() {
        InterceptionModel model = beanManager.getInterceptorModelRegistry().get(getAnnotated());
        if (model != null) {
            getBeanManager().getServices().get(EjbServices.class).registerInterceptors(getEjbDescriptor(), new InterceptorBindingsAdapter(model));
        }
    }
View Full Code Here

            if (descriptor.isMessageDriven()) {
                EnhancedAnnotatedType<?> type =  classTransformer.getEnhancedAnnotatedType(descriptor.getBeanClass(), getManager().getId());
                if (!getManager().getInterceptorModelRegistry().containsKey(type.slim())) {
                    InterceptionModelInitializer.of(getManager(), type, null).init();
                }
                InterceptionModel model = getManager().getInterceptorModelRegistry().get(type.slim());
                if (model != null) {
                    ejbServices.registerInterceptors(descriptor, new InterceptorBindingsAdapter(model));
                }
            }
        }
View Full Code Here

    public <T> T getInterceptorInstance(InterceptorClassMetadata<T> interceptorMetadata) {
        return cast(interceptorInstances.get(interceptorMetadata.getJavaClass()));
    }

    private Object readResolve() throws ObjectStreamException {
        InterceptionModel interceptionModel = manager.getInterceptorModelRegistry().get(annotatedType);
        return new InterceptionContext(interceptorInstances, manager, interceptionModel, annotatedType);
    }
View Full Code Here

            ValidatorLogger.LOG.beanNotPassivationCapable(bean);
        }
    }

    private void validateInterceptors(BeanManagerImpl beanManager, AbstractClassBean<?> classBean) {
        InterceptionModel interceptionModel = beanManager.getInterceptorModelRegistry().get(classBean.getAnnotated());
        if (interceptionModel != null) {
            Set<? extends InterceptorClassMetadata<?>> interceptors = interceptionModel.getAllInterceptors();
            if (interceptors.size() > 0) {
                boolean passivationCapabilityCheckRequired = beanManager.isPassivatingScope(classBean.getScope());
                for (InterceptorClassMetadata<?> interceptorMetadata : interceptors) {
                    // in the case of CDI interceptors we only need to additionally validate passivation capability (if required)
                    if (interceptorMetadata.getInterceptorFactory() instanceof CdiInterceptorFactory<?> && passivationCapabilityCheckRequired) {
View Full Code Here

        businessMethods = Beans.getInterceptableMethods(annotatedType);

        initEjbInterceptors();
        initCdiInterceptors();

        InterceptionModel interceptionModel = builder.build();
        if (interceptionModel.getAllInterceptors().size() > 0 || hasSerializationOrInvocationInterceptorMethods) {
            if (annotatedType.isFinal()) {
                throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(annotatedType.getJavaClass());
            }
            if (Reflections.isPrivate(constructor.getJavaMember())) {
                throw new DeploymentException(ValidatorLogger.LOG.notProxyablePrivateConstructor(annotatedType.getJavaClass(), constructor, annotatedType.getJavaClass()));
View Full Code Here

TOP

Related Classes of org.jboss.weld.interceptor.spi.model.InterceptionModel

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.