Package org.apache.felix.ipojo.extender

Examples of org.apache.felix.ipojo.extender.ExtensionDeclaration


                     * The factory creation job.
                     * @return the IPojoFactory
                     * @throws Exception the factory cannot be created
                     */
                    public IPojoFactory call() throws Exception {
                        ExtensionDeclaration declaration = (ExtensionDeclaration) service;
                        try {
                            // Build and start the factory instance
                            IPojoFactory factory = declaration.getFactoryBuilder().build(m_bundleContext, m_declaration.getComponentMetadata());
                            factory.addFactoryStateListener(ManagedType.this);
                            factory.start();

                            // Change the status
                            m_declaration.bind();
View Full Code Here


        public void modifiedService(ServiceReference reference, Object o) {
        }

        public void removedService(ServiceReference reference, Object o) {

            ExtensionDeclaration extensionDeclaration = (ExtensionDeclaration) o;
            // Then stop the factory
            try {
                IPojoFactory factory = m_future.get();
                // It is possible that the factory couldn't be created
                if (factory != null) {
                    factory.removeFactoryStateListener(ManagedType.this);
                    factory.dispose();
                    m_declaration.unbind(format("Extension '%s' is missing",
                                                extensionDeclaration.getExtensionName()));
                }
            } catch (InterruptedException e) {
                m_declaration.unbind("Could not create Factory", e);
            } catch (ExecutionException e) {
                m_declaration.unbind("Factory creation throw an Exception", e);
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.extender.ExtensionDeclaration

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.