Examples of ConstructorInjectionComponentAdapter


Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapter

   
    container.registerComponentImplementation(CommandsMenuActions.EditOpeners.class);
    container.registerComponentImplementation(CommandsMenuActions.SelectOpener.class);
    container.registerComponentImplementation(CommandsMenuActions.ShowOpenersMenu.class);
    // this one is not cached because we need 2 instances of it - in the Commands menu and in the context menu
    container.registerComponent(new ConstructorInjectionComponentAdapter(OpenersMenu.class, OpenersMenu.class));
   
    shell.setMenuBar(mainMenu);   
    createMainMenuItems(mainMenu);
       
    createCommandsMenuItems(resultsContextMenu);
View Full Code Here

Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapter

            Class classType = loader.loadClass(type);
            if (key == null)
            {
               if (component.isMultiInstance())
               {
                  container.registerComponent(new ConstructorInjectionComponentAdapter(classType, classType));
                  LOG.debug("===>>> Thread local component " + classType.getName() + " registered.");
               }
               else
               {
                  container.registerComponentImplementation(classType);
               }
            }
            else
            {
               try
               {
                  Class keyType = loader.loadClass(key);
                  if (component.isMultiInstance())
                  {
                     container.registerComponent(new ConstructorInjectionComponentAdapter(keyType, classType));
                     LOG.debug("===>>> Thread local component " + classType.getName() + " registered.");
                  }
                  else
                  {
                     container.registerComponentImplementation(keyType, classType);
View Full Code Here

Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapter

            Class classType = loader.loadClass(type);
            if (key == null)
            {
               if (component.isMultiInstance())
               {
                  container.registerComponent(new ConstructorInjectionComponentAdapter(classType, classType));
                  log.debug("===>>> Thread local component " + classType.getName() + " registered.");
               }
               else
               {
                  container.registerComponentImplementation(classType);
               }
            }
            else
            {
               try
               {
                  Class keyType = loader.loadClass(key);
                  if (component.isMultiInstance())
                  {
                     container.registerComponent(new ConstructorInjectionComponentAdapter(keyType, classType));
                     log.debug("===>>> Thread local component " + classType.getName() + " registered.");
                  }
                  else
                  {
                     container.registerComponentImplementation(keyType, classType);
View Full Code Here

Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapter

    private static void registerCoreServices(final MutablePicoContainer container)
    {
        container.registerComponent(new CachingComponentAdapter(
                new PushTaskExecutorFactoryComponentAdapter(
                        new ConstructorInjectionComponentAdapter(PushTaskExecutorFactory.class, ConfigurablePushTaskExecutorFactory.class))));

        // etcl evaluator
        container.registerComponentImplementation(DefaultETCLEvaluator.class);

        // message factory
View Full Code Here

Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapter

    private static void registerEvaluationContextFactory(final MutablePicoContainer container)
    {
        // PoolingEvaluationContextFactory depends on DefaultEvaluationContextFactory.
        // however both implement the same interface users depend on which causes an ambiguity.
        // therefore DefaultEvaluationContextFactory should be only visible to PoolingEvaluationContextFactory.
        final ConstructorInjectionComponentAdapter _serviceCA =
            new ConstructorInjectionComponentAdapter(DefaultEvaluationContextFactory.class, DefaultEvaluationContextFactory.class);

        final ConstructorInjectionComponentAdapter _poolingServiceCA =
            new ConstructorInjectionComponentAdapter(EvaluationContextFactory.class, PoolingEvaluationContextFactory.class, new Parameter[] {BasicComponentParameter.BASIC_DEFAULT, new BasicComponentParameter(DefaultEvaluationContextFactory.class)});

        final LocalParameterComponentAdapter _localParamCA =
            new LocalParameterComponentAdapter(_poolingServiceCA, new ComponentAdapter[] {_serviceCA});

        final ComponentAdapter _cachingCA =
View Full Code Here

Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapter

            return null;
        }
       
        if ( o instanceof Class ) {
            //TODO: determine which form of injection to use
            return new ConstructorInjectionComponentAdapter( componentKey, (Class) o );
        }
       
        return new InstanceComponentAdapter( componentKey, o );
    }
View Full Code Here

Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapter

     *
     */
    public Binding loadBinding(QName qName, Class bindingClass, MutablePicoContainer context) {
        //instantiate within the given context
        ComponentAdapter adapter =
            new ConstructorInjectionComponentAdapter( qName, bindingClass );
        return (Binding) adapter.getComponentInstance( context );
    }
View Full Code Here

Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapter

        if ( o instanceof ComponentAdapter ) {
            return (ComponentAdapter) o;
        }
       
        if ( o instanceof Class ) {
            return new ConstructorInjectionComponentAdapter( null, (Class) o );
        }
       
        return new InstanceComponentAdapter( null, o );
    }
View Full Code Here

Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapter

{
    private DefaultPicoContainer picoContainer_;
   
    public void testCreateWithoutDeps() throws Exception
    {
        ConstructorInjectionComponentAdapter ca = new ConstructorInjectionComponentAdapter(Service.class, DefaultService.class);
       
        picoContainer_.registerComponent(new LocalParameterComponentAdapter(ca, new ComponentAdapter[0]));
       
        assertNotNull(picoContainer_.getComponentInstanceOfType(Service.class));
    }
View Full Code Here

Examples of org.picocontainer.defaults.ConstructorInjectionComponentAdapter

        assertNotNull(picoContainer_.getComponentInstanceOfType(Service.class));
    }
   
    public void testCreateFailsWhenDepsNotResolvable() throws Exception
    {
        ConstructorInjectionComponentAdapter ca = new ConstructorInjectionComponentAdapter(Service.class, DecoratedService.class);
       
        picoContainer_.registerComponent(new LocalParameterComponentAdapter(ca, new ComponentAdapter[0]));
       
        try
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.