Examples of ComponentFactory


Examples of org.apache.felix.ipojo.ComponentFactory

        Assert.assertEquals("Is valid ?", ComponentInstance.VALID, arch.getInstanceDescription().getState());
  }

  public void testRevalidationOnReconfigurationOfTheController() {
    ComponentFactory factory = (ComponentFactory) Utils.getFactoryByName(getContext(),
        "org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType3");

    // First inject a configuration triggering an exception of the validate method.
    Properties props = new Properties();
    props.put("controller", "false");
    ComponentInstance ci = null;
    try {
      ci = factory.createComponentInstance(props);
    } catch (UnacceptableConfiguration e) {
      e.printStackTrace();
    } catch (MissingHandlerException e) {
      e.printStackTrace();
    } catch (ConfigurationException e) {
View Full Code Here

Examples of org.apache.felix.ipojo.ComponentFactory

        return null;
    }
   
    public void testNoField() {
        try {
            ComponentFactory cf = new ComponentFactory(getContext(), getNoFieldController());
            cf.start();
            cf.stop();
            fail("A lifecycle controller with a missing field must be rejected " + cf);
        } catch (Exception e) {
            // OK
        }
    }
View Full Code Here

Examples of org.apache.felix.ipojo.ComponentFactory

        }
    }
   
    public void testBadField() {
        try {
            ComponentFactory cf = new ComponentFactory(getContext(), getBadFieldController());
            cf.start();
            cf.stop();
            fail("A lifecycle controller with a bad field must be rejected " + cf);
        } catch (Exception e) {
            // OK
        }
    }
View Full Code Here

Examples of org.apache.felix.ipojo.ComponentFactory

        return elem;       
    }
   
    public void testBadFactory() {
        try {
            new ComponentFactory(getContext(), getElementFactoryWithNoClassName());
            fail("A factory with no class name must be rejected");
        } catch (ConfigurationException e) {
          // OK.  
        }
    }
View Full Code Here

Examples of org.apache.felix.ipojo.ComponentFactory

   
    public void testNoManipulationMetadata() {
        Element elem = new Element("component", "");
        elem.addAttribute(new Attribute("classname", "org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"));
        try {
            ComponentFactory fact = new ComponentFactory(getContext(), elem);
            fact.stop();
            fail("A factory with no manipulation metadata must be rejected");
        } catch (ConfigurationException e) {
          // OK.
        }
    }
View Full Code Here

Examples of org.apache.isis.viewer.html.component.ComponentFactory

        for (int i = 0; i < crumbs.length; i++) {
            names[i] = crumbs[i].title();
        }

        final ComponentFactory factory = context.getComponentFactory();
        final Component breadCrumbs = factory.createBreadCrumbs(names, isLinked);

        page.setCrumbs(breadCrumbs);
    }
View Full Code Here

Examples of org.apache.isis.viewer.wicket.ui.ComponentFactory

    private void addOrReplaceIconAndTitle(ObjectAdapter pendingOrCurrentAdapter) {
        final EntityModel entityModelForLink = new EntityModel(pendingOrCurrentAdapter);
        entityModelForLink.setContextAdapterIfAny(getScalarModel().getContextAdapterIfAny());
        entityModelForLink.setRenderingHint(getScalarModel().getRenderingHint());
        final ComponentFactory componentFactory = getComponentFactoryRegistry().findComponentFactory(ComponentType.ENTITY_ICON_AND_TITLE, entityModelForLink);
        final Component component = componentFactory.createComponent(entityModelForLink);
        addOrReplace(component);
    }
View Full Code Here

Examples of org.codehaus.loom.components.util.factory.ComponentFactory

        throws Exception
    {
        final PartitionTemplate metaData = m_assembler.buildAssembly( parameters );
        final ClassLoader classLoader =
            (ClassLoader)parameters.get( ContainerConstants.ASSEMBLY_CLASSLOADER );
        final ComponentFactory factory = new DefaultComponentFactory( classLoader, getLogger() );

        return assembleSarProfile( metaData, factory, classLoader );
    }
View Full Code Here

Examples of org.codehaus.plexus.component.factory.ComponentFactory

    public Object createComponentInstance( ComponentDescriptor componentDescriptor )
        throws ComponentInstantiationException, ComponentLifecycleException
    {
        String componentFactoryId = componentDescriptor.getComponentFactory();

        ComponentFactory componentFactory = null;
        Object component = null;

        try
        {
            if ( componentFactoryId != null )
            {
                componentFactory = componentFactoryManager.findComponentFactory( componentFactoryId );
            }
            else
            {
                componentFactory = componentFactoryManager.getDefaultComponentFactory();
            }

            component = componentFactory.newInstance( componentDescriptor, plexusRealm, this );
        }
        catch ( UndefinedComponentFactoryException e )
        {
            throw new ComponentInstantiationException( "Unable to create component as factory '" + componentFactoryId + "' could not be found", e );
        }
View Full Code Here

Examples of org.jboss.as.ee.component.ComponentFactory

    }

    @Override
    public ComponentConfiguration createConfiguration(final ClassIndex classIndex, final ClassLoader moduleClassLoader, final ModuleLoader moduleLoader) {
        final ComponentConfiguration configuration =  super.createConfiguration(classIndex, moduleClassLoader, moduleLoader);
        configuration.setInstanceFactory(new ComponentFactory() {
            @Override
            public ManagedReference create(final InterceptorContext context) {
                return new ManagedReference() {
                    @Override
                    public void release() {
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.