Examples of ManagedService


Examples of org.osgi.service.cm.ManagedService

      // Configuration of baz
      Properties conf = new Properties();
      conf.put("baz", "zab");
      conf.put("foo", "oof");
      conf.put("bar", new Integer(0));
      ManagedService ms = (ManagedService) getContext().getService(msRef);
      try {
        ms.updated(conf);
      } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
     
      // Re-check props
      fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
      fooP = (String) fooRef.getProperty("foo");
View Full Code Here

Examples of org.osgi.service.cm.ManagedService

        // Configuration of baz
        Properties conf = new Properties();
        conf.put("baz", "zab");
        conf.put("foo", "oof");
        conf.put("bar", new Integer(0));
        ManagedService ms = (ManagedService) getContext().getService(msRef);
        try {
            ms.updated(conf);
        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
       
        // Recheck props
        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
        fooP = (String) fooRef.getProperty("foo");
View Full Code Here

Examples of org.osgi.service.cm.ManagedService

        // Configuration of baz
        Properties conf = new Properties();
        conf.put("baz", "zab");
        conf.put("foo", "oof");
        conf.put("bar", new Integer(0));
        ManagedService ms = (ManagedService) getContext().getService(msRef);
        try {
            ms.updated(conf);
        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
       
        // Recheck props
        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
        fooP = (String) fooRef.getProperty("foo");
View Full Code Here

Examples of org.osgi.service.cm.ManagedService

    Properties conf = new Properties();
    conf.put("baz", "zab");
    conf.put("foo", "oof");
    conf.put("bar", "0");
        assertEquals("Check instance1 state (2)", ComponentInstance.VALID,instance1.getState());
    ManagedService ms = (ManagedService) getContext().getService(msRef);
   
    PrimitiveHandler ph = (PrimitiveHandler) ms;
    assertSame("Check the correct instance", ph.getInstanceManager(), instance1);
   
    try {
      ms.updated(conf);
    } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
    assertEquals("Check instance1 state (3)", ComponentInstance.VALID,instance1.getState());
   
    // Recheck props
    fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
View Full Code Here

Examples of org.osgi.service.cm.ManagedService

        // Configuration of baz
        Properties conf = new Properties();
        conf.put("baz", "zab");
        conf.put("foo", "oof");
        conf.put("bar", "0");
        ManagedService ms = (ManagedService) getContext().getService(msRef);
        try {
            ms.updated(conf);
        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
       
        // Recheck props
        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
        fooP = (String) fooRef.getProperty("foo");
View Full Code Here

Examples of org.osgi.service.cm.ManagedService

    conf.put("baz", "zab");
    conf.put("foo", "foo");
    conf.put("bar", new Integer(2));
    conf.put("propagated1", "propagated");
    conf.put("propagated2", new Integer(1));
    ManagedService ms = (ManagedService) getContext().getService(msRef);
    try {
      ms.updated(conf);
    } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
   
    // Recheck props
    fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
    fooP = (String) fooRef.getProperty("foo");
View Full Code Here

Examples of org.osgi.service.cm.ManagedService

        conf.put("baz", "zab");
        conf.put("foo", "foo");
        conf.put("bar", new Integer(2));
        conf.put("propagated1", "propagated");
        conf.put("propagated2", new Integer(1));
        ManagedService ms = (ManagedService) getContext().getService(msRef);
        try {
            ms.updated(conf);
        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
       
        // Recheck props
        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
        fooP = (String) fooRef.getProperty("foo");
View Full Code Here

Examples of org.osgi.service.cm.ManagedService

        conf.put("baz", "zab");
        conf.put("foo", "foo");
        conf.put("bar", new Integer(2));
        conf.put("propagated1", "propagated");
        conf.put("propagated2", new Integer(1));
        ManagedService ms = (ManagedService) getContext().getService(msRef);
        try {
            ms.updated(conf);
        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
       
        // Recheck props
        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
        fooP = (String) fooRef.getProperty("foo");
View Full Code Here

Examples of org.osgi.service.cm.ManagedService

    // Configuration of baz
    Properties conf = new Properties();
    conf.put("baz", "zab");
    conf.put("bar", new Integer(2));
    conf.put("foo", "foo");
    ManagedService ms = (ManagedService) getContext().getService(msRef);
    try {
      ms.updated(conf);
    } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }

    // Re-check props
    fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
    fooP = (String) fooRef.getProperty("foo");
View Full Code Here

Examples of org.osgi.service.cm.ManagedService

        // Configuration of baz
        Properties conf = new Properties();
        conf.put("baz", "zab");
        conf.put("bar", new Integer(2));
        conf.put("foo", "foo");
        ManagedService ms = (ManagedService) getContext().getService(msRef);
        try {
            ms.updated(conf);
        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }

        // Recheck props
        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
        fooP = (String) fooRef.getProperty("foo");
        barP = (Integer) fooRef.getProperty("bar");
        bazP = (String) fooRef.getProperty("baz");
        assertEquals("Check foo equality -2", fooP, "foo");
        assertEquals("Check bar equality -2", barP, new Integer(2));
        assertEquals("Check baz equality -2", bazP, "zab");

        // Get Service
        FooService fs = (FooService) context.getService(fooRef);
        Integer updated = (Integer) fs.fooProps().get("updated");
        Dictionary dict = (Dictionary) fs.fooProps().get("lastupdated");

        assertEquals("Check updated", 1, updated.intValue());
        assertEquals("Check last updated", 3, dict.size());

        conf.put("baz", "zab2");
        conf.put("foo", "oof2");
        conf.put("bar", new Integer(0));
        ms = (ManagedService) getContext().getService(msRef);
        try {
            ms.updated(conf);
        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }

        updated = (Integer) fs.fooProps().get("updated");
        dict = (Dictionary) fs.fooProps().get("lastupdated");
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.