Examples of ComponentFactory


Examples of org.osgi.service.component.ComponentFactory

    {
        final ServiceReference[] refs = bundleContext.getServiceReferences( ComponentFactory.class.getName(), "("
            + ComponentConstants.COMPONENT_FACTORY + "=" + componentfactory + ")" );
        TestCase.assertNotNull( refs );
        TestCase.assertEquals( 1, refs.length );
        final ComponentFactory factory = ( ComponentFactory ) bundleContext.getService( refs[0] );
        TestCase.assertNotNull( factory );
        return factory;
    }
View Full Code Here

Examples of org.osgi.service.component.ComponentFactory

    protected ComponentInstance createFactoryComponentInstance(
        final String componentfactory, Hashtable<String, String> props)
        throws InvalidSyntaxException
    {
        final ComponentFactory factory = getComponentFactory(componentfactory);

        final ComponentInstance instance = factory.newInstance( props );
        TestCase.assertNotNull( instance );

        TestCase.assertNotNull( instance.getInstance() );
        TestCase.assertEquals( SimpleComponent.INSTANCE, instance.getInstance() );
        TestCase.assertEquals( PROP_NAME_FACTORY, SimpleComponent.INSTANCE.getProperty( PROP_NAME_FACTORY ) );
View Full Code Here

Examples of org.osgi.service.component.ComponentFactory

        // create a component instance
        final ServiceReference[] refs = bundleContext.getServiceReferences( ComponentFactory.class.getName(), "("
            + ComponentConstants.COMPONENT_FACTORY + "=" + factoryPid + ")" );
        TestCase.assertNotNull( refs );
        TestCase.assertEquals( 1, refs.length );
        final ComponentFactory factory = ( ComponentFactory ) bundleContext.getService( refs[0] );
        TestCase.assertNotNull( factory );

        Hashtable<String, String> props = new Hashtable<String, String>();
        props.put( PROP_NAME_FACTORY, PROP_NAME_FACTORY );
        final ComponentInstance instance = factory.newInstance( props );
        TestCase.assertNotNull( instance );
        TestCase.assertNotNull( instance.getInstance() );
        TestCase.assertEquals( SimpleComponent.INSTANCE, instance.getInstance() );

        // ensure instance is bound
View Full Code Here

Examples of org.picocontainer.ComponentFactory

                                                   Properties componentProperties,
                                                   Object componentKey,
                                                   Class componentImplementation,
                                                   Parameter... parameters) throws PicoCompositionException {
        List<BehaviorFactory> list = new ArrayList<BehaviorFactory>();
        ComponentFactory lastFactory = makeInjectionFactory();
        processSynchronizing(componentProperties, list);
        processLocking(componentProperties, list);
        processPropertyApplying(componentProperties, list);
        processAutomatic(componentProperties, list);
        processImplementationHiding(componentProperties, list);
        processCaching(componentProperties, componentImplementation, list);
        processGuarding(componentProperties, componentImplementation, list);

        //Instantiate Chain of ComponentFactories
        for (ComponentFactory componentFactory : list) {
            if (lastFactory != null && componentFactory instanceof BehaviorFactory) {
                ((BehaviorFactory)componentFactory).wrap(lastFactory);
            }
            lastFactory = componentFactory;
        }

        return lastFactory.createComponentAdapter(componentMonitor,
                                                  lifecycleStrategy,
                                                  componentProperties,
                                                  componentKey,
                                                  componentImplementation,
                                                  parameters);
View Full Code Here

Examples of org.springframework.richclient.factory.ComponentFactory

        createJcbEnableHtml();
        setupListeners();
    }

    public JPanel getPanel() {
        ComponentFactory cf = getComponentFactory();
        JLabel label = cf.createLabelFor(getMessage("annotationToolWindow.annotations.comboBox.label"), this.jcbAnnotations);
        GridBagLayoutBuilder builder = new GridBagLayoutBuilder();
        builder.setAutoSpanLastComponent(false);
        builder.setDefaultInsets(new Insets(5, 5, 5, 5));
        builder.appendLabel(label).append(this.jcbAnnotations, 1, 1, false, false).append(Box.createHorizontalStrut(10), 1, 1, true, false).append(jcbEnableHtml, 1, 1, false, false, new Insets(5, 5, 5, 5)).nextLine();
        builder.append(cf.createScrollPane(jetDocumentation, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), 4, 1, true, true).nextLine();

        return builder.getPanel();
    }
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.