Package org.osgi.service.monitor

Examples of org.osgi.service.monitor.StatusVariable


        HashMap<ServiceReference, Monitorable> map = new HashMap<ServiceReference, Monitorable>();

        MockMonitorable monitorable = new MockMonitorable();

        StatusVariable[] statusVariables = {
                new StatusVariable("sv.id1", StatusVariable.CM_CC, 0),
                new StatusVariable("sv.id2", StatusVariable.CM_CC, "test")
        };
        monitorable.setStatusVariables(statusVariables);

        map.put(new MonitorableMockServiceReference("com.acme.pid"), monitorable);
        osgiVisitor.setReferences(map);
View Full Code Here


        HashMap<ServiceReference, Monitorable> map = new HashMap<ServiceReference, Monitorable>();

        MockMonitorable monitorable = new MockMonitorable();

        StatusVariable[] statusVariables = {
                new StatusVariable("sv.id1", StatusVariable.CM_CC, 0),
                new StatusVariable("sv.id2", StatusVariable.CM_CC, "test")
        };
        monitorable.setStatusVariables(statusVariables);
        monitorable.setNotificationSupport("sv.id1", true);

        map.put(new MonitorableMockServiceReference("com.acme.pid"), monitorable);
View Full Code Here

        HashMap<ServiceReference, Monitorable> map = new HashMap<ServiceReference, Monitorable>();

        MockMonitorable monitorable = new MockMonitorable();

        StatusVariable[] statusVariables = {
                new StatusVariable("sv.id1", StatusVariable.CM_CC, 0),
                new StatusVariable("sv.id2", StatusVariable.CM_CC, "test")
        };
        monitorable.setStatusVariables(statusVariables);
        monitorable.setNotificationSupport("sv.id1", true);

        map.put(new MonitorableMockServiceReference("com.acme.pid"), monitorable);
        osgiVisitor.setReferences(map);

        MonitorAdmin monitorAdmin = new MonitorAdminImpl(logVisitor, common, bundle);

        StatusVariable sv = monitorAdmin.getStatusVariable("com.acme.pid/sv.id1");
        Assert.assertNotNull(sv);
        Assert.assertEquals(0, sv.getInteger());

        monitorable.setNewStatusVariableValue("sv.id1", "15");

        sv = monitorAdmin.getStatusVariable("com.acme.pid/sv.id1");
        Assert.assertNotNull(sv);
        Assert.assertEquals(15, sv.getInteger());

        try {
            monitorAdmin.resetStatusVariable(null);
            Assert.fail();
        } catch (IllegalArgumentException e) {
        }

        try {
            monitorAdmin.resetStatusVariable("/&%(/=");
            Assert.fail();
        } catch (IllegalArgumentException e) {
        }

        try {
            monitorAdmin.resetStatusVariable("com.aaa/sv.id");
            Assert.fail();
        } catch (IllegalArgumentException e) {
        }

        try {
            monitorAdmin.resetStatusVariable("com.acme.pid/sv.id_u");
            Assert.fail();
        } catch (IllegalArgumentException e) {
        }

        boolean result = monitorAdmin.resetStatusVariable("com.acme.pid/sv.id1");
        Assert.assertTrue(result);

        sv = monitorAdmin.getStatusVariable("com.acme.pid/sv.id1");
        Assert.assertNotNull(sv);
        Assert.assertEquals(0, sv.getInteger());
    }
View Full Code Here

        HashMap<ServiceReference, Monitorable> map = new HashMap<ServiceReference, Monitorable>();

        MockMonitorable monitorable = new MockMonitorable();

        StatusVariable[] statusVariables = {
                new StatusVariable("sv.id1", StatusVariable.CM_CC, 0),
        };
        monitorable.setStatusVariables(statusVariables);
        monitorable.setNotificationSupport("sv.id1", true);

        map.put(new MonitorableMockServiceReference("com.acme.pid"), monitorable);
View Full Code Here

        HashMap<ServiceReference, Monitorable> map = new HashMap<ServiceReference, Monitorable>();

        MockMonitorable monitorable = new MockMonitorable();

        StatusVariable[] statusVariables = {
                new StatusVariable("sv.id1", StatusVariable.CM_CC, 0),
                new StatusVariable("sv.id2", StatusVariable.CM_CC, "test")
        };
        monitorable.setStatusVariables(statusVariables);
        monitorable.setNotificationSupport("sv.id1", true);

        map.put(new MonitorableMockServiceReference("com.acme.pid"), monitorable);
View Full Code Here

        HashMap<ServiceReference, Monitorable> map = new HashMap<ServiceReference, Monitorable>();

        MockMonitorable monitorable = new MockMonitorable();

        StatusVariable[] statusVariables = {
                new StatusVariable("sv.id1", StatusVariable.CM_CC, 0),
                new StatusVariable("sv.id2", StatusVariable.CM_CC, "test")
        };
        monitorable.setStatusVariables(statusVariables);
        monitorable.setNotificationSupport("sv.id1", true);

        map.put(new MonitorableMockServiceReference("com.acme.pid"), monitorable);
View Full Code Here

        HashMap<ServiceReference, Monitorable> map = new HashMap<ServiceReference, Monitorable>();

        MockMonitorable monitorable = new MockMonitorable();

        StatusVariable[] statusVariables = {
                new StatusVariable("sv.id1", StatusVariable.CM_CC, 0),
                new StatusVariable("sv.id2", StatusVariable.CM_CC, "test")
        };
        monitorable.setStatusVariables(statusVariables);

        map.put(new MonitorableMockServiceReference("com.acme.pid"), monitorable);
        osgiVisitor.setReferences(map);
View Full Code Here

TOP

Related Classes of org.osgi.service.monitor.StatusVariable

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.