[jboss-osgi-commits] JBoss-OSGI SVN: r101160 - in projects/jboss-osgi/projects/bundles/jmx/trunk: jmx-bundle and 2 other directories.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Fri Feb 19 07:52:29 EST 2010
Author: thomas.diesler at jboss.com
Date: 2010-02-19 07:52:26 -0500 (Fri, 19 Feb 2010)
New Revision: 101160
Added:
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java
Removed:
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/
Modified:
projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml
Log:
split jmx build in modules
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml (from rev 101148, projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml 2010-02-19 12:52:26 UTC (rev 101160)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!-- ====================================================================== -->
+ <!-- -->
+ <!-- JBoss, the OpenSource J2EE webOS -->
+ <!-- -->
+ <!-- Distributable under LGPL license. -->
+ <!-- See terms of license at http://www.gnu.org. -->
+ <!-- -->
+ <!-- ====================================================================== -->
+
+ <!-- $Id$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBossOSGi - JMX Bundle</name>
+ <description>The JBossOSGi Management</description>
+
+ <groupId>org.jboss.osgi.jmx</groupId>
+ <artifactId>jboss-osgi-jmx</artifactId>
+ <packaging>bundle</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.osgi.jmx</groupId>
+ <artifactId>jboss-osgi-jmx-parent</artifactId>
+ <version>1.0.4-SNAPSHOT</version>
+ </parent>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jndi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.jmx</groupId>
+ <artifactId>org.apache.aries.jmx.api</artifactId>
+ </dependency>
+
+ <!-- OSGi Dependencies -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+ <Bundle-Activator>org.jboss.osgi.jmx.internal.JMXServiceActivator</Bundle-Activator>
+ <Export-Package>
+ org.jboss.osgi.jmx;version=${version}
+ </Export-Package>
+ <Import-Package>
+
+ <!-- system -->
+ javax.management*,
+ javax.naming,
+ javax.naming.spi,
+
+ <!-- jboss-osgi -->
+ org.jboss.osgi.spi*;version="[1.0,2.0)",
+
+ <!-- osgi -->
+ org.osgi.framework;version="[1.5,2.0)",
+ org.osgi.service.packageadmin;version="[1.2,2.0)",
+ org.osgi.util.tracker;version="[1.4,2.0)",
+
+ <!-- FIXME: make optional
+ org.jboss.osgi.jndi;resolution:=optional,
+ org.jboss.net.sockets;resolution:=optional,
+ org.jnp.interfaces;resolution:=optional,
+ -->
+ org.jboss.osgi.jndi;version="[1.0,2.0)",
+ org.jboss.net.sockets;version="[2.2,3.0)",
+ org.jnp.interfaces;version="[5.0,6.0)",
+
+ </Import-Package>
+ <DynamicImport-Package>*</DynamicImport-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <!-- For some reason the distribution javadoc module needs this -->
+ <file>target/${artifactId}-${version}-sources.jar</file>
+ <classifier>sources</classifier>
+ <type>jar</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src (from rev 101012, projects/jboss-osgi/projects/bundles/jmx/trunk/src)
Deleted: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2010-02-16 06:32:28 UTC (rev 101012)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2010-02-19 12:52:26 UTC (rev 101160)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.jmx;
-
-//$Id$
-
-import javax.management.MBeanServer;
-
-import org.jboss.osgi.jndi.JNDICapability;
-import org.jboss.osgi.spi.capability.Capability;
-
-/**
- * Adds the JMX capability to the {@link OSGiRuntime}
- * under test.
- *
- * It is ignored if the {@link MBeanServer} is already registered.
- *
- * Installed bundles: jboss-osgi-jmx.jar
- *
- * Default properties set by this capability
- *
- * <table>
- * <tr><th>Property</th><th>Value</th></tr>
- * <tr><td>org.jboss.osgi.jmx.host</td><td>${jboss.bind.address}</td></tr>
- * <tr><td>org.jboss.osgi.jmx.rmi.port</td><td>1198</td></tr>
- * </table>
- *
- * @author thomas.diesler at jboss.com
- * @since 05-May-2009
- */
-public class JMXCapability extends Capability
-{
- public JMXCapability()
- {
- super(MBeanServer.class.getName());
-
- addSystemProperty("org.jboss.osgi.jmx.host", System.getProperty("jboss.bind.address", "localhost"));
- addSystemProperty("org.jboss.osgi.jmx.rmi.port", "1198");
-
- addDependency(new JNDICapability());
-
- addBundle("bundles/jboss-osgi-jmx.jar");
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/JMXCapability.java (from rev 101072, projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/JMXCapability.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/JMXCapability.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2010-02-19 12:52:26 UTC (rev 101160)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jmx;
+
+//$Id$
+
+import javax.management.MBeanServer;
+
+import org.jboss.osgi.jndi.JNDICapability;
+import org.jboss.osgi.spi.capability.Capability;
+
+/**
+ * Adds the JMX capability to the {@link OSGiRuntime}
+ * under test.
+ *
+ * It is ignored if the {@link MBeanServer} is already registered.
+ *
+ * Dependent Capability: {@link JNDICapability}
+ * Installed bundles: jboss-osgi-jmx.jar
+ *
+ * Default properties set by this capability
+ *
+ * <table>
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td>org.jboss.osgi.jmx.host</td><td>${jboss.bind.address}</td></tr>
+ * <tr><td>org.jboss.osgi.jmx.rmi.port</td><td>1198</td></tr>
+ * </table>
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public class JMXCapability extends Capability
+{
+ public JMXCapability()
+ {
+ super(MBeanServer.class.getName());
+
+ addSystemProperty("org.jboss.osgi.jmx.host", System.getProperty("jboss.bind.address", "localhost"));
+ addSystemProperty("org.jboss.osgi.jmx.rmi.port", "1198");
+
+ addDependency(new JNDICapability());
+
+ addBundle("bundles/jboss-osgi-jmx.jar");
+ addBundle("bundles/org.apache.aries.jmx.jar");
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java 2010-02-16 06:32:28 UTC (rev 101012)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java 2010-02-19 12:52:26 UTC (rev 101160)
@@ -1,89 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.jmx.internal;
-
-//$Id$
-
-import java.util.ArrayList;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-
-import org.jboss.logging.Logger;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-/**
- * A service that registers an MBeanServer
- *
- * @author thomas.diesler at jboss.com
- * @since 24-Apr-2009
- */
-public class MBeanServerService
-{
- // Provide logging
- private static final Logger log = Logger.getLogger(MBeanServerService.class);
-
- private BundleContext context;
-
- public MBeanServerService(BundleContext context)
- {
- this.context = context;
- }
-
- @SuppressWarnings("unchecked")
- public MBeanServer registerMBeanServer()
- {
- MBeanServer mbeanServer = null;
-
- // Check if there is an MBeanServer service already
- ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
- if (sref != null)
- {
- mbeanServer = (MBeanServer)context.getService(sref);
- log.debug("Found MBeanServer fom service: " + mbeanServer.getDefaultDomain());
- return mbeanServer;
- }
-
- ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
- if (serverArr.size() > 1)
- log.warn("Multiple MBeanServer instances: " + serverArr);
-
- if (serverArr.size() > 0)
- {
- mbeanServer = serverArr.get(0);
- log.debug("Found MBeanServer: " + mbeanServer.getDefaultDomain());
- }
-
- if (mbeanServer == null)
- {
- log.debug("No MBeanServer, create one ...");
- mbeanServer = MBeanServerFactory.createMBeanServer();
- }
-
- // Register the MBeanServer
- context.registerService(MBeanServer.class.getName(), mbeanServer, null);
- log.debug("MBeanServer registered");
-
- return mbeanServer;
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java (from rev 101072, projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java 2010-02-19 12:52:26 UTC (rev 101160)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jmx.internal;
+
+//$Id$
+
+import java.util.ArrayList;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * A service that registers an MBeanServer
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 24-Apr-2009
+ */
+public class MBeanServerService
+{
+ // Provide logging
+ private static final Logger log = Logger.getLogger(MBeanServerService.class);
+
+ private BundleContext context;
+
+ public MBeanServerService(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public MBeanServer registerMBeanServer()
+ {
+ MBeanServer mbeanServer = null;
+
+ // Check if there is an MBeanServer service already
+ ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
+ if (sref != null)
+ {
+ mbeanServer = (MBeanServer)context.getService(sref);
+ log.debug("Found MBeanServer fom service: " + mbeanServer.getDefaultDomain());
+ return mbeanServer;
+ }
+
+ ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
+ if (serverArr.size() > 1)
+ log.warn("Multiple MBeanServer instances: " + serverArr);
+
+ if (serverArr.size() > 0)
+ {
+ mbeanServer = serverArr.get(0);
+ log.debug("Found MBeanServer: " + mbeanServer.getDefaultDomain());
+ }
+
+ if (mbeanServer == null)
+ {
+ log.debug("No MBeanServer, create one ...");
+ mbeanServer = MBeanServerFactory.createMBeanServer();
+ }
+
+ // Register the MBeanServer
+ context.registerService(MBeanServer.class.getName(), mbeanServer, null);
+ log.debug("MBeanServer registered");
+
+ return mbeanServer;
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java 2010-02-16 06:32:28 UTC (rev 101012)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java 2010-02-19 12:52:26 UTC (rev 101160)
@@ -1,301 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.jmx.internal;
-
-//$Id$
-
-import static org.jboss.osgi.spi.OSGiConstants.DOMAIN_NAME;
-import static org.jboss.osgi.spi.management.ManagedBundle.PROPERTY_ID;
-import static org.jboss.osgi.spi.management.ManagedBundle.PROPERTY_SYMBOLIC_NAME;
-import static org.jboss.osgi.spi.management.ManagedBundle.PROPERTY_VERSION;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.QueryExp;
-import javax.management.StandardMBean;
-
-import org.jboss.logging.Logger;
-import org.jboss.osgi.spi.management.ManagedBundle;
-import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
-import org.jboss.osgi.spi.management.ManagedServiceReference;
-import org.jboss.osgi.spi.management.ObjectNameFactory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-/**
- * The managed view of an OSGi Framework
- *
- * @author thomas.diesler at jboss.com
- * @since 04-Mar-2009
- */
-public class ManagedFrameworkImpl implements ManagedFrameworkMBean
-{
- // Provide logging
- private static final Logger log = Logger.getLogger(ManagedFrameworkImpl.class);
-
- private MBeanServer mbeanServer;
- private BundleContext context;
- private ManagedBundleTracker bundleTracker;
-
- public ManagedFrameworkImpl(BundleContext context, MBeanServer mbeanServer)
- {
- if (context == null)
- throw new IllegalArgumentException("Null BundleContext");
- if (mbeanServer == null)
- throw new IllegalArgumentException("Null MBeanServer");
-
- if (context.getBundle().getBundleId() != 0)
- throw new IllegalArgumentException("Not the system bundle context: " + context);
-
- this.context = context;
- this.mbeanServer = mbeanServer;
-
- this.bundleTracker = new ManagedBundleTracker(context, mbeanServer);
- }
-
- public BundleContext getBundleContext()
- {
- return context;
- }
-
- @SuppressWarnings("unchecked")
- public ObjectName getBundle(String symbolicName, String version)
- {
- ObjectName oname = null;
-
- String namestr = DOMAIN_NAME + ":" + PROPERTY_SYMBOLIC_NAME + "=" + symbolicName + "," + PROPERTY_VERSION + "=" + version + ",*";
- Set<ObjectName> names = mbeanServer.queryNames(ObjectNameFactory.create(namestr), null);
-
- if (names.size() > 0)
- {
- if (names.size() > 1)
- log.warn("Multiple bundles found: " + names);
-
- // Use the bundle with the highest id
- for (ObjectName aux : names)
- {
- if (oname == null)
- oname = aux;
-
- Integer bestId = new Integer(oname.getKeyProperty(PROPERTY_ID));
- Integer auxId = new Integer(aux.getKeyProperty(PROPERTY_ID));
- if (bestId < auxId)
- oname = aux;
- }
- }
-
- if (log.isTraceEnabled())
- log.trace("getBundle(" + symbolicName + "," + version + ") => " + oname);
-
- return oname;
- }
-
- @SuppressWarnings("unchecked")
- public ObjectName getBundle(long bundleId)
- {
- ObjectName oname = null;
-
- ObjectName pattern = ObjectNameFactory.create(DOMAIN_NAME + ":" + PROPERTY_ID + "=" + bundleId + ",*");
- Set<ObjectName> names = mbeanServer.queryNames(pattern, null);
-
- if (names.size() > 0)
- oname = names.iterator().next();
-
- if (log.isTraceEnabled())
- log.trace("getBundle(" + bundleId + ") => " + oname);
-
- return oname;
- }
-
- @SuppressWarnings("unchecked")
- public Set<ObjectName> getBundles()
- {
- // [JBAS-6571] JMX filtering does not work with wildcards
- // ObjectName pattern = ObjectNameFactory.create(Constants.DOMAIN_NAME + ":name=*,*");
- // Set<ObjectName> names = mbeanServer.queryNames(pattern, null);
-
- ObjectName pattern = ObjectNameFactory.create(DOMAIN_NAME + ":*");
- Set<ObjectName> names = mbeanServer.queryNames(pattern, new IsBundleQueryExp());
-
- if (log.isTraceEnabled())
- log.trace("getBundles() => " + names);
-
- return names;
- }
-
- public ManagedServiceReference getServiceReference(String clazz)
- {
- ServiceReference sref = getBundleContext().getServiceReference(clazz);
- if (sref == null)
- return null;
-
- Map<String, Object> props = new HashMap<String, Object>();
- for (String key : sref.getPropertyKeys())
- {
- props.put(key, sref.getProperty(key));
- }
-
- ManagedServiceReference msref = new ManagedServiceReference(props);
- if (log.isTraceEnabled())
- log.trace("getServiceReference(" + clazz + ") => " + msref);
-
- return msref;
- }
-
- public ManagedServiceReference[] getServiceReferences(String clazz, String filter)
- {
- List<ManagedServiceReference> foundRefs = new ArrayList<ManagedServiceReference>();
-
- ServiceReference[] srefs;
- try
- {
- srefs = getBundleContext().getServiceReferences(clazz, filter);
- }
- catch (InvalidSyntaxException e)
- {
- throw new IllegalArgumentException("Invalid filter syntax: " + filter);
- }
-
- if (srefs != null)
- {
- for (ServiceReference sref : srefs)
- {
- Map<String, Object> props = new HashMap<String, Object>();
- for (String key : sref.getPropertyKeys())
- props.put(key, sref.getProperty(key));
-
- foundRefs.add(new ManagedServiceReference(props));
- }
- }
-
- ManagedServiceReference[] msrefs = null;
- if (foundRefs.size() > 0)
- msrefs = foundRefs.toArray(new ManagedServiceReference[foundRefs.size()]);
-
- if (log.isTraceEnabled())
- log.trace("getServiceReferences(" + clazz + "," + filter +") => " + msrefs);
-
- return msrefs;
- }
-
- public void refreshPackages(ObjectName[] objectNames)
- {
- if (log.isTraceEnabled())
- log.trace("refreshPackages(" + (objectNames != null ? Arrays.asList(objectNames) : null) +")");
-
- Bundle[] bundleArr = getBundles(objectNames);
- ServiceReference sref = getBundleContext().getServiceReference(PackageAdmin.class.getName());
- PackageAdmin service = (PackageAdmin)getBundleContext().getService(sref);
- service.refreshPackages(bundleArr);
- }
-
- public boolean resolveBundles(ObjectName[] objectNames)
- {
- if (log.isTraceEnabled())
- log.trace("resolveBundles(" + (objectNames != null ? Arrays.asList(objectNames) : null) +")");
-
- Bundle[] bundleArr = getBundles(objectNames);
- ServiceReference sref = getBundleContext().getServiceReference(PackageAdmin.class.getName());
- PackageAdmin service = (PackageAdmin)getBundleContext().getService(sref);
- return service.resolveBundles(bundleArr);
- }
-
- private Bundle[] getBundles(ObjectName[] objectNames)
- {
- Bundle[] bundleArr = null;
- if (objectNames != null)
- {
- List<String> symbolicNames = new ArrayList<String>();
- for (ObjectName oname : objectNames)
- symbolicNames.add(oname.getKeyProperty(PROPERTY_SYMBOLIC_NAME));
-
- Set<Bundle> bundleSet = new HashSet<Bundle>();
- for (Bundle bundle : getBundleContext().getBundles())
- {
- if (symbolicNames.contains(bundle.getSymbolicName()))
- bundleSet.add(bundle);
- }
- bundleArr = new Bundle[bundleSet.size()];
- bundleSet.toArray(bundleArr);
- }
- return bundleArr;
- }
-
- public void start()
- {
- // Start tracking the bundles
- bundleTracker.open();
-
- try
- {
- if (mbeanServer != null)
- {
- StandardMBean mbean = new StandardMBean(this, ManagedFrameworkMBean.class);
- mbeanServer.registerMBean(mbean, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
- }
- }
- catch (JMException ex)
- {
- log.warn("Cannot register: " + ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
- }
- }
-
- public void stop()
- {
- try
- {
- if (mbeanServer != null && mbeanServer.isRegistered(MBEAN_MANAGED_FRAMEWORK))
- mbeanServer.unregisterMBean(ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
- }
- catch (JMException ex)
- {
- log.warn("Cannot register: " + ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
- }
- }
-
- // Accept names like "jboss.osgi:id=*"
- static class IsBundleQueryExp implements QueryExp
- {
- private static final long serialVersionUID = 1L;
-
- public boolean apply(ObjectName name)
- {
- return name.getKeyProperty(ManagedBundle.PROPERTY_SYMBOLIC_NAME) != null;
- }
-
- public void setMBeanServer(MBeanServer server)
- {
- }
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java (from rev 101072, projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java 2010-02-19 12:52:26 UTC (rev 101160)
@@ -0,0 +1,183 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jmx.internal;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.StandardMBean;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.jboss.osgi.spi.management.ManagedServiceReference;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * The managed view of an OSGi Framework
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 04-Mar-2009
+ */
+public class ManagedFrameworkImpl implements ManagedFrameworkMBean
+{
+ // Provide logging
+ private static final Logger log = Logger.getLogger(ManagedFrameworkImpl.class);
+
+ private MBeanServer mbeanServer;
+ private BundleContext context;
+ private ManagedBundleTracker bundleTracker;
+
+ public ManagedFrameworkImpl(BundleContext context, MBeanServer mbeanServer)
+ {
+ if (context == null)
+ throw new IllegalArgumentException("Null BundleContext");
+ if (mbeanServer == null)
+ throw new IllegalArgumentException("Null MBeanServer");
+
+ if (context.getBundle().getBundleId() != 0)
+ throw new IllegalArgumentException("Not the system bundle context: " + context);
+
+ this.context = context;
+ this.mbeanServer = mbeanServer;
+ this.bundleTracker = new ManagedBundleTracker(context, mbeanServer);
+ }
+
+ @Override
+ public ManagedServiceReference getServiceReference(String clazz)
+ {
+ ServiceReference sref = context.getServiceReference(clazz);
+ if (sref == null)
+ return null;
+
+ Map<String, Object> props = new HashMap<String, Object>();
+ for (String key : sref.getPropertyKeys())
+ {
+ props.put(key, sref.getProperty(key));
+ }
+
+ ManagedServiceReference msref = new ManagedServiceReference(props);
+ if (log.isTraceEnabled())
+ log.trace("getServiceReference(" + clazz + ") => " + msref);
+
+ return msref;
+ }
+
+ @Override
+ public ManagedServiceReference[] getServiceReferences(String clazz, String filter)
+ {
+ List<ManagedServiceReference> foundRefs = new ArrayList<ManagedServiceReference>();
+
+ ServiceReference[] srefs;
+ try
+ {
+ srefs = context.getServiceReferences(clazz, filter);
+ }
+ catch (InvalidSyntaxException e)
+ {
+ throw new IllegalArgumentException("Invalid filter syntax: " + filter);
+ }
+
+ if (srefs != null)
+ {
+ for (ServiceReference sref : srefs)
+ {
+ Map<String, Object> props = new HashMap<String, Object>();
+ for (String key : sref.getPropertyKeys())
+ props.put(key, sref.getProperty(key));
+
+ foundRefs.add(new ManagedServiceReference(props));
+ }
+ }
+
+ ManagedServiceReference[] msrefs = null;
+ if (foundRefs.size() > 0)
+ msrefs = foundRefs.toArray(new ManagedServiceReference[foundRefs.size()]);
+
+ if (log.isTraceEnabled())
+ log.trace("getServiceReferences(" + clazz + "," + filter +") => " + msrefs);
+
+ return msrefs;
+ }
+
+ @Override
+ public void refreshAllPackages()
+ {
+ if (log.isTraceEnabled())
+ log.trace("refreshPackages(null)");
+
+ ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
+ PackageAdmin service = (PackageAdmin)context.getService(sref);
+ service.refreshPackages(null);
+ }
+
+ @Override
+ public boolean resolveAllBundles()
+ {
+ if (log.isTraceEnabled())
+ log.trace("resolveBundles(null)");
+
+ ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
+ PackageAdmin service = (PackageAdmin)context.getService(sref);
+ return service.resolveBundles(null);
+ }
+
+ void start()
+ {
+ // Start tracking the bundles
+ bundleTracker.open();
+
+ try
+ {
+ if (mbeanServer != null)
+ {
+ StandardMBean mbean = new StandardMBean(this, ManagedFrameworkMBean.class);
+ mbeanServer.registerMBean(mbean, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
+ }
+ }
+ catch (JMException ex)
+ {
+ log.warn("Cannot register: " + ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
+ }
+ }
+
+ void stop()
+ {
+ try
+ {
+ if (mbeanServer != null && mbeanServer.isRegistered(MBEAN_MANAGED_FRAMEWORK))
+ mbeanServer.unregisterMBean(ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
+ }
+ catch (JMException ex)
+ {
+ log.warn("Cannot register: " + ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java 2010-02-16 06:32:28 UTC (rev 101012)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java 2010-02-19 12:52:26 UTC (rev 101160)
@@ -1,183 +0,0 @@
-/**
- *
- */
-package org.jboss.osgi.jmx.internal;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Set;
-
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.IntrospectionException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServerConnection;
-import javax.management.NotCompliantMBeanException;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-import javax.management.QueryExp;
-import javax.management.ReflectionException;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-
-public class RMIAdaptor implements MBeanServerConnection, Serializable
-{
- private static final long serialVersionUID = 6066226353118090215L;
-
- private MBeanServerConnection delegate;
-
- public RMIAdaptor(JMXServiceURL url) throws IOException
- {
- JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
- delegate = jmxc.getMBeanServerConnection();
- }
-
- public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
- throws InstanceNotFoundException, IOException
- {
- delegate.addNotificationListener(name, listener, filter, handback);
- }
-
- public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException,
- IOException
- {
- delegate.addNotificationListener(name, listener, filter, handback);
- }
-
- public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException,
- InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException
- {
- return delegate.createMBean(className, name, params, signature);
- }
-
- public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException,
- InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException
- {
- return delegate.createMBean(className, name, loaderName, params, signature);
- }
-
- public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException,
- MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException
- {
- return delegate.createMBean(className, name, loaderName);
- }
-
- public ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException,
- MBeanException, NotCompliantMBeanException, IOException
- {
- return delegate.createMBean(className, name);
- }
-
- public Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException,
- ReflectionException, IOException
- {
- return delegate.getAttribute(name, attribute);
- }
-
- public AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException, IOException
- {
- return delegate.getAttributes(name, attributes);
- }
-
- public String getDefaultDomain() throws IOException
- {
- return delegate.getDefaultDomain();
- }
-
- public String[] getDomains() throws IOException
- {
- return delegate.getDomains();
- }
-
- public Integer getMBeanCount() throws IOException
- {
- return delegate.getMBeanCount();
- }
-
- public MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException
- {
- return delegate.getMBeanInfo(name);
- }
-
- public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOException
- {
- return delegate.getObjectInstance(name);
- }
-
- public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException,
- ReflectionException, IOException
- {
- return delegate.invoke(name, operationName, params, signature);
- }
-
- public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException
- {
- return delegate.isInstanceOf(name, className);
- }
-
- public boolean isRegistered(ObjectName name) throws IOException
- {
- return delegate.isRegistered(name);
- }
-
- @SuppressWarnings({ "rawtypes" })
- public Set queryMBeans(ObjectName name, QueryExp query) throws IOException
- {
- return delegate.queryMBeans(name, query);
- }
-
- @SuppressWarnings({ "rawtypes" })
- public Set queryNames(ObjectName name, QueryExp query) throws IOException
- {
- return delegate.queryNames(name, query);
- }
-
- public void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
- throws InstanceNotFoundException, ListenerNotFoundException, IOException
- {
- delegate.removeNotificationListener(name, listener, filter, handback);
- }
-
- public void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException,
- IOException
- {
- delegate.removeNotificationListener(name, listener);
- }
-
- public void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException,
- ListenerNotFoundException, IOException
- {
- delegate.removeNotificationListener(name, listener, filter, handback);
- }
-
- public void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException, IOException
- {
- delegate.removeNotificationListener(name, listener);
- }
-
- public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException,
- MBeanException, ReflectionException, IOException
- {
- delegate.setAttribute(name, attribute);
- }
-
- public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException, IOException
- {
- return delegate.setAttributes(name, attributes);
- }
-
- public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException, IOException
- {
- delegate.unregisterMBean(name);
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java (from rev 101072, projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java 2010-02-19 12:52:26 UTC (rev 101160)
@@ -0,0 +1,183 @@
+/**
+ *
+ */
+package org.jboss.osgi.jmx.internal;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.management.Attribute;
+import javax.management.AttributeList;
+import javax.management.AttributeNotFoundException;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.IntrospectionException;
+import javax.management.InvalidAttributeValueException;
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServerConnection;
+import javax.management.NotCompliantMBeanException;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+import javax.management.QueryExp;
+import javax.management.ReflectionException;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+public class RMIAdaptor implements MBeanServerConnection, Serializable
+{
+ private static final long serialVersionUID = 6066226353118090215L;
+
+ private MBeanServerConnection delegate;
+
+ public RMIAdaptor(JMXServiceURL url) throws IOException
+ {
+ JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
+ delegate = jmxc.getMBeanServerConnection();
+ }
+
+ public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
+ throws InstanceNotFoundException, IOException
+ {
+ delegate.addNotificationListener(name, listener, filter, handback);
+ }
+
+ public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException,
+ IOException
+ {
+ delegate.addNotificationListener(name, listener, filter, handback);
+ }
+
+ public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException,
+ InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException
+ {
+ return delegate.createMBean(className, name, params, signature);
+ }
+
+ public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException,
+ InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException
+ {
+ return delegate.createMBean(className, name, loaderName, params, signature);
+ }
+
+ public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException,
+ MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException
+ {
+ return delegate.createMBean(className, name, loaderName);
+ }
+
+ public ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException,
+ MBeanException, NotCompliantMBeanException, IOException
+ {
+ return delegate.createMBean(className, name);
+ }
+
+ public Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException,
+ ReflectionException, IOException
+ {
+ return delegate.getAttribute(name, attribute);
+ }
+
+ public AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException, IOException
+ {
+ return delegate.getAttributes(name, attributes);
+ }
+
+ public String getDefaultDomain() throws IOException
+ {
+ return delegate.getDefaultDomain();
+ }
+
+ public String[] getDomains() throws IOException
+ {
+ return delegate.getDomains();
+ }
+
+ public Integer getMBeanCount() throws IOException
+ {
+ return delegate.getMBeanCount();
+ }
+
+ public MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException
+ {
+ return delegate.getMBeanInfo(name);
+ }
+
+ public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOException
+ {
+ return delegate.getObjectInstance(name);
+ }
+
+ public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException,
+ ReflectionException, IOException
+ {
+ return delegate.invoke(name, operationName, params, signature);
+ }
+
+ public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException
+ {
+ return delegate.isInstanceOf(name, className);
+ }
+
+ public boolean isRegistered(ObjectName name) throws IOException
+ {
+ return delegate.isRegistered(name);
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public Set queryMBeans(ObjectName name, QueryExp query) throws IOException
+ {
+ return delegate.queryMBeans(name, query);
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public Set queryNames(ObjectName name, QueryExp query) throws IOException
+ {
+ return delegate.queryNames(name, query);
+ }
+
+ public void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback)
+ throws InstanceNotFoundException, ListenerNotFoundException, IOException
+ {
+ delegate.removeNotificationListener(name, listener, filter, handback);
+ }
+
+ public void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException,
+ IOException
+ {
+ delegate.removeNotificationListener(name, listener);
+ }
+
+ public void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException,
+ ListenerNotFoundException, IOException
+ {
+ delegate.removeNotificationListener(name, listener, filter, handback);
+ }
+
+ public void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException, IOException
+ {
+ delegate.removeNotificationListener(name, listener);
+ }
+
+ public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException,
+ MBeanException, ReflectionException, IOException
+ {
+ delegate.setAttribute(name, attribute);
+ }
+
+ public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException, IOException
+ {
+ return delegate.setAttributes(name, attributes);
+ }
+
+ public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException, IOException
+ {
+ delegate.unregisterMBean(name);
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml 2010-02-19 12:19:32 UTC (rev 101159)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml 2010-02-19 12:52:26 UTC (rev 101160)
@@ -14,12 +14,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>JBossOSGi Reactor - JMX</name>
+ <name>JBossOSGi - JMX</name>
<description>The JBossOSGi Management</description>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jmx</artifactId>
- <packaging>bundle</packaging>
+ <groupId>org.jboss.osgi.jmx</groupId>
+ <artifactId>jboss-osgi-jmx-parent</artifactId>
+ <packaging>pom</packaging>
<version>1.0.4-SNAPSHOT</version>
@@ -45,105 +45,41 @@
<version.osgi>4.2.0</version.osgi>
</properties>
+ <modules>
+ <module>jmx-bundle</module>
+ </modules>
+
<!-- Dependencies -->
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common-core</artifactId>
- <version>${version.jboss.osgi.common.core}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jndi</artifactId>
- <version>${version.jboss.osgi.jndi}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.aries.jmx</groupId>
- <artifactId>org.apache.aries.jmx.api</artifactId>
- <version>${version.apache.aries.jmx}</version>
- </dependency>
-
- <!-- OSGi Dependencies -->
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>${version.osgi}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>${version.osgi}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.jmx.internal.JMXServiceActivator</Bundle-Activator>
- <Export-Package>
- org.jboss.osgi.jmx;version=${version}
- </Export-Package>
- <Import-Package>
-
- <!-- system -->
- javax.management*,
- javax.naming,
- javax.naming.spi,
-
- <!-- jboss-osgi -->
- org.jboss.osgi.spi*;version="[1.0,2.0)",
-
- <!-- osgi -->
- org.osgi.framework;version="[1.5,2.0)",
- org.osgi.service.packageadmin;version="[1.2,2.0)",
- org.osgi.util.tracker;version="[1.4,2.0)",
-
- <!-- FIXME: make optional
- org.jboss.osgi.jndi;resolution:=optional,
- org.jboss.net.sockets;resolution:=optional,
- org.jnp.interfaces;resolution:=optional,
- -->
- org.jboss.osgi.jndi;version="[1.0,2.0)",
- org.jboss.net.sockets;version="[2.2,3.0)",
- org.jnp.interfaces;version="[5.0,6.0)",
-
- </Import-Package>
- <DynamicImport-Package>*</DynamicImport-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <!-- For some reason the distribution javadoc module needs this -->
- <file>target/${artifactId}-${version}-sources.jar</file>
- <classifier>sources</classifier>
- <type>jar</type>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common-core</artifactId>
+ <version>${version.jboss.osgi.common.core}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jndi</artifactId>
+ <version>${version.jboss.osgi.jndi}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.jmx</groupId>
+ <artifactId>org.apache.aries.jmx.api</artifactId>
+ <version>${version.apache.aries.jmx}</version>
+ </dependency>
+
+ <!-- OSGi Dependencies -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>${version.osgi}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
</project>
More information about the jboss-osgi-commits
mailing list