Package org.apache.tuscany.sca.core

Examples of org.apache.tuscany.sca.core.ModuleActivator


        try {
          Set<ServiceDeclaration> moduleActivators = ServiceDiscovery.getInstance().getServiceDeclarations(ModuleActivator.class);
         
            for (ServiceDeclaration moduleDeclarator : moduleActivators) {
              Class<?> moduleClass = moduleDeclarator.loadClass();
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
View Full Code Here


                if (moduleClasses.contains(moduleDeclarator.getClassName())) {
                    continue;
                }
                moduleClasses.add(moduleDeclarator.getClassName());
                Class<?> moduleClass = moduleDeclarator.loadClass();
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
View Full Code Here

                if (moduleClasses.contains(moduleDeclarator.getClassName())) {
                    continue;
                }
                moduleClasses.add(moduleDeclarator.getClassName());
                Class<?> moduleClass = moduleDeclarator.loadClass();
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
View Full Code Here

                if (moduleClasses.contains(moduleDeclarator.getClassName())) {
                    continue;
                }
                moduleClasses.add(moduleDeclarator.getClassName());
                Class<?> moduleClass = moduleDeclarator.loadClass();
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
View Full Code Here

                if (moduleClasses.contains(moduleDeclarator.getClassName())) {
                    continue;
                }
                moduleClasses.add(moduleDeclarator.getClassName());
                Class<?> moduleClass = moduleDeclarator.loadClass();
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
View Full Code Here

                if (moduleClasses.contains(moduleDeclarator.getClassName())) {
                    continue;
                }
                moduleClasses.add(moduleDeclarator.getClassName());
                Class<?> moduleClass = moduleDeclarator.loadClass();
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
View Full Code Here

                if (moduleClasses.contains(moduleDeclarator.getClassName())) {
                    continue;
                }
                moduleClasses.add(moduleDeclarator.getClassName());
                Class<?> moduleClass = moduleDeclarator.loadClass();
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
View Full Code Here

        modules = new ArrayList<ModuleActivator>();
        try {
            List<String> classNames = ServiceConfigurationUtil.getServiceClassNames(classLoader, ModuleActivator.class.getName());
            for (String className : classNames) {      
                Class moduleClass = Class.forName(className, true, classLoader);
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
View Full Code Here

        for (ServiceRegistration reg : services.values()) {
            ServiceReference ref = reg.getReference();
            if (ref != null) {
                Object service = bundleContext.getService(ref);
                if (service instanceof ModuleActivator) {
                    ModuleActivator activator = (ModuleActivator)service;
                    map.put(activator, activator);
                }
                reg.unregister();
            }
        }
        for (ModuleActivator activator : map.values()) {
            activator.stop(this);
        }
        services.clear();
    }
View Full Code Here

                if (moduleClasses.contains(moduleDeclarator.getClassName())) {
                    continue;
                }
                moduleClasses.add(moduleDeclarator.getClassName());
                Class<?> moduleClass = moduleDeclarator.loadClass();
                ModuleActivator module = (ModuleActivator)moduleClass.newInstance();
                modules.add(module);
            }
        } catch (IOException e) {
            throw new ActivationException(e);
        } catch (ClassNotFoundException e) {
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.core.ModuleActivator

Copyright © 2018 www.massapicom. 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.