Package org.osgi.jmx.framework

Examples of org.osgi.jmx.framework.PackageStateMBean


        waitForMBean(new ObjectName(PackageStateMBean.OBJECTNAME));
    }

    @Test
    public void testMBeanInterface() throws IOException {
        PackageStateMBean packagaState = getMBean(PackageStateMBean.OBJECTNAME, PackageStateMBean.class);
        assertNotNull(packagaState);
       
        long[] exportingBundles = packagaState.getExportingBundles("org.osgi.jmx.framework", "1.5.0");
        assertNotNull(exportingBundles);
        assertTrue("Should find a bundle exporting org.osgi.jmx.framework", exportingBundles.length > 0);

        long[] exportingBundles2 = packagaState.getExportingBundles("test", "1.0.0");
        assertNull("Shouldn't find a bundle exporting test package", exportingBundles2);

        long[] importingBundlesId = packagaState
                .getImportingBundles("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertTrue("Should find bundles importing org.osgi.jmx.framework", importingBundlesId.length > 0);

        TabularData table = packagaState.listPackages();
        assertNotNull("TabularData containing CompositeData with packages info shouldn't be null", table);
        assertEquals("TabularData should be a type PACKAGES", PackageStateMBean.PACKAGES_TYPE, table.getTabularType());
        Collection colData = table.values();
        assertNotNull("Collection of CompositeData shouldn't be null", colData);
        assertFalse("Collection of CompositeData should contain elements", colData.isEmpty());

        boolean isRemovalPending = packagaState.isRemovalPending("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertFalse("Should removal pending on org.osgi.jmx.framework be false", isRemovalPending);
    }
View Full Code Here


        waitForMBean(new ObjectName(PackageStateMBean.OBJECTNAME));
    }

    @Test
    public void testMBeanInterface() throws IOException {
        PackageStateMBean packagaState = getMBean(PackageStateMBean.OBJECTNAME, PackageStateMBean.class);
        assertNotNull(packagaState);
       
        long[] exportingBundles = packagaState.getExportingBundles("org.osgi.jmx.framework", "1.5.0");
        assertNotNull(exportingBundles);
        assertTrue("Should find a bundle exporting org.osgi.jmx.framework", exportingBundles.length > 0);

        long[] exportingBundles2 = packagaState.getExportingBundles("test", "1.0.0");
        assertNull("Shouldn't find a bundle exporting test package", exportingBundles2);

        long[] importingBundlesId = packagaState
                .getImportingBundles("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertTrue("Should find bundles importing org.osgi.jmx.framework", importingBundlesId.length > 0);

        TabularData table = packagaState.listPackages();
        assertNotNull("TabularData containing CompositeData with packages info shouldn't be null", table);
        assertEquals("TabularData should be a type PACKAGES", PackageStateMBean.PACKAGES_TYPE, table.getTabularType());
        Collection colData = table.values();
        assertNotNull("Collection of CompositeData shouldn't be null", colData);
        assertFalse("Collection of CompositeData should contain elements", colData.isEmpty());

        boolean isRemovalPending = packagaState.isRemovalPending("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertFalse("Should removal pending on org.osgi.jmx.framework be false", isRemovalPending);
    }
View Full Code Here

        waitForMBean(new ObjectName(PackageStateMBean.OBJECTNAME));
    }

    @Test
    public void testMBeanInterface() throws IOException {
        PackageStateMBean packagaState = getMBean(PackageStateMBean.OBJECTNAME, PackageStateMBean.class);
        assertNotNull(packagaState);
       
        long[] exportingBundles = packagaState.getExportingBundles("org.osgi.jmx.framework", "1.5.0");
        assertNotNull(exportingBundles);
        assertTrue("Should find a bundle exporting org.osgi.jmx.framework", exportingBundles.length > 0);

        long[] exportingBundles2 = packagaState.getExportingBundles("test", "1.0.0");
        assertNull("Shouldn't find a bundle exporting test package", exportingBundles2);

        long[] importingBundlesId = packagaState
                .getImportingBundles("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertTrue("Should find bundles importing org.osgi.jmx.framework", importingBundlesId.length > 0);

        TabularData table = packagaState.listPackages();
        assertNotNull("TabularData containing CompositeData with packages info shouldn't be null", table);
        assertEquals("TabularData should be a type PACKAGES", PackageStateMBean.PACKAGES_TYPE, table.getTabularType());
        Collection colData = table.values();
        assertNotNull("Collection of CompositeData shouldn't be null", colData);
        assertFalse("Collection of CompositeData should contain elements", colData.isEmpty());

        boolean isRemovalPending = packagaState.isRemovalPending("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertFalse("Should removal pending on org.osgi.jmx.framework be false", isRemovalPending);
    }
View Full Code Here

     * @see org.apache.aries.jmx.MBeanHandler#open()
     */
    public void open() {
        ServiceReference adminRef = context.getServiceReference(PackageAdmin.class.getCanonicalName());
        PackageAdmin packageAdmin = (PackageAdmin) context.getService(adminRef);
        PackageStateMBean packageState = new PackageState(context, packageAdmin);
        try {
            mbean = new StandardMBean(packageState, PackageStateMBean.class);
        } catch (NotCompliantMBeanException e) {
            logger.log(LogService.LOG_ERROR, "Not compliant MBean", e);
        }
View Full Code Here

     * @see org.apache.aries.jmx.MBeanHandler#open()
     */
    public void open() {
        ServiceReference adminRef = context.getServiceReference(PackageAdmin.class.getCanonicalName());
        PackageAdmin packageAdmin = (PackageAdmin) context.getService(adminRef);
        PackageStateMBean packageState = new PackageState(context, packageAdmin);
        try {
            mbean = new StandardMBean(packageState, PackageStateMBean.class);
        } catch (NotCompliantMBeanException e) {
            logger.log(LogService.LOG_ERROR, "Not compliant MBean", e);
        }
View Full Code Here

        }
    }

    @Test
    public void testMBeanInterface() throws IOException {
        PackageStateMBean packagaState = getMBean(PackageStateMBean.OBJECTNAME, PackageStateMBean.class);
        assertNotNull(packagaState);
       
        long[] exportingBundles = packagaState.getExportingBundles("org.osgi.jmx.framework", "1.5.0");
        assertNotNull(exportingBundles);
        assertTrue("Should find a bundle exporting org.osgi.jmx.framework", exportingBundles.length > 0);

        long[] exportingBundles2 = packagaState.getExportingBundles("test", "1.0.0");
        assertNull("Shouldn't find a bundle exporting test package", exportingBundles2);

        long[] importingBundlesId = packagaState
                .getImportingBundles("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertTrue("Should find bundles importing org.osgi.jmx.framework", importingBundlesId.length > 0);

        TabularData table = packagaState.listPackages();
        assertNotNull("TabularData containing CompositeData with packages info shouldn't be null", table);
        assertEquals("TabularData should be a type PACKAGES", PackageStateMBean.PACKAGES_TYPE, table.getTabularType());
        Collection colData = table.values();
        assertNotNull("Collection of CompositeData shouldn't be null", colData);
        assertFalse("Collection of CompositeData should contain elements", colData.isEmpty());

        boolean isRemovalPending = packagaState.isRemovalPending("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertFalse("Should removal pending on org.osgi.jmx.framework be false", isRemovalPending);
    }
View Full Code Here

     * @see org.apache.aries.jmx.MBeanHandler#open()
     */
    public void open() {
        ServiceReference adminRef = context.getServiceReference(PackageAdmin.class.getCanonicalName());
        PackageAdmin packageAdmin = (PackageAdmin) context.getService(adminRef);
        PackageStateMBean packageState = new PackageState(context, packageAdmin);
        try {
            mbean = new StandardMBean(packageState, PackageStateMBean.class);
        } catch (NotCompliantMBeanException e) {
            logger.log(LogService.LOG_ERROR, "Not compliant MBean", e);
        }
View Full Code Here

        }
    }

    @Test
    public void testMBeanInterface() throws IOException {
        PackageStateMBean packagaState = getMBean(PackageStateMBean.OBJECTNAME, PackageStateMBean.class);
        assertNotNull(packagaState);
       
        long[] exportingBundles = packagaState.getExportingBundles("org.osgi.jmx.framework", "1.5.0");
        assertNotNull(exportingBundles);
        assertTrue("Should find a bundle exporting org.osgi.jmx.framework", exportingBundles.length > 0);

        long[] exportingBundles2 = packagaState.getExportingBundles("test", "1.0.0");
        assertNull("Shouldn't find a bundle exporting test package", exportingBundles2);

        long[] importingBundlesId = packagaState
                .getImportingBundles("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertTrue("Should find bundles importing org.osgi.jmx.framework", importingBundlesId.length > 0);

        TabularData table = packagaState.listPackages();
        assertNotNull("TabularData containing CompositeData with packages info shouldn't be null", table);
        assertEquals("TabularData should be a type PACKAGES", PackageStateMBean.PACKAGES_TYPE, table.getTabularType());
        Collection colData = table.values();
        assertNotNull("Collection of CompositeData shouldn't be null", colData);
        assertFalse("Collection of CompositeData should contain elements", colData.isEmpty());

        boolean isRemovalPending = packagaState.isRemovalPending("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertFalse("Should removal pending on org.osgi.jmx.framework be false", isRemovalPending);
    }
View Full Code Here

        }
        return bundleState;
    }

    public PackageStateMBean getPackageStateMBean() throws IOException {
        PackageStateMBean packageState = null;
        ObjectName objectName = createObjectName(PackageStateMBean.OBJECTNAME);
        if (isRegisteredWithTimeout(objectName)) {
            packageState = getMBeanProxy(objectName, PackageStateMBean.class);
            return packageState;
        }
View Full Code Here

TOP

Related Classes of org.osgi.jmx.framework.PackageStateMBean

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.