Package org.apache.tuscany.sca.extensibility

Examples of org.apache.tuscany.sca.extensibility.ServiceDeclaration.loadClass()


    private BundleContext init() throws Exception {
        if (framework != null) {
            throw new IllegalStateException("The framework is started already");
        }
        ServiceDeclaration sd = ServiceDiscovery.getInstance().getServiceDeclaration(FrameworkFactory.class.getName());
        Class<?> factoryCls = sd.loadClass();
        FrameworkFactory factory = (FrameworkFactory)factoryCls.newInstance();
        Map<Object, Object> props = new HashMap<Object, Object>();
        props.put("osgi.clean", "true");
        props.put("osgi.instance.area", new File("target/workspace").toURI().toString());
        props.put("osgi.install.area", new File("target/eclipse").toURI().toString());
View Full Code Here


            try {
                ServiceDeclaration utilityDeclaration =
                    registry.getServiceDiscovery().getServiceDeclaration(utilityType.getName());
                Class<?> utilityClass = null;
                if (utilityDeclaration != null) {
                    utilityClass = utilityDeclaration.loadClass();
                } else if (isConcreteClass(utilityType)) {
                    utilityClass = utilityType;
                    key = utilityType;
                }
                if (utilityClass != null) {
View Full Code Here

                if (factoryDeclaration != null) {
                    try {
                        // Constructor taking the extension point registry
                        factory = newInstance(registry, factoryDeclaration);
                    } catch (NoSuchMethodException e) {
                        factory = newInstance(factoryDeclaration.loadClass(), FactoryExtensionPoint.class, this);
                    }

                    // Cache the loaded factory
                    factories.put(factoryInterface, factory);
View Full Code Here

            // Dynamically load a factory class declared under META-INF/services
            try {
                ServiceDeclaration factoryDeclaration = registry.getServiceDiscovery().getServiceDeclaration(factoryInterface.getName());
                if (factoryDeclaration != null) {
                    Class<?> factoryClass = factoryDeclaration.loadClass();
           
                    // Default empty constructor
                    Constructor<?> constructor = factoryClass.getConstructor(ExtensionPointRegistry.class);
                    factory = constructor.newInstance(registry);
           
View Full Code Here

                if (factoryDeclaration != null) {
                    try {
                        // Constructor taking the extension point registry
                        factory = newInstance(registry, factoryDeclaration);
                    } catch (NoSuchMethodException e) {
                        factory = newInstance(factoryDeclaration.loadClass(), FactoryExtensionPoint.class, this);
                    }

                    // Cache the loaded factory
                    factories.put(factoryInterface, factory);
View Full Code Here

            // Dynamically load a factory class declared under META-INF/services
            try {
                ServiceDeclaration factoryDeclaration = registry.getServiceDiscovery().getServiceDeclaration(factoryInterface.getName());
                if (factoryDeclaration != null) {
                    Class<?> factoryClass = factoryDeclaration.loadClass();
           
                    // Default empty constructor
                    Constructor<?> constructor = factoryClass.getConstructor(ExtensionPointRegistry.class);
                    factory = constructor.newInstance(registry);
           
View Full Code Here

                if (factoryDeclaration != null) {
                    try {
                        // Constructor taking the extension point registry
                        factory = newInstance(registry, factoryDeclaration);
                    } catch (NoSuchMethodException e) {
                        factory = newInstance(factoryDeclaration.loadClass(), FactoryExtensionPoint.class, this);
                    }

                    // Cache the loaded factory
                    factories.put(factoryInterface, factory);
View Full Code Here

            try {
                ServiceDeclaration utilityDeclaration =
                    registry.getServiceDiscovery().getServiceDeclaration(utilityType.getName());
                Class<?> utilityClass = null;
                if (utilityDeclaration != null) {
                    utilityClass = utilityDeclaration.loadClass();
                } else if (isConcreteClass(utilityType)) {
                    utilityClass = utilityType;
                    key = utilityType;
                }
                if (utilityClass != null) {
View Full Code Here

    private BundleContext init() throws Exception {
        if (framework != null) {
            throw new IllegalStateException("The framework is started already");
        }
        ServiceDeclaration sd = ServiceDiscovery.getInstance().getServiceDeclaration(FrameworkFactory.class.getName());
        Class<?> factoryCls = sd.loadClass();
        FrameworkFactory factory = (FrameworkFactory)factoryCls.newInstance();
        Map<Object, Object> props = new HashMap<Object, Object>();
        props.put("osgi.clean", "true");
        props.put("osgi.instance.area", new File("target/workspace").toURI().toString());
        props.put("osgi.install.area", new File("target/eclipse").toURI().toString());
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.