Package org.apache.felix.ipojo

Examples of org.apache.felix.ipojo.HandlerManagerFactory


        ServiceReference sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
        Architecture arch = (Architecture) getContext().getService(sr_arch);
        assertEquals("Check validity", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
       
        // Kill the handler factory
        HandlerManagerFactory f = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "check");
        f.stop();
       
        sr = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "HandlerTest-1");
        assertNull("Check the check service unavailability", sr);
       
        sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
        assertNull("Check the architecture unavailability", sr_arch);
       
        // The instance is disposed, restart the handler
        f.start();
       
        Properties props = new Properties();
        props.put("instance.name","HandlerTest-1");
        props.put("csh.simple", "simple");
        Properties p = new Properties();
View Full Code Here


        }
    }
   
    public void testBadHandlerFactory1() {
        try {
            new HandlerManagerFactory(getContext(), getElementHandlerFactoryWithNoClassName());
            fail("An handler factory with no class name must be rejected");
        } catch (ConfigurationException e) {
          // OK.  
        }
    }
View Full Code Here

        }
    }
   
    public void testBadHandlerFactory2() {
        try {
            new HandlerManagerFactory(getContext(), getElementHandlerFactoryWithNoName());
            fail("An handler factory with no name must be rejected");
        } catch (ConfigurationException e) {
          // OK.  
        }
    }
View Full Code Here

        assertEquals("Check factory state -1", Factory.VALID, cf.getState());

        ServiceReference ref_arch = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "SimpleInstance");
        assertNotNull("Check Architecture availability -1", ref_arch);

        HandlerManagerFactory hf = (HandlerManagerFactory) ipojoHelper.getHandlerFactory("controller");
        assertNotNull("Check handler availability -1", hf);
        assertEquals("Check handler state -1", Factory.VALID, hf.getState());

        // Stop the handler
        hf.stop();
        HandlerManagerFactory hf2 = (HandlerManagerFactory) ipojoHelper.getFactoryHelper().getHandlerFactory("controller", 1, false);
        assertNull("Check handler availability -2", hf2);

        // Check the factory invalidity
        cf = (ComponentFactory) ipojoHelper.getFactory("org.apache.felix.ipojo.runtime.core.components.SimpleType");
        assertNotNull("Check factory availability -2", cf);
View Full Code Here

        ServiceReference sr_arch = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "HandlerTest-1");
        Architecture arch = (Architecture) osgiHelper.getRawServiceObject(sr_arch);
        assertEquals("Check validity", arch.getInstanceDescription().getState(), ComponentInstance.VALID);

        // Kill the handler factory
        HandlerManagerFactory f = (HandlerManagerFactory) ipojoHelper.getHandlerFactory("check");
        f.stop();

        boolean av = ipojoHelper.isServiceAvailableByName(CheckService.class.getName(), "HandlerTest-1");
        assertFalse("Check the check service unavailability", av);

        boolean av2 = ipojoHelper.isServiceAvailableByName(Architecture.class.getName(), "HandlerTest-1");
        assertFalse("Check the architecture unavailability", av2);

        // The instance is disposed, restart the handler
        f.start();

        Properties props = new Properties();
        props.put("instance.name", "HandlerTest-1");
        props.put("csh.simple", "simple");
        Properties p = new Properties();
View Full Code Here

      assertEquals("Check factory state -1", Factory.VALID, cf.getState());
     
      ServiceReference ref_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "SimpleInstance");
      assertNotNull("Check Architecture availability -1", ref_arch);
     
        HandlerManagerFactory hf = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller");
        assertNotNull("Check handler availability -1", hf);
        assertEquals("Check handler state -1", Factory.VALID, hf.getState());
       
        // Stop the handler
        hf.stop();
        HandlerManagerFactory hf2 = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller");
        assertNull("Check handler availability -2", hf2);
       
        // Check the factory invalidity
        cf = (ComponentFactory) Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.SimpleType");
        assertNotNull("Check factory availability -2", cf);
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.HandlerManagerFactory

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.