Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.AnnotatedType


    /**
     * Lets perform injection of all beans which use Camel annotations
     */
    public void onInjectionTarget(@Observes ProcessInjectionTarget<?> event) {
        final InjectionTarget injectionTarget = event.getInjectionTarget();
        AnnotatedType annotatedType = event.getAnnotatedType();
        final Class<Object> beanClass = annotatedType.getJavaClass();
        // TODO this is a bit of a hack - what should the bean name be?
        final String beanName = injectionTarget.toString();
        ContextName contextName = annotatedType.getAnnotation(ContextName.class);
        final BeanAdapter adapter = createBeanAdapter(beanClass, contextName);
        if (!adapter.isEmpty()) {
            DelegateInjectionTarget newTarget = new DelegateInjectionTarget(injectionTarget) {

                @Override
View Full Code Here


        BeanManager beanManager = getBeanManager();

        CreationalContext creationalContext = beanManager.createCreationalContext(null);

        AnnotatedType annotatedType = beanManager.createAnnotatedType(instance.getClass());
        InjectionTarget injectionTarget = beanManager.createInjectionTarget(annotatedType);
        injectionTarget.inject(instance, creationalContext);
        return instance;
    }
View Full Code Here

                !(processBean.getAnnotated() instanceof AnnotatedType))
        {
            return;
        }

        AnnotatedType annotatedType = (AnnotatedType)processBean.getAnnotated();

        if (annotatedType.getJavaClass().isAnnotationPresent(ExceptionHandler.class))
        {
            final Set<AnnotatedMethod<? super T>> methods = annotatedType.getMethods();

            for (AnnotatedMethod<? super T> method : methods)
            {
                if (HandlerMethodImpl.isHandler(method))
                {
View Full Code Here

    private <T> T tryToInjectFields(T instance)
    {
        CreationalContext creationalContext = beanManager.createCreationalContext(null);

        AnnotatedType annotatedType = beanManager.createAnnotatedType(instance.getClass());
        InjectionTarget injectionTarget = beanManager.createInjectionTarget(annotatedType);
        injectionTarget.inject(instance, creationalContext);
        return instance;
    }
View Full Code Here

    public <T> T injectFields(T instance)
    {
        BeanManager beanManager = getBeanManager();
        CreationalContext creationalContext = beanManager.createCreationalContext(null);

        AnnotatedType annotatedType = beanManager.createAnnotatedType(instance.getClass());
        InjectionTarget injectionTarget = beanManager.createInjectionTarget(annotatedType);
        injectionTarget.inject(instance, creationalContext);
        return instance;
    }
View Full Code Here

  @SuppressWarnings("unchecked")
  public ErraiServiceBean(BeanManager bm, String name) {

    //use this to read annotations of the class
    AnnotatedType at = bm.createAnnotatedType(ErraiServiceImpl.class);

    //use this to create the class and inject dependencies
    this.it = bm.createInjectionTarget(at);
    this.name = name;
  }
View Full Code Here

  static final Set<Type> types = unmodifiableSet(new HashSet<Type>(asList(RequestDispatcher.class, Object.class)));

  public RequestDispatcherMetaData(final BeanManager bm, final RequestDispatcher delegate) {

    //use this to read annotations of the class
    final AnnotatedType at = bm.createAnnotatedType(delegate.getClass());

    //use this to create the class and inject dependencies
    this.it = bm.createInjectionTarget(at);

    // invocation target
View Full Code Here

  final Conversation delegate;

  public ConversationMetaData(BeanManager bm, Conversation delegate) {

    //use this to read annotations of the class
    AnnotatedType at = bm.createAnnotatedType(ErraiConversation.class);

    //use this to create the class and inject dependencies
    this.it = bm.createInjectionTarget(at);

    // invocation target
View Full Code Here

  final ErraiService delegate;

  public ServiceMetaData(BeanManager bm, ErraiService delegate) {

    //use this to read annotations of the class
    AnnotatedType at = bm.createAnnotatedType(ErraiServiceImpl.class);

    //use this to create the class and inject dependencies
    this.it = bm.createInjectionTarget(at);

    // invocation target
View Full Code Here

      }
    }

    //todo: needs to be rewritten to support @SessionScoped
    for (final Class<?> rpcIntf : managedTypes.getRpcEndpoints().keySet()) {
      final AnnotatedType type = managedTypes.getRpcEndpoints().get(rpcIntf);
      final Class beanClass = type.getJavaClass();

      log.info("Register RPC Endpoint: " + type + "(" + rpcIntf + ")");

      // TODO: Copied from errai internals, refactor at some point
      createRPCScaffolding(rpcIntf, beanClass, bus, new ResourceProvider() {
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.spi.AnnotatedType

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.