Package org.jboss.errai.ioc.rebind.ioc

Examples of org.jboss.errai.ioc.rebind.ioc.InjectionContext


      }
    }, Rule.after(EntryPoint.class, ApplicationScoped.class, Singleton.class));

    procFactory.registerHandler(ApplicationScoped.class, new AnnotationHandler<ApplicationScoped>() {
      public boolean handle(InjectableInstance instance, ApplicationScoped annotation, IOCProcessingContext context) {
        InjectionContext injectionContext = injectorFactory.getInjectionContext();
        TypeInjector i = (TypeInjector) instance.getInjector();

        if (!i.isInjected()) {
          // instantiate the bean.
          i.setSingleton(true);
          i.getType(injectionContext, null);
          injectionContext.registerInjector(i);
        }
        return true;
      }
    });
  }
View Full Code Here


    super(decoratesWith);
  }

  @Override
  public Statement generateDecorator(InjectableInstance<Service> decContext) {
    final InjectionContext ctx = decContext.getInjectionContext();

    /**
     * Ensure the the container generates a stub to internally expose the field if it's private.
     */
    decContext.ensureMemberExposed();

    /**
     * Get an instance of the message bus.
     */
    final MetaClass busClass = MetaClassFactory.get(decContext.getInjectionContext()
            .getProcessingContext().loadClassType(MessageBus.class));

    final Statement busHandle = ctx.getInjector(busClass).getType(ctx, decContext);

    /**
     * Figure out the service name;
     */
    final String svcName = decContext.getAnnotation().value().equals("")
View Full Code Here

    super(decoratesWith);
  }

  @Override
  public Statement generateDecorator(InjectableInstance<Service> decContext) {
    final InjectionContext ctx = decContext.getInjectionContext();

    /**
     * Ensure the the container generates a stub to internally expose the field if it's private.
     */
    decContext.ensureMemberExposed();

    final Statement busHandle = ctx.getInjector(MessageBus.class).getType(ctx, decContext);

    /**
     * Figure out the service name;
     */
    final String svcName = decContext.getAnnotation().value().equals("")
View Full Code Here

        super(decoratesWith);
    }

    @Override
    public String generateDecorator(InjectionPoint<Service> decContext) {
        final InjectionContext ctx = decContext.getInjectionContext();

        /**
         * Get an instance of the message bus.
         */
        final String inj = ctx.getInjector(decContext.getInjectionContext()
                .getProcessingContext().loadClassType(MessageBus.class)).getType(ctx, decContext);

        /**
         * Figure out the service name;
         */
 
View Full Code Here

    super(decoratesWith);
  }

  @Override
  public Statement generateDecorator(InjectableInstance<Service> decContext) {
    final InjectionContext ctx = decContext.getInjectionContext();

    /**
     * Ensure the the container generates a stub to internally expose the field if it's private.
     */
    decContext.ensureMemberExposed();

    /**
     * Get an instance of the message bus.
     */
    final MetaClass busClass = MetaClassFactory.get(decContext.getInjectionContext()
            .getProcessingContext().loadClassType(MessageBus.class));

    final Statement busHandle = ctx.getInjector(busClass).getType(ctx, decContext);

    /**
     * Figure out the service name;
     */
    final String svcName = decContext.getAnnotation().value().equals("")
View Full Code Here

    super(decoratesWith);
  }

  @Override
  public Statement generateDecorator(InjectableInstance<Service> decContext) {
    final InjectionContext ctx = decContext.getInjectionContext();

    /**
     * Ensure the the container generates a stub to internally expose the field if it's private.
     */
    decContext.ensureMemberExposed();

    final Statement busHandle = ctx.getInjector(MessageBus.class).getType(ctx, decContext);

    /**
     * Figure out the service name;
     */
    final String svcName = decContext.getAnnotation().value().equals("")
View Full Code Here

    public ConversationDecorator(Class<ConversationContext> decoratesWith) {
        super(decoratesWith);
    }

    public String generateDecorator(InjectionPoint<ConversationContext> injectionPoint) {
        final InjectionContext ctx = injectionPoint.getInjectionContext();

        final JField field = injectionPoint.getField();
        final ConversationContext context = field.getAnnotation(ConversationContext.class);

        String varName = injectionPoint.getInjector().getVarName();
View Full Code Here

        super(decoratesWith);
    }

    @Override
    public String generateDecorator(InjectionPoint<Observes> injectionPoint) {
        final InjectionContext ctx = injectionPoint.getInjectionContext();

        final JMethod method = injectionPoint.getMethod();
        final JParameter parm = injectionPoint.getParm();

        String parmClassName = parm.getType().getQualifiedSourceName();
        String varName = injectionPoint.getInjector().getVarName();


        // Get an instance of the message bus.
        final String messageBusInst = ctx.getInjector(ctx
                .getProcessingContext().loadClassType(MessageBus.class)).getType(ctx, injectionPoint);

        return messageBusInst + ".subscribe(\"cdi.event:" + parmClassName + "\", new " + MessageCallback.class.getName() + "() {\n" +
                "                    public void callback(" + Message.class.getName() + " message) {\n" +
                "                        java.lang.Object response = message.get(" + parmClassName + ".class, " + CDIProtocol.class.getName() + "." + CDIProtocol.OBJECT_REF.name() + ");\n" +
View Full Code Here

TOP

Related Classes of org.jboss.errai.ioc.rebind.ioc.InjectionContext

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.