/** * Create a new component. * * @param name * The class name of the component * @return the new component * @throws ADLException * : occurs when the framework of Petals is incorrect */ public static final synchronized Component createNewComponent(final String name) throws ADLException { return (Component) getFactory().newComponent(name, context); }
public Object newComponentType(final String name, final Map context) throws ADLException { for (final Factory factory : factoryItfs.values()) { try { return factory.newComponentType(name, context); } catch (final ADLException e) { } } throw new CompilerError(GenericErrors.INTERNAL_ERROR, "Coud not instantiate the plugin '" + name + "'"); }
/** * Create a new component. * * @param name * The class name of the component * @return the new component * @throws ADLException : * occurs when the framework of Petals is incorrect */ public Component createNewComponent(final String name) throws ADLException { return (Component) this.getFactory().newComponent(name, FractalHelper.context); }
/** * Create a new component. * * @param name * The class name of the component * @param context * The map of parameters for the component * @return the new component * @throws ADLException * : occurs when the framework of Petals is incorrect */ public static final synchronized Component createNewComponent(final String name, Map<Object, Object> context) throws ADLException { return (Component) getFactory().newComponent(name, context); }
/** * Iterates over the list of client factories until one of them successfully * instantiates the requested plugin component. If no client factories manage * to instantiate the requested component, then raises a {@link CompilerError} * * @param name the name of the component to be created. * @param context optional additional information. * @return the component that has been created. The type of this result * depends on the implementation of this interface: it can be a * Fractal component reference (if this factory creates Fractal * components), it can be an identifier (if this factory generates * source code that will create components, instead of directly * creating components), etc. * @throws ADLException if a problem occurs during the creation of the * component. */ public Object newComponent(final String name, final Map context) throws ADLException { for (final Factory factory : factoryItfs.values()) { try { return factory.newComponent(name, context); } catch (final ADLException e) { } } throw new CompilerError(GenericErrors.INTERNAL_ERROR, "Coud not instantiate the plugin '" + name + "'"); }
context.put(PLUGIN_FACTORY_BACKEND, "Java"); plugin = pluginFactoryItf.newComponent(pluginADL, context); pluginLogger.fine("Plugin instantiated using FractalADL factory."); } catch (final ADLException e) {
+ configuration); Component bf = (Component) adlFactory.newComponent( configuration, contextMap); Fractal.getLifeCycleController(bf).startFc();
final Component plugin = (Component) pluginFactoryItf.newComponent( pluginADL, context);
/** * Return the the default configuration of the BindingFactory. * * @return * @throws BindingFactoryException */ public static synchronized BindingFactory getBindingFactory() throws BindingFactoryException { try { if (SINGLETON == null) { if (adlFactory == null) { adlFactory = FactoryFactory .getFactory(FactoryFactory.FRACTAL_BACKEND); } Component bf = (Component) adlFactory.newComponent( "org.objectweb.fractal.bf.BindingFactoryComp", new HashMap<String, String>()); Fractal.getLifeCycleController(bf).startFc(); SINGLETON = (BindingFactory) bf .getFcInterface("binding-factory"); } } catch (Exception e) { throw new BindingFactoryException( "Some error occurred while retrieving the BindingFactory", e); } return SINGLETON; }
fractalAdlFactory = FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); final Component lazyLoadedPlugin = (Component) fractalAdlFactory.newComponent(def, hints);
component = (Component) fractalAdlFactory.newComponent(definition, context);