Package org.picocontainer

Examples of org.picocontainer.MutablePicoContainer.registerComponentInstance()


        assertSame(service, action.getService());
    }

    public void testSessionContainerExists() {
        MutablePicoContainer sessionContainer = new DefaultPicoContainer();
        sessionContainer.registerComponentInstance(TestService.class, service);

        requestMock.expects(once()).method("getAttribute").with(eq(KeyConstants.ACTIONS_CONTAINER)).will(
                returnValue(null));
        requestMock.expects(once()).method("getAttribute").with(eq(KeyConstants.REQUEST_CONTAINER)).will(
                returnValue(null));
View Full Code Here


        assertSame(service, action.getService());
    }

    public void testApplicationContainerExists() {
        MutablePicoContainer appContainer = new DefaultPicoContainer();
        appContainer.registerComponentInstance(TestService.class, service);

        requestMock.expects(once()).method("getAttribute").with(eq(KeyConstants.ACTIONS_CONTAINER)).will(
                returnValue(null));
        requestMock.expects(once()).method("getAttribute").with(eq(KeyConstants.REQUEST_CONTAINER)).will(
                returnValue(null));
View Full Code Here

 
  public void testStartStopPropagation() {
    ContainerChain chain = new ContainerChain();
    MutablePicoContainer first = new DefaultPicoContainer();
 
    first.registerComponentInstance(new MockStartable());
    chain.addContainer(first);
   
    MutablePicoContainer second = new DefaultPicoContainer();
    second.registerComponentInstance(new MockStartable());
   
View Full Code Here

 
    first.registerComponentInstance(new MockStartable());
    chain.addContainer(first);
   
    MutablePicoContainer second = new DefaultPicoContainer();
    second.registerComponentInstance(new MockStartable());
   
    chain.addContainer(second);
   
    chain.start();
    chain.stop();
View Full Code Here

    private static void registerCodeStyleManager(@NotNull Project project, @NotNull CodeStyleManager manager) {
        LOG.info("Registering code style manager '" + manager + "' for project '" + project.getName() + "'");
        MutablePicoContainer container = (MutablePicoContainer) project.getPicoContainer();
        container.unregisterComponent(CODE_STYLE_MANAGER_KEY);
        container.registerComponentInstance(CODE_STYLE_MANAGER_KEY, manager);
    }

    /*
      * NOTES: Relevant places in IDEA's code style architecture from com.intellij.codeInsight.actions.ReformatCodeProcessor:
      * CodeStyleManager.getInstance(myProject).reformatText(file, k.getStartOffset(), k.getEndOffset());else
View Full Code Here

  private static void registerCodeStyleManager(@NotNull Project project, @NotNull CodeStyleManager manager) {
    LOG.info("Registering code style manager '" + manager + "' for project '" + project.getName() + "'");
    MutablePicoContainer container = (MutablePicoContainer) project.getPicoContainer();
    container.unregisterComponent(CODE_STYLE_MANAGER_KEY);
    container.registerComponentInstance(CODE_STYLE_MANAGER_KEY, manager);
  }

}
View Full Code Here

    private static void registerCodeStyleManager(@NotNull Project project, @NotNull CodeStyleManager manager) {
        LOG.info("Registering code style manager '" + manager + "' for project '" + project.getName() + "'");
        MutablePicoContainer container = (MutablePicoContainer) project.getPicoContainer();
        container.unregisterComponent(CODE_STYLE_MANAGER_KEY);
        container.registerComponentInstance(CODE_STYLE_MANAGER_KEY, manager);
    }

    /* NOTES: Relevant places in IDEA's code style architecture

   from com.intellij.codeInsight.actions.ReformatCodeProcessor:
View Full Code Here

        {
            _container = createContainer(optionalParent, _logger);
        }

        // register existing orb
        _container.registerComponentInstance(org.omg.CORBA.ORB.class, orb);

        registerORBServices(_container);

        registerCoreServices(_container);
View Full Code Here

    {
        final ConstructorInjectionComponentAdapterFactory _nonCachingCAFactory = new ConstructorInjectionComponentAdapterFactory(); //false, new ConsoleComponentMonitor(System.out));
        final ComponentAdapterFactory _cachingCAFactory = new CachingComponentAdapterFactory(_nonCachingCAFactory);
        final MutablePicoContainer _container = new DefaultPicoContainer(_cachingCAFactory);

        _container.registerComponentInstance(ComponentAdapterFactory.class,
                _nonCachingCAFactory);

        logger.debug("Created Top Level Container");
        return _container;
    }
View Full Code Here

        _container.registerComponentImplementation(DefaultFilterFactoryDelegate.class);

        _container.registerComponentImplementation(FilterFactoryImpl.class);
       
        _container.registerComponentInstance(IContainer.class, new IContainer()
        {
            public MutablePicoContainer getContainer()
            {
                return _container;
            }
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.