/** * Calls the overriden method only if the {@link #fcInstance} field is * <tt>null</tt>. * * @return the instantiated component. * @throws InstantiationException if the component controller cannot be * instantiated. */ public Component newFcControllerInstance () throws InstantiationException { if (fcInstance == null) { fcInstance = _super_newFcControllerInstance(); } return fcInstance; }
loader = (ClassLoader)((Object[])controllerDesc)[0]; loader = (ClassLoader)getFcLoader(loader); checkFcType(type, loader); checkFcContentClass(type, (String)content, loader); return _super_newFcInstance(type, controllerDesc, contentDesc);
public void initFcController (final InitializationContext ic) throws InstantiationException { // Init the cache. cache = new HashMap(); // Call the next initFcController(InitializationContext) method. _super_initFcController(ic); }
protected Object instanciateClass( Class<?> cl ) throws InstantiationException { try { Object o = cl.getConstructor().newInstance(); return o; } catch( java.lang.InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException e ) { throw new ChainedInstantiationException(e,null,""); } }
Key key = new Key(type, controller, content); initializationContextClass = getInitializationContextClass(type, controllerDesc, contentDesc); return newComponent(initializationContextClass, contentDesc);
public Object getFcLoader (final Object loader) { if (loader == null) { if (useContextClassLoader) { return Thread.currentThread().getContextClassLoader(); } else { return getClass().getClassLoader(); } } else { return _super_getFcLoader(loader); } }
/** * Calls the overriden method and then sets the name of the created component. * The name of the created component is initialized to the name of this * template, if both components have a {@link NameController} interface * (otherwise this mixin does nothing). * * @return the instantiated component. * @throws InstantiationException if the component controller cannot be * instantiated. */ public Component newFcControllerInstance () throws InstantiationException { Component comp = _super_newFcControllerInstance(); if (_this_weaveableOptNC != null) { try { // copies the name of this template to the component, if applicable String name = _this_weaveableOptNC.getFcName(); ((NameController)comp.getFcInterface("name-controller")).setFcName(name); } catch (NoSuchInterfaceException ignored) { } } return comp; }
/** * Calls the overriden method and then sets the attributes of the created * component. The attributes of the created component are initialized from the * attributes name of this template, if the template has a {@link * CloneableAttributeController} interface, and if the created component has * an {@link org.objectweb.fractal.api.control.AttributeController} interface * (otherwise this mixin does nothing). * * @return the instantiated component. * @throws InstantiationException if the component controller cannot be * instantiated. */ public Component newFcControllerInstance () throws InstantiationException { Component comp = _super_newFcControllerInstance(); if (_this_weaveableOptCAC != null) { // copies the template's attributes into the component, if applicable try { _this_weaveableOptCAC.cloneFcAttributes( (AttributeController)comp.getFcInterface("attribute-controller")); } catch (NoSuchInterfaceException ignored) { } } return comp; }
protected Class<?> loadClassIE( String name ) throws InstantiationException { try { Class<?> cl = loadClass(name); return cl; } catch( ClassNotFoundException cnfe ) { throw new ChainedInstantiationException(cnfe,null,""); } }
loader = (ClassLoader)((Object[])controllerDesc)[0]; loader = (ClassLoader)getFcLoader(loader); checkFcType(type, loader); checkFcContentClass(type, (String)content, loader); return _super_newFcInstance(type, controllerDesc, contentDesc);
Key key = new Key(type, controller, content); initializationContextClass = getInitializationContextClass(type, controllerDesc, contentDesc); return newComponent(initializationContextClass, contentDesc);
/** * Calls the overriden method only if the {@link #fcInstance} field is * <tt>null</tt>. * * @return the instantiated component. * @throws InstantiationException if the component controller cannot be * instantiated. */ public Component newFcControllerInstance () throws InstantiationException { if (fcInstance == null) { fcInstance = _super_newFcControllerInstance(); } return fcInstance; }
public void initFcController (final InitializationContext ic) throws InstantiationException { // Init the cache. cache = new HashMap(); // Call the next initFcController(InitializationContext) method. _super_initFcController(ic); }
public Object getFcLoader (final Object loader) { if (loader == null) { if (useContextClassLoader) { return Thread.currentThread().getContextClassLoader(); } else { return getClass().getClassLoader(); } } else { return _super_getFcLoader(loader); } }
/** * Calls the overriden method and then sets the name of the created component. * The name of the created component is initialized to the name of this * template, if both components have a {@link NameController} interface * (otherwise this mixin does nothing). * * @return the instantiated component. * @throws InstantiationException if the component controller cannot be * instantiated. */ public Component newFcControllerInstance () throws InstantiationException { Component comp = _super_newFcControllerInstance(); if (_this_weaveableOptNC != null) { try { // copies the name of this template to the component, if applicable String name = _this_weaveableOptNC.getFcName(); ((NameController)comp.getFcInterface("name-controller")).setFcName(name); } catch (NoSuchInterfaceException ignored) { } } return comp; }
/** * Start the specified bundle. */ public static void startBundleIE( BundleRevisionItf bundle ) throws InstantiationException { try { bundle.start(); } catch( OSGiRevisionException e ) { throw new ChainedInstantiationException(e,null,e.getMessage()); } }
/** * Install the bundle referenced by the specified bundle jar file name. * * @param bundleJar the jar file name * @param loader * the class loader where the bundle jar file can be loaded as a * resource stream * @return the bundle */ public static BundleRevisionItf installBundleIE( String bundleJar, ClassLoader loader ) throws InstantiationException { try { return installBundle( bundleJar, loader ); } catch( OSGiRevisionException e ) { throw new ChainedInstantiationException(e, null, e.getMessage()); } }
/** * @see org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext) */ private void initFcController$0(final org.objectweb.fractal.julia.InitializationContext ic) throws org.objectweb.fractal.api.factory.InstantiationException { try { if (!((ic.getInterface("lifecycle-controller")) instanceof org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator)) { throw new java.lang.Exception(); } } catch (java.lang.Exception e) { try { ic.getInterface("/lifecycle-coordinator"); } catch (java.lang.Exception f) { throw new org.objectweb.fractal.julia.factory.ChainedInstantiationException(f, null, "The component must provide a LifeCycleCoordinator interface"); } } initFcController$1(ic); }
/** * @see org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext) */ private void initFcController$0(final org.objectweb.fractal.julia.InitializationContext ic) throws org.objectweb.fractal.api.factory.InstantiationException { try { if (!((ic.getInterface("lifecycle-controller")) instanceof org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator)) { throw new java.lang.Exception(); } } catch (java.lang.Exception e) { try { ic.getInterface("/lifecycle-coordinator"); } catch (java.lang.Exception f) { throw new org.objectweb.fractal.julia.factory.ChainedInstantiationException(f, null, "The component must provide a LifeCycleCoordinator interface"); } } initFcController$1(ic); }
/** * @see org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext) */ private void initFcController$0(final InitializationContext ic) throws InstantiationException { try { if (!((ic.getInterface("lifecycle-controller")) instanceof LifeCycleCoordinator)) { throw new Exception(); } } catch (Exception e) { try { ic.getInterface("/lifecycle-coordinator"); } catch (Exception f) { throw new ChainedInstantiationException(f , null , "The component must provide a LifeCycleCoordinator interface"); } } initFcController$1(ic); }