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,""); } }
protected Class<?> loadClassIE( String name ) throws InstantiationException { try { Class<?> cl = loadClass(name); return cl; } catch( ClassNotFoundException cnfe ) { throw new ChainedInstantiationException(cnfe,null,""); } }
public Component newFcInstance() throws org.objectweb.fractal.api.factory.InstantiationException { try { newFcInstance0(); } catch( org.objectweb.fractal.api.factory.InstantiationException e ) { throw e; } catch( RuntimeException e ) { throw (RuntimeException) e; } catch( Exception e ) { throw new org.objectweb.fractal.julia.factory.ChainedInstantiationException(e,null,e.getClass().getName()+": "+e.getMessage()); } return C0; }
public Component newFcInstance() throws org.objectweb.fractal.api.factory.InstantiationException { try { newFcInstance0(); } catch( org.objectweb.fractal.api.factory.InstantiationException e ) { throw e; } catch( RuntimeException e ) { throw (RuntimeException) e; } catch( Exception e ) { throw new org.objectweb.fractal.julia.factory.ChainedInstantiationException(e,null,e.getClass().getName()+": "+e.getMessage()); } return C0; }
public Component newFcInstance() throws org.objectweb.fractal.api.factory.InstantiationException { try { newFcInstance0(); } catch ( org.objectweb.fractal.api.factory.InstantiationException e ) { throw e; } catch ( java.lang.RuntimeException e ) { throw (RuntimeException) e; } catch ( java.lang.Exception e ) { throw new org.objectweb.fractal.julia.factory.ChainedInstantiationException(e,null,e.getClass().getName()+": "+e.getMessage()); } return C0; }
public Component newFcInstance() throws org.objectweb.fractal.api.factory.InstantiationException { try { newFcInstance0(); } catch ( org.objectweb.fractal.api.factory.InstantiationException e ) { throw e; } catch ( java.lang.RuntimeException e ) { throw (RuntimeException) e; } catch ( java.lang.Exception e ) { throw new org.objectweb.fractal.julia.factory.ChainedInstantiationException(e,null,e.getClass().getName()+": "+e.getMessage()); } return C0; }
public Component newFcInstance() throws org.objectweb.fractal.api.factory.InstantiationException { try { newFcInstance0(); } catch ( org.objectweb.fractal.api.factory.InstantiationException e ) { throw e; } catch ( java.lang.RuntimeException e ) { throw (RuntimeException) e; } catch ( java.lang.Exception e ) { throw new org.objectweb.fractal.julia.factory.ChainedInstantiationException(e,null,e.getClass().getName()+": "+e.getMessage()); } return C45; }
public Component newFcInstance() throws org.objectweb.fractal.api.factory.InstantiationException { try { newFcInstance0(); } catch ( org.objectweb.fractal.api.factory.InstantiationException e ) { throw e; } catch ( java.lang.RuntimeException e ) { throw (RuntimeException) e; } catch ( java.lang.Exception e ) { throw new org.objectweb.fractal.julia.factory.ChainedInstantiationException(e,null,e.getClass().getName()+": "+e.getMessage()); } return C0; }
/** * Create a new component. * * @param name * The class name of the component * @return the new component * @throws InstantiationException */ public static final synchronized Component createCompositeComponent(final String name) throws InstantiationException { try { Object factory = FractalHelper.class.getClassLoader().loadClass(name).newInstance(); if (factory instanceof Factory) { return ((Factory) factory).newFcInstance(); } else { throw new InstantiationException(name + " is not a fractal Factory"); } } catch (ClassNotFoundException e) { throw new ChainedInstantiationException(e, null, name + " is not a valid class name"); } catch (IllegalAccessException | java.lang.InstantiationException e) { throw new ChainedInstantiationException(e, null, name + " can't be instantiated"); } }
/** * 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()); } }
public Component newFcControllerInstance () throws InstantiationException { if (fcContent[1] instanceof Component) { return (Component)fcContent[1]; } GenericFactory factory; try { factory = (GenericFactory)Fractal.getBootstrapComponent(). getFcInterface("generic-factory"); } catch (InstantiationException e) { throw new ChainedInstantiationException( e, _this_weaveableC, "Cannot find the GenericFactory interface of the bootstrap " + "component, which is needed to instantiate the template"); } catch (NoSuchInterfaceException e) { throw new ChainedInstantiationException( e, _this_weaveableC, "Cannot find the GenericFactory interface of the bootstrap " + "component, which is needed to instantiate the template"); } return factory.newFcInstance(fcInstanceType, fcContent[0], fcContent[1]); }
public Component newFcControllerInstance () throws InstantiationException { if (fcContent[1] instanceof Component) { return (Component)fcContent[1]; } GenericFactory factory; try { factory = (GenericFactory)Fractal.getBootstrapComponent(). getFcInterface("generic-factory"); } catch (InstantiationException e) { throw new ChainedInstantiationException( e, _this_weaveableC, "Cannot find the GenericFactory interface of the bootstrap " + "component, which is needed to instantiate the template"); } catch (NoSuchInterfaceException e) { throw new ChainedInstantiationException( e, _this_weaveableC, "Cannot find the GenericFactory interface of the bootstrap " + "component, which is needed to instantiate the template"); } return factory.newFcInstance(fcInstanceType, fcContent[0], fcContent[1]); }
/** * 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 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); }
/** * @see org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin#initFcController(org.objectweb.fractal.julia.InitializationContext) */ public void initFcController(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$0(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); }
/** * Initializes the fields of this mixin and then calls the overriden method. * * @param ic information about the component to which this controller object * belongs. * @throws InstantiationException if the initialization fails. */ public void initFcController (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"); } } _super_initFcController(ic); }
/** * Initializes the fields of this mixin and then calls the overriden method. * * @param ic information about the component to which this controller object * belongs. * @throws InstantiationException if the initialization fails. */ public void initFcController (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"); } } _super_initFcController(ic); }
/** * Returns the tree corresponding to the given controller descriptor. This * tree is found by using the {@link #_this_weaveableL} loader. It must have * the format specified in {@link * org.objectweb.fractal.julia.asm.ContextClassGenerator} * * @param controllerDesc * a string referencing a true controller descriptor. * @return the tree corresponding to the given controller descriptor. * @throws InstantiationException * if the tree cannot be loaded. */ public Tree getFcControllerDescriptor(final Object controllerDesc) throws InstantiationException { Map definitions = new HashMap(); definitions.put("attributeControllerInterface", new Tree("QUOTE")); definitions.put("interfaceName", new Tree("QUOTE")); try { return _this_weaveableL.evalTree(_this_weaveableL .loadTree((String) controllerDesc), definitions); } catch (Exception e) { throw new ChainedInstantiationException(e, null, "Cannot load the '" + controllerDesc + "' controller descriptor"); } }