JBoss-OSGI SVN: r101391 - in projects/jboss-osgi: projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle and 7 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-02-24 07:58:50 -0500 (Wed, 24 Feb 2010)
New Revision: 101391
Added:
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateResolveDeployer.java
Modified:
projects/jboss-osgi/projects/runtime/framework/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiClassLoadingDeployer.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentAttachmentDeployer.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/PackageAdminImpl.java
projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Log:
[JBDEPLOY-226] Allow multiple deployments to change state at once
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml 2010-02-24 12:25:12 UTC (rev 101390)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/etc/osgitck/jboss-osgi-bootstrap.xml 2010-02-24 12:58:50 UTC (rev 101391)
@@ -153,6 +153,7 @@
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateInstallDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateInstallDeployer"/>
+ <bean name="OSGiBundleStateResolveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateResolveDeployer"/>
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
<bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
<bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2010-02-24 12:25:12 UTC (rev 101390)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiBundleManager.java 2010-02-24 12:58:50 UTC (rev 101391)
@@ -46,15 +46,12 @@
import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.client.spi.IncompleteDeploymentException;
import org.jboss.deployers.client.spi.IncompleteDeployments;
import org.jboss.deployers.client.spi.MissingDependency;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.attachments.MutableAttachments;
-import org.jboss.deployers.spi.deployer.DeploymentStage;
import org.jboss.deployers.spi.deployer.DeploymentStages;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
@@ -1088,85 +1085,6 @@
}
/**
- * Resolve a bundle
- *
- * @param bundleState the bundle state
- * @param errorOnFail whether to throw an error if it cannot be resolved
- * @return true when resolved
- */
- public boolean resolveBundle(OSGiBundleState bundleState, boolean errorOnFail) throws BundleException
- {
- int state = bundleState.getState();
- if (state != Bundle.INSTALLED)
- return true;
-
- // A bundle can only resolve if the framework is running on a VM which
- // implements one of the listed required execution environments.
- List<String> reqExecEnvironments = bundleState.getOSGiMetaData().getRequiredExecutionEnvironment();
- if (reqExecEnvironments != null)
- {
- boolean foundExecEnv = false;
- String fwExecEnvs = getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT);
- for (String aux : reqExecEnvironments)
- {
- if (fwExecEnvs.contains(aux))
- {
- foundExecEnv = true;
- break;
- }
- }
-
- if (foundExecEnv == false)
- {
- String msg = "Cannot find any of the required execution environments " + reqExecEnvironments + ", we have: " + fwExecEnvs;
- if (errorOnFail == true)
- throw new BundleException(msg);
-
- log.error(msg);
- return false;
- }
- }
-
- DeploymentUnit unit = bundleState.getDeploymentUnit();
- String unitName = unit.getName();
-
- ControllerContext context = unit.getAttachment(ControllerContext.class);
- ControllerState requiredState = context.getRequiredState();
- DeploymentStage requiredStage = unit.getRequiredStage();
-
- // TODO [JBDEPLOY-226] Allow multiple deployments to change state at once
- try
- {
- deployerClient.change(unitName, DeploymentStages.CLASSLOADER);
- deployerClient.checkComplete(unitName);
-
- // Advance the attached fragments to CLASSLOADER
- for (OSGiFragmentState fragment : bundleState.getAttachedFragments())
- {
- String fragUnitName = fragment.getDeploymentUnit().getName();
- deployerClient.change(fragUnitName, DeploymentStages.CLASSLOADER);
- deployerClient.checkComplete(fragUnitName);
- }
-
- bundleState.changeState(Bundle.RESOLVED);
- for (OSGiFragmentState fragment : bundleState.getAttachedFragments())
- fragment.changeState(Bundle.RESOLVED);
-
- return true;
- }
- catch (DeploymentException ex)
- {
- unit.setRequiredStage(requiredStage);
- context.setRequiredState(requiredState);
-
- if (errorOnFail)
- throw new BundleException("Error resolving bundle: " + bundleState, ex);
-
- return false;
- }
- }
-
- /**
* Start a bundle.
*
* Stating a bundle is done in an attempt to move the bundle's DeploymentUnit to state INSTALLED.
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiClassLoadingDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiClassLoadingDeployer.java 2010-02-24 12:25:12 UTC (rev 101390)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/AbstractOSGiClassLoadingDeployer.java 2010-02-24 12:58:50 UTC (rev 101391)
@@ -47,7 +47,7 @@
import org.jboss.osgi.framework.plugins.SystemPackagesPlugin;
/**
- * An abstract OSGi classloading deployer, that maps osgi metadata into classloading metadata.
+ * An abstract OSGi classloading deployer, that maps {@link OSGiMetaData} into {@link ClassLoadingMetaData}.
*
* @author Thomas.Diesler(a)jboss.com
* @since 07-Jan-2010
Added: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateResolveDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateResolveDeployer.java (rev 0)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateResolveDeployer.java 2010-02-24 12:58:50 UTC (rev 101391)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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.framework.deployers;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.framework.bundle.OSGiBundleState;
+import org.jboss.osgi.framework.bundle.OSGiFragmentState;
+import org.osgi.framework.Bundle;
+
+/**
+ * A deployer that sets the bundle state to RESOLVED when the ClassLoader becomes available.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 24-Feb-2010
+ */
+public class OSGiBundleStateResolveDeployer extends AbstractSimpleRealDeployer<OSGiBundleState>
+{
+ // The relative order at which to change the bindle state to RESOLVED
+ static final int RELATIVE_ORDER = 200;
+
+ public OSGiBundleStateResolveDeployer()
+ {
+ super(OSGiBundleState.class);
+ setStage(DeploymentStages.CLASSLOADER);
+ setRelativeOrder(RELATIVE_ORDER);
+ setTopLevelOnly(true);
+ }
+
+ @Override
+ public void deploy(DeploymentUnit unit, OSGiBundleState bundleState) throws DeploymentException
+ {
+ // Change the bundle state to RESOLVED
+ bundleState.changeState(Bundle.RESOLVED);
+ for (OSGiFragmentState fragment : bundleState.getAttachedFragments())
+ fragment.changeState(Bundle.RESOLVED);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiBundleStateResolveDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentAttachmentDeployer.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentAttachmentDeployer.java 2010-02-24 12:25:12 UTC (rev 101390)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/deployers/OSGiFragmentAttachmentDeployer.java 2010-02-24 12:58:50 UTC (rev 101391)
@@ -49,10 +49,14 @@
*/
public class OSGiFragmentAttachmentDeployer extends AbstractSimpleRealDeployer<ClassLoadingMetaData>
{
+ // The relative order at which the fragments get attached
+ static final int RELATIVE_ORDER = 100;
+
public OSGiFragmentAttachmentDeployer()
{
super(ClassLoadingMetaData.class);
setStage(DeploymentStages.CLASSLOADER);
+ setRelativeOrder(RELATIVE_ORDER);
setTopLevelOnly(true);
}
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/PackageAdminImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/PackageAdminImpl.java 2010-02-24 12:25:12 UTC (rev 101390)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/PackageAdminImpl.java 2010-02-24 12:58:50 UTC (rev 101391)
@@ -33,7 +33,13 @@
import org.jboss.classloading.spi.metadata.CapabilitiesMetaData;
import org.jboss.classloading.spi.metadata.Capability;
import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.plugins.classloading.AbstractDeploymentClassLoaderPolicyModule;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStage;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.logging.Logger;
import org.jboss.osgi.framework.bundle.AbstractBundleState;
@@ -52,6 +58,7 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
import org.osgi.service.packageadmin.ExportedPackage;
import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.service.packageadmin.RequiredBundle;
@@ -170,7 +177,7 @@
public ExportedPackage[] getExportedPackages(String name)
{
List<ExportedPackage> exported = new ArrayList<ExportedPackage>();
-
+
for (AbstractBundleState auxBundle : getBundleManager().getBundles())
{
ExportedPackage[] exportedPackages = getExportedPackages(auxBundle);
@@ -183,7 +190,7 @@
}
}
}
-
+
if (exported.size() == 0)
return null;
@@ -198,17 +205,17 @@
AbstractBundleState absBundleState = AbstractBundleState.assertBundleState(bundle);
if (absBundleState instanceof OSGiBundleState == false)
return null;
-
+
List<Bundle> bundles = new ArrayList<Bundle>();
-
+
OSGiBundleState bundleState = (OSGiBundleState)absBundleState;
List<OSGiFragmentState> fragments = bundleState.getAttachedFragments();
for (OSGiFragmentState aux : fragments)
bundles.add(aux.getBundleInternal());
-
+
if (bundles.isEmpty())
return null;
-
+
return bundles.toArray(new Bundle[bundles.size()]);
}
@@ -217,9 +224,9 @@
AbstractBundleState absBundleState = AbstractBundleState.assertBundleState(bundle);
if (absBundleState instanceof OSGiFragmentState == false)
return null;
-
+
List<Bundle> bundles = new ArrayList<Bundle>();
-
+
// [TODO] Add support for multiple hosts
OSGiFragmentState bundleState = (OSGiFragmentState)absBundleState;
OSGiBundleState fragmentHost = bundleState.getFragmentHost();
@@ -227,10 +234,10 @@
{
bundles.add(fragmentHost.getBundle());
}
-
+
if (bundles.isEmpty())
return null;
-
+
return bundles.toArray(new Bundle[bundles.size()]);
}
@@ -270,69 +277,134 @@
if (unresolvedBundles.isEmpty())
return true;
+ // The list of bundle deployments which should be able to advance to CLASSLOADER stage
List<OSGiBundleState> resolvableBundles = new ArrayList<OSGiBundleState>();
// Check if the external resolver plugin is available
Resolver bundleResolver = getBundleManager().getOptionalPlugin(ResolverPlugin.class);
if (bundleResolver != null)
{
- // Resolve the bundles through the resolver
+ // Resolve the bundles through the resolver. The return is the list of
+ // bundles that the external resolver could actually resolve
for (ResolverBundle aux : bundleResolver.resolve(unresolvedBundles))
- resolvableBundles.add(OSGiBundleState.assertBundleState(aux.getBundle()));
+ {
+ OSGiBundleState bundleState = OSGiBundleState.assertBundleState(aux.getBundle());
+ resolvableBundles.add(bundleState);
+ }
}
else
{
- // Every unresolved bundle is automatically copied
- // to the list of externaly resolved bundles
+ // Every unresolved bundle is automatically copied to the list of resolvable bundles
for (Bundle aux : unresolvedBundles)
- resolvableBundles.add(OSGiBundleState.assertBundleState(aux));
+ {
+ OSGiBundleState bundleState = OSGiBundleState.assertBundleState(aux);
+ resolvableBundles.add(bundleState);
+ }
}
+ // Remove the bundles that do not pass the execution env check
+ Iterator<OSGiBundleState> itBundles = resolvableBundles.iterator();
+ while(itBundles.hasNext())
+ {
+ OSGiBundleState bundleState = itBundles.next();
+ try
+ {
+ verifyExecutionEnvironment(bundleState, true);
+ }
+ catch (BundleException ex)
+ {
+ itBundles.remove();
+ }
+ }
+
+ // We can only return true if all bundles are resolvable.
boolean allResolved = resolvableBundles.containsAll(unresolvedBundles);
// TODO [JBDEPLOY-226] Allow multiple deployments to change state at once
- int resolved = 1;
- while (resolved > 0)
+ resolveBundles(resolvableBundles);
+
+ try
{
- resolved = 0;
- Iterator<OSGiBundleState> it = resolvableBundles.iterator();
- while (it.hasNext())
+ DeployerClient deployerClient = getBundleManager().getDeployerClient();
+ deployerClient.checkComplete();
+ }
+ catch (DeploymentException ex)
+ {
+ log.error("Error resolving bundles: " + resolvableBundles, ex);
+ allResolved = false;
+ }
+
+ return allResolved;
+ }
+
+ private void resolveBundles(List<OSGiBundleState> resolvableBundles)
+ {
+ for (OSGiBundleState bundleState: resolvableBundles)
+ {
+ // If the bundle is in any other state but INSTALLED there is nothing to do
+ if (bundleState.getState() != Bundle.INSTALLED)
+ continue;
+
+ DeploymentUnit unit = bundleState.getDeploymentUnit();
+ String unitName = unit.getName();
+
+ ControllerContext context = unit.getAttachment(ControllerContext.class);
+ ControllerState requiredState = context.getRequiredState();
+ DeploymentStage requiredStage = unit.getRequiredStage();
+
+ try
{
- OSGiBundleState bundleState = it.next();
- try
+ DeployerClient deployerClient = getBundleManager().getDeployerClient();
+ deployerClient.change(unitName, DeploymentStages.CLASSLOADER);
+
+ // Advance the attached fragments to CLASSLOADER
+ for (OSGiFragmentState fragment : bundleState.getAttachedFragments())
{
- boolean bundleResolved = getBundleManager().resolveBundle(bundleState, false);
- if (bundleResolved)
- {
- it.remove();
- resolved++;
- }
+ String fragUnitName = fragment.getDeploymentUnit().getName();
+ deployerClient.change(fragUnitName, DeploymentStages.CLASSLOADER);
}
- catch (BundleException ex)
- {
- // ignore
- }
+
+ // bundleState.changeState(Bundle.RESOLVED);
+ // for (OSGiFragmentState fragment : bundleState.getAttachedFragments())
+ // fragment.changeState(Bundle.RESOLVED);
}
+ catch (DeploymentException ex)
+ {
+ unit.setRequiredStage(requiredStage);
+ context.setRequiredState(requiredState);
+ log.error("Error resolving bundle: " + bundleState, ex);
+ }
}
+ }
- // Sanity check, that the controller could actually also resolve these bundles
- if (resolvableBundles.isEmpty() == false)
+ private boolean verifyExecutionEnvironment(OSGiBundleState bundleState, boolean errorOnFail) throws BundleException
+ {
+ // A bundle can only resolve if the framework is running on a VM which
+ // implements one of the listed required execution environments.
+ List<String> reqExecEnvs = bundleState.getOSGiMetaData().getRequiredExecutionEnvironment();
+ if (reqExecEnvs == null)
+ return true;
+
+ boolean foundExecEnv = false;
+ String fwExecEnvs = getBundleManager().getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT);
+ for (String aux : reqExecEnvs)
{
- log.error("Controller could not resolve: " + resolvableBundles);
- for (OSGiBundleState bundleState : resolvableBundles)
+ if (fwExecEnvs.contains(aux))
{
- try
- {
- getBundleManager().resolveBundle(bundleState, true);
- }
- catch (Exception ex)
- {
- log.debug("Cannot resolve: " + bundleState, ex);
- }
+ foundExecEnv = true;
+ break;
}
}
+
+ if (foundExecEnv == false)
+ {
+ String msg = "Cannot find any of the required execution environments " + reqExecEnvs + ", we have: " + fwExecEnvs;
+ if (errorOnFail == true)
+ throw new BundleException(msg);
- allResolved = allResolved && resolvableBundles.isEmpty();
- return allResolved;
+ log.error(msg);
+ }
+
+ return foundExecEnv;
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml 2010-02-24 12:25:12 UTC (rev 101390)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/resources/bootstrap/jboss-osgi-bootstrap.xml 2010-02-24 12:58:50 UTC (rev 101391)
@@ -164,6 +164,7 @@
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateInstallDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateInstallDeployer"/>
+ <bean name="OSGiBundleStateResolveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateResolveDeployer"/>
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
<bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
<bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2010-02-24 12:25:12 UTC (rev 101390)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2010-02-24 12:58:50 UTC (rev 101391)
@@ -176,6 +176,7 @@
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateInstallDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateInstallDeployer"/>
+ <bean name="OSGiBundleStateResolveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateResolveDeployer"/>
<bean name="OSGiBundleStructure" class="org.jboss.osgi.deployer.BundleStructureDeployer" />
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
<bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2010-02-24 12:25:12 UTC (rev 101390)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2010-02-24 12:58:50 UTC (rev 101391)
@@ -207,6 +207,7 @@
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateInstallDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateInstallDeployer"/>
+ <bean name="OSGiBundleStateResolveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateResolveDeployer"/>
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
<bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
<bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-02-24 12:25:12 UTC (rev 101390)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-02-24 12:58:50 UTC (rev 101391)
@@ -190,6 +190,7 @@
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateInstallDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateInstallDeployer"/>
+ <bean name="OSGiBundleStateResolveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateResolveDeployer"/>
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
<bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
<bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-02-24 12:25:12 UTC (rev 101390)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2010-02-24 12:58:50 UTC (rev 101391)
@@ -164,6 +164,7 @@
<constructor><parameter><inject bean="OSGiBundleManager" /></parameter></constructor>
</bean>
<bean name="OSGiBundleStateInstallDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateInstallDeployer"/>
+ <bean name="OSGiBundleStateResolveDeployer" class="org.jboss.osgi.framework.deployers.OSGiBundleStateResolveDeployer"/>
<bean name="OSGiContextTrackerDeployer" class="org.jboss.osgi.framework.deployers.OSGiContextTrackerDeployer" />
<bean name="OSGiManifestParsingDeployer" class="org.jboss.osgi.framework.deployers.OSGiManifestParsingDeployer" />
<bean name="OSGiNativeCodeMetaDataDeployer" class="org.jboss.osgi.framework.deployers.OSGiNativeCodeMetaDataDeployer" />
14 years, 3 months
JBoss-OSGI SVN: r101390 - in projects/jboss-osgi: trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108 and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-02-24 07:25:12 -0500 (Wed, 24 Feb 2010)
New Revision: 101390
Modified:
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGi108TestCase.java
Log:
Aries JMX dependes on Compendium
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2010-02-24 12:13:48 UTC (rev 101389)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2010-02-24 12:25:12 UTC (rev 101390)
@@ -26,6 +26,7 @@
import javax.management.MBeanServer;
import org.jboss.osgi.spi.capability.Capability;
+import org.jboss.osgi.spi.capability.CompendiumCapability;
/**
* Adds the JMX capability to the {@link OSGiRuntime}
@@ -55,6 +56,8 @@
addSystemProperty("org.jboss.osgi.jmx.host", System.getProperty("jboss.bind.address", "localhost"));
addSystemProperty("org.jboss.osgi.jmx.rmi.port", "1198");
+ addDependency(new CompendiumCapability());
+
addBundle("bundles/jboss-osgi-jmx.jar");
addBundle("bundles/org.apache.aries.jmx.jar");
}
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGi108TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGi108TestCase.java 2010-02-24 12:13:48 UTC (rev 101389)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi108/OSGi108TestCase.java 2010-02-24 12:25:12 UTC (rev 101390)
@@ -28,6 +28,7 @@
import java.util.List;
import org.jboss.osgi.jmx.JMXCapability;
+import org.jboss.osgi.spi.capability.LogServiceCapability;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiPackageAdmin;
@@ -56,6 +57,7 @@
public static void beforeClass() throws Exception
{
runtime = new OSGiTestHelper().getDefaultRuntime();
+ runtime.addCapability(new LogServiceCapability());
runtime.addCapability(new JMXCapability());
}
14 years, 3 months
JBoss-OSGI SVN: r101381 - in projects/jboss-osgi/projects: bundles/husky/trunk/scripts and 13 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-02-24 05:32:47 -0500 (Wed, 24 Feb 2010)
New Revision: 101381
Added:
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractTestCase.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateTestCase.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkTestCase.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateTestCase.java
Removed:
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateMBeanTestCase.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkMBeanTestCase.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/scripts/assembly-bundles.xml
projects/jboss-osgi/projects/bundles/husky/trunk/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/pom.xml
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/assembly-bundles.xml
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jndi/trunk/jndi-bundle/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
projects/jboss-osgi/projects/runtime/framework/trunk/scripts/assembly-all.xml
projects/jboss-osgi/projects/testing/trunk/pom.xml
projects/jboss-osgi/projects/testing/trunk/scripts/assembly-bundles.xml
Log:
Cleanup dependencies and remove dependency on stale jmx bundle
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -42,6 +42,7 @@
<properties>
<version.apache.aries.jmx>1.0.0-incubating-SNAPSHOT</version.apache.aries.jmx>
<version.apache.felix.log>1.0.0</version.apache.felix.log>
+ <version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.jmx>1.0.4-SNAPSHOT</version.jboss.osgi.jmx>
<version.jboss.osgi.runtime.felix>2.0.2.SP1-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.testing>1.0.0-SNAPSHOT</version.jboss.osgi.testing>
@@ -61,16 +62,16 @@
<version>${version.apache.aries.jmx}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi.jmx</groupId>
+ <artifactId>jboss-osgi-jmx-api</artifactId>
+ <version>${version.jboss.osgi.jmx}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-deployment</artifactId>
<version>${version.jboss.osgi.deployment}</version>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jmx</artifactId>
- <version>${version.jboss.osgi.jmx}</version>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
@@ -98,6 +99,18 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.jmx</groupId>
+ <artifactId>jboss-osgi-jmx</artifactId>
+ <version>${version.jboss.osgi.jmx}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- OSGi Dependencies -->
<dependency>
@@ -126,6 +139,11 @@
<version>${version.jboss.osgi.testing}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/scripts/assembly-bundles.xml 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/scripts/assembly-bundles.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -15,19 +15,8 @@
<outputDirectory>bundles</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>*:jboss-osgi-common-core:jar</include>
<include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
- <include>*:jboss-osgi-jndi:jar</include>
- </includes>
- <useStrictFiltering>true</useStrictFiltering>
- <scope>compile</scope>
- <unpack>false</unpack>
- </dependencySet>
- <dependencySet>
- <outputDirectory>bundles</outputDirectory>
- <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
- <includes>
<include>*:org.apache.aries.jmx:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.osgi.compendium:jar</include>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/test/resources/jboss-osgi-framework.properties 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/test/resources/jboss-osgi-framework.properties 2010-02-24 10:32:47 UTC (rev 101381)
@@ -38,4 +38,6 @@
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-common.jar
\ No newline at end of file
+ file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
+ file://${test.archive.directory}/bundles/org.apache.aries.jmx.jar \
+ file://${test.archive.directory}/bundles/jboss-osgi-jmx.jar
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/pom.xml 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/pom.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -35,10 +35,6 @@
<artifactId>jboss-osgi-spi</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.jndi</groupId>
- <artifactId>jboss-osgi-jndi-api</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.aries.jmx</groupId>
<artifactId>org.apache.aries.jmx.api</artifactId>
</dependency>
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2010-02-24 10:32:47 UTC (rev 101381)
@@ -25,7 +25,6 @@
import javax.management.MBeanServer;
-import org.jboss.osgi.jndi.JNDICapability;
import org.jboss.osgi.spi.capability.Capability;
/**
@@ -34,7 +33,6 @@
*
* 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
@@ -57,8 +55,6 @@
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");
}
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -36,30 +36,12 @@
<version>${version}</version>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.jndi</groupId>
- <artifactId>jboss-osgi-jndi-api</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.aries.jmx</groupId>
<artifactId>org.apache.aries.jmx.api</artifactId>
</dependency>
<!-- Provided Dependencies -->
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.jndi</groupId>
- <artifactId>jboss-osgi-jndi</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.apache.aries.jmx</groupId>
<artifactId>org.apache.aries.jmx</artifactId>
<scope>provided</scope>
@@ -79,6 +61,11 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <scope>provided</scope>
+ </dependency>
<!-- OSGi Dependencies -->
<dependency>
@@ -136,7 +123,6 @@
<!-- jboss-osgi -->
org.jboss.osgi.spi*;version="[1.0,2.0)",
org.jboss.osgi.jmx;version="[1.0,2.0)",
- org.jboss.osgi.jndi;version="[1.0,2.0)",
<!-- osgi -->
org.osgi.framework;version="[1.5,2.0)",
@@ -144,13 +130,10 @@
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.net.sockets;version="[2.2,3.0)",
- org.jnp.interfaces;version="[5.0,6.0)",
+ <!-- optional jndi support -->
+ org.jboss.net.sockets;version="[2.2,3.0)";resolution:=optional,
+ org.jboss.osgi.jndi;version="[1.0,2.0)";resolution:=optional,
+ org.jnp.interfaces;version="[5.0,6.0)";resolution:=optional,
</Import-Package>
<Embed-Dependency>
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/assembly-bundles.xml 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/assembly-bundles.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -15,18 +15,7 @@
<outputDirectory>bundles</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>*:jboss-osgi-common-core:jar</include>
- </includes>
- <useStrictFiltering>true</useStrictFiltering>
- <scope>compile</scope>
- <unpack>false</unpack>
- </dependencySet>
- <dependencySet>
- <outputDirectory>bundles</outputDirectory>
- <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
- <includes>
<include>*:jboss-osgi-common:jar</include>
- <include>*:jboss-osgi-jndi:jar</include>
<include>*:org.apache.aries.jmx:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.osgi.compendium:jar</include>
Deleted: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java 2010-02-24 10:32:47 UTC (rev 101381)
@@ -1,106 +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.test.osgi.jmx;
-
-//$Id$
-
-import java.util.ArrayList;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
-import org.jboss.osgi.jmx.FrameworkMBeanExt;
-import org.jboss.osgi.jmx.ServiceStateMBeanExt;
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.management.ObjectNameFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.osgi.framework.launch.Framework;
-import org.osgi.jmx.framework.BundleStateMBean;
-
-/**
- * An abstract JMX test case.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Feb-2010
- */
-public abstract class AbstractJMXTestCase
-{
- private static Framework framework;
- private MBeanServer server;
-
- @BeforeClass
- public static void setUpClass() throws Exception
- {
- OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
- framework = bootProvider.getFramework();
- framework.start();
- }
-
- @AfterClass
- public static void tearDownClass() throws Exception
- {
- if (framework != null)
- {
- framework.stop();
- framework.waitForStop(3000);
- }
- }
-
- public FrameworkMBeanExt getFramework() throws Exception
- {
- ObjectName oname = ObjectNameFactory.create(FrameworkMBeanExt.OBJECTNAME);
- return MBeanProxy.get(getMBeanServer(), oname, FrameworkMBeanExt.class);
- }
-
- public BundleStateMBean getBundleState() throws Exception
- {
- ObjectName oname = ObjectNameFactory.create(BundleStateMBean.OBJECTNAME);
- return MBeanProxy.get(getMBeanServer(), oname, BundleStateMBean.class);
- }
-
- public ServiceStateMBeanExt getServiceState() throws Exception
- {
- ObjectName oname = ObjectNameFactory.create(ServiceStateMBeanExt.OBJECTNAME);
- return MBeanProxy.get(getMBeanServer(), oname, ServiceStateMBeanExt.class);
- }
-
- protected MBeanServer getMBeanServer()
- {
- if (server == null)
- {
- ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
- if (serverArr.size() > 1)
- throw new IllegalStateException("Multiple MBeanServer instances not supported");
-
- if (serverArr.size() == 1)
- server = serverArr.get(0);
-
- if (server == null)
- server = MBeanServerFactory.createMBeanServer();
- }
- return server;
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractTestCase.java (from rev 101378, projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractTestCase.java 2010-02-24 10:32:47 UTC (rev 101381)
@@ -0,0 +1,112 @@
+/*
+ * 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.test.osgi.jmx;
+
+//$Id$
+
+import java.util.ArrayList;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+
+import org.jboss.osgi.jmx.FrameworkMBeanExt;
+import org.jboss.osgi.jmx.ServiceStateMBeanExt;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.launch.Framework;
+import org.osgi.jmx.framework.BundleStateMBean;
+
+/**
+ * An abstract JMX test case.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Feb-2010
+ */
+public abstract class AbstractTestCase
+{
+ private static Framework framework;
+ private MBeanServer server;
+
+ @BeforeClass
+ public static void setUpClass() throws Exception
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ framework = bootProvider.getFramework();
+ framework.start();
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ if (framework != null)
+ {
+ framework.stop();
+ framework.waitForStop(3000);
+ }
+ }
+
+ protected BundleContext getSystemContext()
+ {
+ return framework.getBundleContext();
+ }
+
+ protected FrameworkMBeanExt getFrameworkMBean() throws Exception
+ {
+ ObjectName oname = ObjectNameFactory.create(FrameworkMBeanExt.OBJECTNAME);
+ return MBeanProxy.get(getMBeanServer(), oname, FrameworkMBeanExt.class);
+ }
+
+ protected BundleStateMBean getBundleStateMBean() throws Exception
+ {
+ ObjectName oname = ObjectNameFactory.create(BundleStateMBean.OBJECTNAME);
+ return MBeanProxy.get(getMBeanServer(), oname, BundleStateMBean.class);
+ }
+
+ protected ServiceStateMBeanExt getServiceStateMBean() throws Exception
+ {
+ ObjectName oname = ObjectNameFactory.create(ServiceStateMBeanExt.OBJECTNAME);
+ return MBeanProxy.get(getMBeanServer(), oname, ServiceStateMBeanExt.class);
+ }
+
+ protected MBeanServer getMBeanServer()
+ {
+ if (server == null)
+ {
+ ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
+ if (serverArr.size() > 1)
+ throw new IllegalStateException("Multiple MBeanServer instances not supported");
+
+ if (serverArr.size() == 1)
+ server = serverArr.get(0);
+
+ if (server == null)
+ server = MBeanServerFactory.createMBeanServer();
+ }
+ return server;
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateMBeanTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateMBeanTestCase.java 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateMBeanTestCase.java 2010-02-24 10:32:47 UTC (rev 101381)
@@ -1,58 +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.test.osgi.jmx;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import javax.management.ObjectName;
-import javax.management.openmbean.TabularData;
-
-import org.jboss.osgi.spi.management.ObjectNameFactory;
-import org.junit.Test;
-import org.osgi.jmx.framework.BundleStateMBean;
-
-/**
- * A test that excercises the BundleStateMBean
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Feb-2010
- */
-public class BundleStateMBeanTestCase extends AbstractJMXTestCase
-{
- @Test
- public void testMBeanAccess() throws Exception
- {
- ObjectName oname = ObjectNameFactory.create(BundleStateMBean.OBJECTNAME);
- assertTrue("Registerd " + oname, getMBeanServer().isRegistered(oname));
- }
-
- @Test
- public void listBundles() throws Exception
- {
- BundleStateMBean bundleState = getBundleState();
- TabularData data = bundleState.listBundles();
- assertEquals("Number of bundles", 8, data.size());
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateTestCase.java (from rev 101378, projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateMBeanTestCase.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateTestCase.java 2010-02-24 10:32:47 UTC (rev 101381)
@@ -0,0 +1,61 @@
+/*
+ * 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.test.osgi.jmx;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import javax.management.ObjectName;
+import javax.management.openmbean.TabularData;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.jmx.framework.BundleStateMBean;
+
+/**
+ * A test that excercises the BundleStateMBean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Feb-2010
+ */
+public class BundleStateTestCase extends AbstractTestCase
+{
+ @Test
+ public void testMBeanAccess() throws Exception
+ {
+ ObjectName oname = ObjectNameFactory.create(BundleStateMBean.OBJECTNAME);
+ assertTrue("Registerd " + oname, getMBeanServer().isRegistered(oname));
+ }
+
+ @Test
+ public void listBundles() throws Exception
+ {
+ Bundle[] bundles = getSystemContext().getBundles();
+
+ BundleStateMBean bundleState = getBundleStateMBean();
+ TabularData data = bundleState.listBundles();
+ assertEquals("Number of bundles", bundles.length, data.size());
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkMBeanTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkMBeanTestCase.java 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkMBeanTestCase.java 2010-02-24 10:32:47 UTC (rev 101381)
@@ -1,52 +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.test.osgi.jmx;
-
-//$Id$
-
-import static org.junit.Assert.assertTrue;
-
-import javax.management.ObjectName;
-
-import org.jboss.osgi.jmx.FrameworkMBeanExt;
-import org.jboss.osgi.spi.management.ObjectNameFactory;
-import org.junit.Test;
-import org.osgi.jmx.framework.FrameworkMBean;
-
-/**
- * A test that excercises the FramworkMBean
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Feb-2010
- */
-public class FrameworkMBeanTestCase extends AbstractJMXTestCase
-{
- @Test
- public void testMBeanAccess() throws Exception
- {
- ObjectName oname = ObjectNameFactory.create(FrameworkMBean.OBJECTNAME);
- assertTrue("Registerd " + oname, getMBeanServer().isRegistered(oname));
-
- oname = ObjectNameFactory.create(FrameworkMBeanExt.OBJECTNAME);
- assertTrue("Registerd " + oname, getMBeanServer().isRegistered(oname));
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkTestCase.java (from rev 101378, projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkMBeanTestCase.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkTestCase.java 2010-02-24 10:32:47 UTC (rev 101381)
@@ -0,0 +1,52 @@
+/*
+ * 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.test.osgi.jmx;
+
+//$Id$
+
+import static org.junit.Assert.assertTrue;
+
+import javax.management.ObjectName;
+
+import org.jboss.osgi.jmx.FrameworkMBeanExt;
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.junit.Test;
+import org.osgi.jmx.framework.FrameworkMBean;
+
+/**
+ * A test that excercises the FramworkMBean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Feb-2010
+ */
+public class FrameworkTestCase extends AbstractTestCase
+{
+ @Test
+ public void testMBeanAccess() throws Exception
+ {
+ ObjectName oname = ObjectNameFactory.create(FrameworkMBean.OBJECTNAME);
+ assertTrue("Registerd " + oname, getMBeanServer().isRegistered(oname));
+
+ oname = ObjectNameFactory.create(FrameworkMBeanExt.OBJECTNAME);
+ assertTrue("Registerd " + oname, getMBeanServer().isRegistered(oname));
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java 2010-02-24 10:32:47 UTC (rev 101381)
@@ -1,79 +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.test.osgi.jmx;
-
-//$Id$
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import javax.management.MBeanServer;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.TabularData;
-
-import org.jboss.osgi.jmx.ServiceStateMBeanExt;
-import org.junit.Test;
-import org.osgi.framework.Constants;
-import org.osgi.jmx.JmxConstants;
-import org.osgi.jmx.framework.ServiceStateMBean;
-
-/**
- * A test that excercises the ServiceStateMBean
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Feb-2010
- */
-public class ServiceStateMBeanTestCase extends AbstractJMXTestCase
-{
- @Test
- public void listBundles() throws Exception
- {
- ServiceStateMBeanExt serviceState = getServiceState();
- TabularData data = serviceState.listServices();
- assertEquals("Number of services", 7, data.size());
- }
-
- @Test
- public void getService() throws Exception
- {
- ServiceStateMBeanExt serviceState = getServiceState();
- CompositeData serviceData = serviceState.getService(MBeanServer.class.getName());
- assertNotNull("MBeanServer service not null", serviceData);
-
- Long serviceId = (Long)serviceData.get(ServiceStateMBean.IDENTIFIER);
- assertNotNull("service.id not null", serviceId);
-
- TabularData props = serviceState.getProperties(serviceId);
- assertNotNull("Properties not null", props);
-
- CompositeData idData = props.get(new Object[] { Constants.SERVICE_ID });
- assertEquals(serviceId.toString(), idData.get(JmxConstants.VALUE));
- }
-
- @Test
- public void getServices() throws Exception
- {
- ServiceStateMBeanExt serviceState = getServiceState();
- TabularData data = serviceState.getServices(MBeanServer.class.getName(), null);
- assertEquals("MBeanServer service not null", 1, data.size());
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateTestCase.java (from rev 101378, projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateTestCase.java 2010-02-24 10:32:47 UTC (rev 101381)
@@ -0,0 +1,85 @@
+/*
+ * 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.test.osgi.jmx;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import javax.management.MBeanServer;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.TabularData;
+
+import org.jboss.osgi.jmx.ServiceStateMBeanExt;
+import org.junit.Test;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.jmx.JmxConstants;
+import org.osgi.jmx.framework.ServiceStateMBean;
+
+/**
+ * A test that excercises the ServiceStateMBean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Feb-2010
+ */
+public class ServiceStateTestCase extends AbstractTestCase
+{
+ @Test
+ public void listServices() throws Exception
+ {
+ ServiceReference[] srefs = getSystemContext().getServiceReferences(null, null);
+
+ ServiceStateMBeanExt serviceState = getServiceStateMBean();
+ TabularData data = serviceState.listServices();
+ assertEquals("Number of services", srefs.length, data.size());
+ }
+
+ @Test
+ public void getService() throws Exception
+ {
+ ServiceStateMBeanExt serviceState = getServiceStateMBean();
+ CompositeData serviceData = serviceState.getService(MBeanServer.class.getName());
+ assertNotNull("MBeanServer service not null", serviceData);
+
+ Long serviceId = (Long)serviceData.get(ServiceStateMBean.IDENTIFIER);
+ assertNotNull("service.id not null", serviceId);
+
+ TabularData props = serviceState.getProperties(serviceId);
+ assertNotNull("Properties not null", props);
+
+ CompositeData idData = props.get(new Object[] { Constants.SERVICE_ID });
+ assertEquals(serviceId.toString(), idData.get(JmxConstants.VALUE));
+ }
+
+ @Test
+ public void getServices() throws Exception
+ {
+ ServiceReference sref = getSystemContext().getServiceReference(MBeanServer.class.getName());
+ Long serviceID = (Long)sref.getProperty(Constants.SERVICE_ID);
+
+ ServiceStateMBeanExt serviceState = getServiceStateMBean();
+ TabularData data = serviceState.getServices(null, "(service.id=" + serviceID + ")");
+ assertEquals("MBeanServer service not null", 1, data.size());
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/jboss-osgi-framework.properties 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/jboss-osgi-framework.properties 2010-02-24 10:32:47 UTC (rev 101381)
@@ -32,7 +32,5 @@
org.jboss.osgi.spi.framework.autoStart=\
file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-common-core.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-jndi.jar \
file://${test.archive.directory}/bundles/org.apache.aries.jmx.jar \
file://${test.archive.directory}/bundles/jboss-osgi-jmx.jar
\ 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-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -42,10 +42,8 @@
<version.apache.aries.jmx>1.0.0-incubating-SNAPSHOT</version.apache.aries.jmx>
<version.apache.felix.log>1.0.0</version.apache.felix.log>
<version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
- <version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
- <version.jboss.osgi.jndi>1.0.3-SNAPSHOT</version.jboss.osgi.jndi>
- <version.jboss.osgi.runtime.felix>2.0.2.SP1-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.spi>1.0.5-SNAPSHOT</version.jboss.osgi.spi>
+ <version.jboss.osgi.runtime.felix>2.0.2.SP1-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -63,26 +61,6 @@
<version>${version.jboss.osgi.spi}</version>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version.jboss.osgi.common}</version>
- </dependency>
- <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.jndi</groupId>
- <artifactId>jboss-osgi-jndi</artifactId>
- <version>${version.jboss.osgi.jndi}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.jndi</groupId>
- <artifactId>jboss-osgi-jndi-api</artifactId>
- <version>${version.jboss.osgi.jndi}</version>
- </dependency>
- <dependency>
<groupId>org.apache.aries.jmx</groupId>
<artifactId>org.apache.aries.jmx</artifactId>
<version>${version.apache.aries.jmx}</version>
@@ -98,6 +76,11 @@
<version>${version.apache.felix.log}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi.runtime</groupId>
<artifactId>jboss-osgi-runtime-felix</artifactId>
<version>${version.jboss.osgi.runtime.felix}</version>
Modified: projects/jboss-osgi/projects/bundles/jndi/trunk/jndi-bundle/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jndi/trunk/jndi-bundle/pom.xml 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/bundles/jndi/trunk/jndi-bundle/pom.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -36,15 +36,8 @@
<version>${version}</version>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- </dependency>
-
- <!-- Provided Dependencies -->
- <dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnpserver</artifactId>
- <scope>provided</scope>
</dependency>
<!-- OSGi Dependencies -->
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/pom.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -58,6 +58,7 @@
<version.jboss.osgi.husky>1.0.4-SNAPSHOT</version.jboss.osgi.husky>
<version.jboss.osgi.jaxb>2.1.10.SP3</version.jboss.osgi.jaxb>
<version.jboss.osgi.jmx>1.0.4-SNAPSHOT</version.jboss.osgi.jmx>
+ <version.jboss.osgi.jndi>1.0.3-SNAPSHOT</version.jboss.osgi.jndi>
<version.jboss.osgi.reflect>2.2.0</version.jboss.osgi.reflect>
<version.jboss.osgi.runtime.deployers>1.0.4</version.jboss.osgi.runtime.deployers>
<version.jboss.osgi.spi>1.0.5-SNAPSHOT</version.jboss.osgi.spi>
@@ -191,13 +192,6 @@
<version>${version.osgi}</version>
</dependency>
- <!-- Provided Dependencies -->
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <scope>provided</scope>
- </dependency>
-
<!-- Test bundles dependencies -->
<dependency>
<groupId>org.apache.felix</groupId>
@@ -278,12 +272,18 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
+ <groupId>org.jboss.osgi.jmx</groupId>
<artifactId>jboss-osgi-jmx</artifactId>
<version>${version.jboss.osgi.jmx}</version>
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi.jndi</groupId>
+ <artifactId>jboss-osgi-jndi</artifactId>
+ <version>${version.jboss.osgi.jndi}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-reflect</artifactId>
<version>${version.jboss.osgi.reflect}</version>
@@ -325,6 +325,11 @@
<version>${version.jboss.osgi.testing}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
Modified: projects/jboss-osgi/projects/runtime/framework/trunk/scripts/assembly-all.xml
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/scripts/assembly-all.xml 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/scripts/assembly-all.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -55,7 +55,7 @@
<include>*:jboss-logging-log4j:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
- <scope>provided</scope>
+ <scope>test</scope>
<unpack>true</unpack>
</dependencySet>
</dependencySets>
Modified: projects/jboss-osgi/projects/testing/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/pom.xml 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/testing/trunk/pom.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -44,7 +44,6 @@
<version.apache.felix.log>1.0.0</version.apache.felix.log>
<version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.jmx>1.0.4-SNAPSHOT</version.jboss.osgi.jmx>
- <version.jboss.osgi.jndi>1.0.3-SNAPSHOT</version.jboss.osgi.jndi>
<version.jboss.osgi.spi>1.0.5-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.runtime.felix>2.0.2.SP1-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.osgi>4.2.0</version.osgi>
@@ -106,12 +105,6 @@
<version>${version.jboss.osgi.jmx}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.osgi.jndi</groupId>
- <artifactId>jboss-osgi-jndi</artifactId>
- <version>${version.jboss.osgi.jndi}</version>
- <scope>provided</scope>
- </dependency>
<!-- OSGi Dependencies -->
<dependency>
Modified: projects/jboss-osgi/projects/testing/trunk/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/scripts/assembly-bundles.xml 2010-02-24 10:31:14 UTC (rev 101380)
+++ projects/jboss-osgi/projects/testing/trunk/scripts/assembly-bundles.xml 2010-02-24 10:32:47 UTC (rev 101381)
@@ -15,10 +15,8 @@
<outputDirectory>bundles</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>*:jboss-osgi-common-core:jar</include>
<include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
- <include>*:jboss-osgi-jndi:jar</include>
<include>*:org.apache.aries.jmx:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.osgi.compendium:jar</include>
14 years, 3 months
JBoss-OSGI SVN: r101342 - in projects/jboss-osgi/projects: testing/trunk/src/main/java/org/jboss/osgi/testing/internal and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-02-23 15:41:57 -0500 (Tue, 23 Feb 2010)
New Revision: 101342
Modified:
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteServiceReference.java
Log:
Obtain service properties via ServiceStateMBean
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java 2010-02-23 20:18:50 UTC (rev 101341)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java 2010-02-23 20:41:57 UTC (rev 101342)
@@ -32,6 +32,9 @@
import org.jboss.osgi.jmx.ServiceStateMBeanExt;
import org.junit.Test;
+import org.osgi.framework.Constants;
+import org.osgi.jmx.JmxConstants;
+import org.osgi.jmx.framework.ServiceStateMBean;
/**
* A test that excercises the ServiceStateMBean
@@ -53,8 +56,17 @@
public void getService() throws Exception
{
ServiceStateMBeanExt serviceState = getServiceState();
- CompositeData data = serviceState.getService(MBeanServer.class.getName());
- assertNotNull("MBeanServer service not null", data);
+ CompositeData serviceData = serviceState.getService(MBeanServer.class.getName());
+ assertNotNull("MBeanServer service not null", serviceData);
+
+ Long serviceId = (Long)serviceData.get(ServiceStateMBean.IDENTIFIER);
+ assertNotNull("service.id not null", serviceId);
+
+ TabularData props = serviceState.getProperties(serviceId);
+ assertNotNull("Properties not null", props);
+
+ CompositeData idData = props.get(new Object[] { Constants.SERVICE_ID });
+ assertEquals(serviceId.toString(), idData.get(JmxConstants.VALUE));
}
@Test
Modified: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteServiceReference.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteServiceReference.java 2010-02-23 20:18:50 UTC (rev 101341)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteServiceReference.java 2010-02-23 20:41:57 UTC (rev 101342)
@@ -21,10 +21,14 @@
*/
package org.jboss.osgi.testing.internal;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.TabularData;
import org.jboss.osgi.testing.OSGiServiceReference;
+import org.osgi.jmx.JmxConstants;
/**
* A remote implementation of the {@link OSGiServiceReference}
@@ -34,22 +38,30 @@
*/
public class RemoteServiceReference implements OSGiServiceReference
{
- private CompositeData serviceData;
- private TabularData propertiesData;
+ private TabularData propsData;
- public RemoteServiceReference(CompositeData serviceData, TabularData propertiesData)
+ public RemoteServiceReference(CompositeData serviceData, TabularData propData)
{
- this.serviceData = serviceData;
- this.propertiesData = propertiesData;
+ this.propsData = propData;
}
public Object getProperty(String key)
{
- return null;
+ CompositeData propData = propsData.get(new Object[] { key });
+ if (propData == null)
+ return null;
+
+ // [TODO] decode value
+ Object value = propData.get(JmxConstants.VALUE);
+ return value;
}
public String[] getPropertyKeys()
{
- return null;
+ List<String> keys = new ArrayList<String>();
+ for(Object key : propsData.keySet())
+ keys.add((String)key);
+
+ return keys.toArray(new String[keys.size()]);
}
}
14 years, 3 months
JBoss-OSGI SVN: r101339 - projects/jboss-osgi/projects/bundles/blueprint/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-02-23 14:36:18 -0500 (Tue, 23 Feb 2010)
New Revision: 101339
Modified:
projects/jboss-osgi/projects/bundles/blueprint/trunk/pom.xml
Log:
Add jboss-osgi-testing
Modified: projects/jboss-osgi/projects/bundles/blueprint/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/blueprint/trunk/pom.xml 2010-02-23 18:18:14 UTC (rev 101338)
+++ projects/jboss-osgi/projects/bundles/blueprint/trunk/pom.xml 2010-02-23 19:36:18 UTC (rev 101339)
@@ -53,6 +53,7 @@
<version.jboss.osgi.husky>1.0.4-SNAPSHOT</version.jboss.osgi.husky>
<version.jboss.osgi.jmx>1.0.4-SNAPSHOT</version.jboss.osgi.jmx>
<version.jboss.osgi.spi>1.0.5-SNAPSHOT</version.jboss.osgi.spi>
+ <version.jboss.osgi.testing>1.0.0-SNAPSHOT</version.jboss.osgi.testing>
<version.osgi>4.2.0</version.osgi>
<surefire.jpda.args />
@@ -138,6 +139,12 @@
<!-- Test Dependencies -->
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-testing</artifactId>
+ <version>${version.jboss.osgi.testing}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-log4j</artifactId>
<scope>test</scope>
14 years, 3 months
JBoss-OSGI SVN: r101333 - projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-02-23 09:13:38 -0500 (Tue, 23 Feb 2010)
New Revision: 101333
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml
Log:
Update jboss600 to 6.0.0.M2
Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml 2010-02-23 14:13:09 UTC (rev 101332)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/installer/user-input-spec.xml 2010-02-23 14:13:38 UTC (rev 101333)
@@ -16,7 +16,7 @@
<spec>
<choice txt="JBoss-5.0.1" value="jboss501"/>
<choice txt="JBoss-5.1.0" value="jboss510"/>
- <choice txt="JBoss-6.0.0.M1" value="jboss600" set="true"/>
+ <choice txt="JBoss-6.0.0.M2" value="jboss600" set="true"/>
<choice txt="JBoss-6.0.0-SNAPSHOT" value="jboss601"/>
</spec>
</field>
@@ -29,7 +29,7 @@
<field type="radio" variable="jbossSelection">
<description align="left" txt="Please choose your target container" />
<spec>
- <!-- choice txt="JBoss-6.0.0.M2" value="jboss600" set="true"/ -->
+ <choice txt="JBoss-6.0.0.M2" value="jboss600" set="true"/>
<choice txt="JBoss-6.0.0-SNAPSHOT" value="jboss601" set="true"/>
</spec>
</field>
14 years, 3 months
JBoss-OSGI SVN: r101332 - in projects/jboss-osgi/projects/testing/trunk: scripts and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-02-23 09:13:09 -0500 (Tue, 23 Feb 2010)
New Revision: 101332
Removed:
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteFramework.java
projects/jboss-osgi/projects/testing/trunk/src/test/java/org/jboss/test/osgi/husky/
Modified:
projects/jboss-osgi/projects/testing/trunk/pom.xml
projects/jboss-osgi/projects/testing/trunk/scripts/assembly-bundles.xml
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteServiceReference.java
Log:
WIP
Modified: projects/jboss-osgi/projects/testing/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/pom.xml 2010-02-23 14:11:34 UTC (rev 101331)
+++ projects/jboss-osgi/projects/testing/trunk/pom.xml 2010-02-23 14:13:09 UTC (rev 101332)
@@ -42,7 +42,9 @@
<properties>
<version.apache.aries.jmx>1.0.0-incubating-SNAPSHOT</version.apache.aries.jmx>
<version.apache.felix.log>1.0.0</version.apache.felix.log>
+ <version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.jmx>1.0.4-SNAPSHOT</version.jboss.osgi.jmx>
+ <version.jboss.osgi.jndi>1.0.3-SNAPSHOT</version.jboss.osgi.jndi>
<version.jboss.osgi.spi>1.0.5-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.runtime.felix>2.0.2.SP1-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.osgi>4.2.0</version.osgi>
@@ -60,8 +62,8 @@
<version>${version.jboss.osgi.spi}</version>
</dependency>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jmx</artifactId>
+ <groupId>org.jboss.osgi.jmx</groupId>
+ <artifactId>jboss-osgi-jmx-api</artifactId>
<version>${version.jboss.osgi.jmx}</version>
</dependency>
<dependency>
@@ -92,6 +94,24 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.jmx</groupId>
+ <artifactId>jboss-osgi-jmx</artifactId>
+ <version>${version.jboss.osgi.jmx}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.jndi</groupId>
+ <artifactId>jboss-osgi-jndi</artifactId>
+ <version>${version.jboss.osgi.jndi}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- OSGi Dependencies -->
<dependency>
Modified: projects/jboss-osgi/projects/testing/trunk/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/scripts/assembly-bundles.xml 2010-02-23 14:11:34 UTC (rev 101331)
+++ projects/jboss-osgi/projects/testing/trunk/scripts/assembly-bundles.xml 2010-02-23 14:13:09 UTC (rev 101332)
@@ -19,15 +19,6 @@
<include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
- </includes>
- <useStrictFiltering>true</useStrictFiltering>
- <scope>compile</scope>
- <unpack>false</unpack>
- </dependencySet>
- <dependencySet>
- <outputDirectory>bundles</outputDirectory>
- <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
- <includes>
<include>*:org.apache.aries.jmx:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.osgi.compendium:jar</include>
Deleted: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteFramework.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteFramework.java 2010-02-23 14:11:34 UTC (rev 101331)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteFramework.java 2010-02-23 14:13:09 UTC (rev 101332)
@@ -1,49 +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.testing.internal;
-
-//$Id$
-
-import org.jboss.osgi.spi.management.ManagedServiceReference;
-
-/**
- * The supported functionality of a remote OSGi Framework
- *
- * @author thomas.diesler(a)jboss.com
- * @since 04-Mar-2009
- */
-public interface RemoteFramework
-{
- /**
- * Returns a ServiceReference object for a service that implements and was registered
- * under the specified class.
- */
- ManagedServiceReference getServiceReference(String clazz);
-
- /**
- * Returns an array of ManagedServiceReference objects.
- * The returned array of ManagedServiceReference objects contains services
- * that were registered under the specified class, match the specified filter criteria,
- * and the packages for the class names under which the services were registered.
- */
- ManagedServiceReference[] getServiceReferences(String clazz, String filter);
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java 2010-02-23 14:11:34 UTC (rev 101331)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java 2010-02-23 14:13:09 UTC (rev 101332)
@@ -23,8 +23,11 @@
import java.io.IOException;
+import javax.management.ObjectName;
+
+import org.jboss.osgi.jmx.FrameworkMBeanExt;
import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.jboss.osgi.spi.management.ObjectNameFactory;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiPackageAdmin;
import org.jboss.osgi.testing.OSGiRuntime;
@@ -51,7 +54,8 @@
// https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1586
if (bundles == null)
{
- ManagedFrameworkMBean mbeanProxy = MBeanProxy.get(runtime.getMBeanServer(), ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, ManagedFrameworkMBean.class);
+ ObjectName objectName = ObjectNameFactory.create(FrameworkMBeanExt.OBJECTNAME);
+ FrameworkMBeanExt mbeanProxy = MBeanProxy.get(runtime.getMBeanServer(), objectName, FrameworkMBeanExt.class);
return mbeanProxy.resolveAllBundles();
}
@@ -73,7 +77,8 @@
// https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1586
if (bundles == null)
{
- ManagedFrameworkMBean mbeanProxy = MBeanProxy.get(runtime.getMBeanServer(), ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, ManagedFrameworkMBean.class);
+ ObjectName objectName = ObjectNameFactory.create(FrameworkMBeanExt.OBJECTNAME);
+ FrameworkMBeanExt mbeanProxy = MBeanProxy.get(runtime.getMBeanServer(), objectName, FrameworkMBeanExt.class);
mbeanProxy.refreshAllPackages();
return;
}
Modified: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2010-02-23 14:11:34 UTC (rev 101331)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2010-02-23 14:13:09 UTC (rev 101332)
@@ -23,9 +23,13 @@
// $Id$
+import java.io.IOException;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import javax.management.MBeanServerConnection;
@@ -35,9 +39,9 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.osgi.jmx.ServiceStateMBeanExt;
import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
-import org.jboss.osgi.spi.management.ManagedServiceReference;
+import org.jboss.osgi.spi.management.ObjectNameFactory;
import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiPackageAdmin;
@@ -46,6 +50,7 @@
import org.jboss.osgi.testing.OSGiTestHelper;
import org.osgi.framework.BundleException;
import org.osgi.jmx.framework.BundleStateMBean;
+import org.osgi.jmx.framework.ServiceStateMBean;
/**
* A remote implementation of the {@link OSGiRuntime}
@@ -56,7 +61,7 @@
public class RemoteRuntime extends OSGiRuntimeImpl
{
private MBeanServerConnection mbeanServer;
-
+
public RemoteRuntime(OSGiTestHelper helper)
{
super(helper);
@@ -71,7 +76,7 @@
String rootURL = info.getRootURL().toExternalForm();
long bundleId = getFrameworkMBean().installBundle(rootURL);
-
+
RemoteBundle bundle = new RemoteBundle(this, bundleId);
return registerBundle(bundle.getLocation(), bundle);
}
@@ -110,7 +115,7 @@
{
TabularData listBundles = getBundleStateMBean().listBundles();
Iterator<?> iterator = listBundles.values().iterator();
- while(iterator.hasNext())
+ while (iterator.hasNext())
{
CompositeData next = (CompositeData)iterator.next();
Object bundleId = next.get(BundleStateMBean.IDENTIFIER);
@@ -139,23 +144,56 @@
public OSGiServiceReference getServiceReference(String clazz)
{
- ManagedServiceReference manref = getRemoteFramework().getServiceReference(clazz);
- return manref != null ? new RemoteServiceReference(manref) : null;
+ CompositeData serviceData;
+ TabularData propertiesData;
+ try
+ {
+ ServiceStateMBeanExt serviceState = getServiceStateMBeanExt();
+ serviceData = serviceState.getService(clazz);
+ if (serviceData == null)
+ return null;
+
+ Long serviceId = (Long)serviceData.get(ServiceStateMBean.IDENTIFIER);
+ propertiesData = serviceState.getProperties(serviceId);
+ }
+ catch (IOException ex)
+ {
+ throw new IllegalStateException(ex);
+ }
+ return new RemoteServiceReference(serviceData, propertiesData);
}
+ @SuppressWarnings("unchecked")
public OSGiServiceReference[] getServiceReferences(String clazz, String filter)
{
- OSGiServiceReference[] srefs = null;
+ TabularData servicesData;
+ List<OSGiServiceReference> srefs;
+ try
+ {
+ ServiceStateMBeanExt serviceState = getServiceStateMBeanExt();
+ servicesData = serviceState.getServices(clazz, filter);
+ if (servicesData == null)
+ return null;
- ManagedServiceReference[] manrefs = getRemoteFramework().getServiceReferences(clazz, filter);
- if (manrefs != null)
+ srefs = new ArrayList<OSGiServiceReference>();
+ for (CompositeData serviceData : (Collection<CompositeData>)servicesData.values())
+ {
+ Long serviceId = (Long)serviceData.get(ServiceStateMBean.IDENTIFIER);
+ TabularData propertiesData = serviceState.getProperties(serviceId);
+ srefs.add(new RemoteServiceReference(serviceData, propertiesData));
+ }
+ }
+ catch (IOException ex)
{
- srefs = new OSGiServiceReference[manrefs.length];
- for (int i = 0; i < manrefs.length; i++)
- srefs[i] = new RemoteServiceReference(manrefs[i]);
+ throw new IllegalStateException(ex);
}
+ return srefs.toArray(new OSGiServiceReference[servicesData.size()]);
+ }
- return srefs;
+ private ServiceStateMBeanExt getServiceStateMBeanExt()
+ {
+ ObjectName objectName = ObjectNameFactory.create(ServiceStateMBeanExt.OBJECTNAME);
+ return MBeanProxy.get(getMBeanServer(), objectName, ServiceStateMBeanExt.class);
}
public MBeanServerConnection getMBeanServer()
@@ -180,25 +218,6 @@
return new RemotePackageAdmin(this);
}
- private RemoteFramework getRemoteFramework()
- {
- ObjectName objectName = ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
- final ManagedFrameworkMBean managedFramework = MBeanProxy.get(getMBeanServer(), objectName, ManagedFrameworkMBean.class);
-
- return new RemoteFramework()
- {
- public ManagedServiceReference getServiceReference(String clazz)
- {
- return managedFramework.getServiceReference(clazz);
- }
-
- public ManagedServiceReference[] getServiceReferences(String clazz, String filter)
- {
- return managedFramework.getServiceReferences(clazz, filter);
- }
- };
- }
-
public boolean isRemoteRuntime()
{
return true;
Modified: projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteServiceReference.java
===================================================================
--- projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteServiceReference.java 2010-02-23 14:11:34 UTC (rev 101331)
+++ projects/jboss-osgi/projects/testing/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteServiceReference.java 2010-02-23 14:13:09 UTC (rev 101332)
@@ -21,7 +21,9 @@
*/
package org.jboss.osgi.testing.internal;
-import org.jboss.osgi.spi.management.ManagedServiceReference;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.TabularData;
+
import org.jboss.osgi.testing.OSGiServiceReference;
/**
@@ -32,21 +34,22 @@
*/
public class RemoteServiceReference implements OSGiServiceReference
{
- private ManagedServiceReference sref;
+ private CompositeData serviceData;
+ private TabularData propertiesData;
- public RemoteServiceReference(ManagedServiceReference sref)
+ public RemoteServiceReference(CompositeData serviceData, TabularData propertiesData)
{
- this.sref = sref;
+ this.serviceData = serviceData;
+ this.propertiesData = propertiesData;
}
public Object getProperty(String key)
{
- return sref.getProperty(key);
+ return null;
}
public String[] getPropertyKeys()
{
- return sref.getPropertyKeys();
+ return null;
}
-
}
14 years, 3 months
JBoss-OSGI SVN: r101330 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-02-23 09:02:43 -0500 (Tue, 23 Feb 2010)
New Revision: 101330
Removed:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java
Log:
Remove ManagedFramework infavour of FrameworkMBean
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2010-02-23 14:01:24 UTC (rev 101329)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2010-02-23 14:02:43 UTC (rev 101330)
@@ -1,67 +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.spi.management;
-
-
-//$Id$
-
-
-/**
- * The managed view of an OSGi Framework
- *
- * Deprecated: Use FrameworkMBean
- *
- * @author thomas.diesler(a)jboss.com
- * @since 04-Mar-2009
- */
-public interface ManagedFramework
-{
- /**
- * Returns a ServiceReference object for a service that implements and was registered
- * under the specified class.
- */
- ManagedServiceReference getServiceReference(String clazz);
-
- /**
- * Returns an array of ManagedServiceReference objects.
- * The returned array of ManagedServiceReference objects contains services
- * that were registered under the specified class, match the specified filter criteria,
- * and the packages for the class names under which the services were registered.
- */
- ManagedServiceReference[] getServiceReferences(String clazz, String filter);
-
- /**
- * Refresh packages through the PackageAdmin service
- *
- * JMX FrameworkMBean does not allow to resolve/refresh all bundles
- * https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1586
- */
- void refreshAllPackages();
-
- /**
- * Resolve bundles through the PackageAdmin service
- *
- * JMX FrameworkMBean does not allow to resolve/refresh all bundles
- * https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1586
- */
- boolean resolveAllBundles();
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java 2010-02-23 14:01:24 UTC (rev 101329)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java 2010-02-23 14:02:43 UTC (rev 101330)
@@ -1,40 +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.spi.management;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-
-/**
- * The managed view of an OSGi Framework
- *
- * @author thomas.diesler(a)jboss.com
- * @since 04-Mar-2009
- */
-public interface ManagedFrameworkMBean extends ManagedFramework
-{
- /** The default object name: jboss.osgi:service=ManagedFramework */
- ObjectName MBEAN_MANAGED_FRAMEWORK = ObjectNameFactory.create("jboss.osgi:service=ManagedFramework");
-
-}
\ No newline at end of file
14 years, 3 months
JBoss-OSGI SVN: r101329 - in projects/jboss-osgi/projects/bundles/jmx/trunk: jmx-api/src/main/java/org/jboss/osgi/jmx and 12 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-02-23 09:01:24 -0500 (Tue, 23 Feb 2010)
New Revision: 101329
Added:
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/FrameworkMBeanExt.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXConstantsExt.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/ServiceStateMBeanExt.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/antrun-test-jars.xml
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/assembly-bundles.xml
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/FrameworkImpl.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ServiceStateImpl.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateMBeanTestCase.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkMBeanTestCase.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/log4j.xml
Removed:
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/Constants.java
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java
Modified:
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/.classpath
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml
projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/JMXServiceActivator.java
projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml
Log:
Add project test coverage.
Provide FrameworkMBeanExt, ServiceStateMBeanExt
Deleted: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/Constants.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/Constants.java 2010-02-23 13:24:49 UTC (rev 101328)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/Constants.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -1,40 +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$
-
-/**
- * The JMX service contants
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Apr-2009
- */
-public interface Constants
-{
- /** The property that sets the host that the RMIAdaptor binds to: org.jboss.osgi.jmx.host */
- String REMOTE_JMX_HOST = "org.jboss.osgi.jmx.host";
- /** The property that sets the port that the RMIAdaptor binds to: org.jboss.osgi.jmx.port */
- String REMOTE_JMX_RMI_PORT = "org.jboss.osgi.jmx.rmi.port";
- /** The property that sets the JNDI name the RMIAdaptor binds to: org.jboss.osgi.jmx.rmi.adaptor */
- String REMOTE_JMX_RMI_ADAPTOR = "org.jboss.osgi.jmx.rmi.adaptor";
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/FrameworkMBeanExt.java (from rev 101322, projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/FrameworkMBeanExt.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/FrameworkMBeanExt.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,55 @@
+/*
+ * 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;
+
+import org.osgi.jmx.framework.FrameworkMBean;
+
+//$Id$
+
+
+/**
+ * An extension to {@link FrameworkMBean}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public interface FrameworkMBeanExt extends FrameworkMBean
+{
+ /** The default object name: jboss.osgi:service=jmx,type=Framework */
+ String OBJECTNAME = "jboss.osgi:service=jmx,type=Framework";
+
+ /**
+ * Refresh packages through the PackageAdmin service
+ *
+ * JMX FrameworkMBean does not allow to resolve/refresh all bundles
+ * https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1586
+ */
+ void refreshAllPackages();
+
+ /**
+ * Resolve bundles through the PackageAdmin service
+ *
+ * JMX FrameworkMBean does not allow to resolve/refresh all bundles
+ * https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1586
+ */
+ boolean resolveAllBundles();
+}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXConstantsExt.java (from rev 101168, projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/Constants.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXConstantsExt.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/JMXConstantsExt.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,40 @@
+/*
+ * 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$
+
+/**
+ * The JMX service contants
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public interface JMXConstantsExt
+{
+ /** The property that sets the host that the RMIAdaptor binds to: org.jboss.osgi.jmx.host */
+ String REMOTE_JMX_HOST = "org.jboss.osgi.jmx.host";
+ /** The property that sets the port that the RMIAdaptor binds to: org.jboss.osgi.jmx.port */
+ String REMOTE_JMX_RMI_PORT = "org.jboss.osgi.jmx.rmi.port";
+ /** The property that sets the JNDI name the RMIAdaptor binds to: org.jboss.osgi.jmx.rmi.adaptor */
+ String REMOTE_JMX_RMI_ADAPTOR = "org.jboss.osgi.jmx.rmi.adaptor";
+}
\ No newline at end of file
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/ServiceStateMBeanExt.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/ServiceStateMBeanExt.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/ServiceStateMBeanExt.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,58 @@
+/*
+ * 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 java.io.IOException;
+
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.TabularData;
+
+import org.osgi.jmx.framework.ServiceStateMBean;
+
+
+/**
+ * An extension to {@link ServiceStateMBean}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public interface ServiceStateMBeanExt extends ServiceStateMBean
+{
+ /** The default object name: jboss.osgi:service=jmx,type=ServiceState */
+ String OBJECTNAME = "jboss.osgi:service=jmx,type=ServiceState";
+
+ /**
+ * Returns a ServiceReference object for a service that implements and was registered
+ * under the specified class.
+ */
+ CompositeData getService(String clazz) throws IOException;
+
+ /**
+ * Returns an array of ManagedServiceReference objects.
+ * The returned array of ManagedServiceReference objects contains services
+ * that were registered under the specified class, match the specified filter criteria,
+ * and the packages for the class names under which the services were registered.
+ */
+ TabularData getServices(String clazz, String filter) throws IOException;
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-api/src/main/java/org/jboss/osgi/jmx/ServiceStateMBeanExt.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/.classpath 2010-02-23 13:24:49 UTC (rev 101328)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/.classpath 2010-02-23 14:01:24 UTC (rev 101329)
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml 2010-02-23 13:24:49 UTC (rev 101328)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/pom.xml 2010-02-23 14:01:24 UTC (rev 101329)
@@ -48,6 +48,38 @@
<artifactId>org.apache.aries.jmx.api</artifactId>
</dependency>
+ <!-- Provided Dependencies -->
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.jndi</groupId>
+ <artifactId>jboss-osgi-jndi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.jmx</groupId>
+ <artifactId>org.apache.aries.jmx</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.log</artifactId>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
<!-- OSGi Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
@@ -59,6 +91,23 @@
<artifactId>org.osgi.compendium</artifactId>
<scope>provided</scope>
</dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -91,6 +140,7 @@
<!-- osgi -->
org.osgi.framework;version="[1.5,2.0)",
+ org.osgi.jmx.framework;version="[1.0,2.0)",
org.osgi.service.packageadmin;version="[1.2,2.0)",
org.osgi.util.tracker;version="[1.4,2.0)",
@@ -114,29 +164,101 @@
</configuration>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
+ <artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
+ <id>bundles</id>
+ <phase>test-compile</phase>
<goals>
- <goal>attach-artifact</goal>
+ <goal>directory-single</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>
+ <finalName>test-libs</finalName>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-bundles.xml</descriptor>
+ </descriptors>
</configuration>
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>build-test-jars</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
+ <property name="artifactId" value="${artifactId}" />
+ <property name="tests.output.dir" value="${project.build.directory}" />
+ <property name="build.artifact" value="${project.build.finalName}" />
+ <ant antfile="scripts/antrun-test-jars.xml" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <argLine>${surefire.jpda.args}</argLine>
+ <systemProperties>
+ <property>
+ <name>java.protocol.handler.pkgs</name>
+ <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
+ </property>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ <property>
+ <name>test.archive.directory</name>
+ <value>${project.build.directory}/test-libs</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
+ <!-- Profiles -->
+ <profiles>
+
+ <!--
+ Name: jpda
+ Descr: Enable JPDA remote debuging
+ -->
+ <profile>
+ <id>jpda</id>
+ <activation>
+ <property>
+ <name>jpda</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jpda.args>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</surefire.jpda.args>
+ </properties>
+ </profile>
+
+ </profiles>
+
</project>
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/antrun-test-jars.xml (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/antrun-test-jars.xml 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,52 @@
+<?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 default="build-test-jars">
+
+ <description>OSGi test archive builder</description>
+
+ <!-- ================================================================== -->
+ <!-- Init -->
+ <!-- ================================================================== -->
+
+ <target name="init">
+
+ <!-- Property override when not called from maven -->
+ <property name="maven.runtime.classpath" value="/usr/java/bnd.jar" />
+ <property name="tests.output.dir" value="${basedir}/../target" />
+
+ <mkdir dir="${tests.output.dir}/test-libs" />
+ <property name="tests.classes.dir" value="${tests.output.dir}/test-classes" />
+ <property name="tests.resources.dir" value="${tests.output.dir}/test-classes" />
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties">
+ <classpath>
+ <pathelement path="${maven.runtime.classpath}" />
+ </classpath>
+ </taskdef>
+
+ <!-- Copy build artifact to test-libs/bundles -->
+ <copy file="${tests.output.dir}/${build.artifact}.jar" tofile="${tests.output.dir}/test-libs/bundles/${artifactId}.jar" overwrite="true"/>
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Building -->
+ <!-- ================================================================== -->
+
+ <target name="build-test-jars" depends="init" description="Build the test deployments">
+
+ <!-- Please add alphabetically -->
+
+ <!-- Please add alphabetically -->
+
+ </target>
+
+</project>
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/antrun-test-jars.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/assembly-bundles.xml (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/assembly-bundles.xml 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,40 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+
+ <id>deploy-artifacts</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <!-- Dependency Sets -->
+ <dependencySets>
+
+ <!-- bundle -->
+ <dependencySet>
+ <outputDirectory>bundles</outputDirectory>
+ <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <includes>
+ <include>*:jboss-osgi-common-core:jar</include>
+ </includes>
+ <useStrictFiltering>true</useStrictFiltering>
+ <scope>compile</scope>
+ <unpack>false</unpack>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>bundles</outputDirectory>
+ <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <includes>
+ <include>*:jboss-osgi-common:jar</include>
+ <include>*:jboss-osgi-jndi:jar</include>
+ <include>*:org.apache.aries.jmx:jar</include>
+ <include>*:org.apache.felix.log:jar</include>
+ <include>*:org.osgi.compendium:jar</include>
+ </includes>
+ <useStrictFiltering>true</useStrictFiltering>
+ <scope>provided</scope>
+ <unpack>false</unpack>
+ </dependencySet>
+
+ </dependencySets>
+</assembly>
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/scripts/assembly-bundles.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/FrameworkImpl.java (from rev 101160, 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/FrameworkImpl.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/FrameworkImpl.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,266 @@
+/*
+ * 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.io.IOException;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.management.StandardMBean;
+import javax.management.openmbean.CompositeData;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.jmx.FrameworkMBeanExt;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.jmx.framework.FrameworkMBean;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * An extension to {@link FrameworkMBean}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Feb-2009
+ */
+public class FrameworkImpl implements FrameworkMBeanExt
+{
+ // Provide logging
+ private static final Logger log = Logger.getLogger(FrameworkImpl.class);
+
+ private MBeanServer mbeanServer;
+ private BundleContext context;
+ private FrameworkMBean delegate;
+
+ public FrameworkImpl(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;
+ }
+
+ @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()
+ {
+ try
+ {
+ ObjectName objectName = ObjectNameFactory.create(FrameworkMBeanExt.OBJECTNAME);
+ StandardMBean mbean = new StandardMBean(this, FrameworkMBeanExt.class);
+ mbeanServer.registerMBean(mbean, objectName);
+ }
+ catch (JMException ex)
+ {
+ log.warn("Cannot register: " + FrameworkMBeanExt.OBJECTNAME);
+ }
+ }
+
+ void stop()
+ {
+ try
+ {
+ ObjectName objectName = ObjectNameFactory.create(FrameworkMBeanExt.OBJECTNAME);
+ if (mbeanServer.isRegistered(objectName))
+ mbeanServer.unregisterMBean(objectName);
+ }
+ catch (JMException ex)
+ {
+ log.warn("Cannot register: " + FrameworkMBeanExt.OBJECTNAME);
+ }
+ }
+
+ public int getFrameworkStartLevel() throws IOException
+ {
+ return getFrameworkMBean().getFrameworkStartLevel();
+ }
+
+ public int getInitialBundleStartLevel() throws IOException
+ {
+ return getFrameworkMBean().getInitialBundleStartLevel();
+ }
+
+ public long installBundle(String arg0, String arg1) throws IOException
+ {
+ return getFrameworkMBean().installBundle(arg0, arg1);
+ }
+
+ public long installBundle(String arg0) throws IOException
+ {
+ return getFrameworkMBean().installBundle(arg0);
+ }
+
+ public CompositeData installBundles(String[] arg0, String[] arg1) throws IOException
+ {
+ return getFrameworkMBean().installBundles(arg0, arg1);
+ }
+
+ public CompositeData installBundles(String[] arg0) throws IOException
+ {
+ return getFrameworkMBean().installBundles(arg0);
+ }
+
+ public void refreshPackages(long arg0) throws IOException
+ {
+ getFrameworkMBean().refreshPackages(arg0);
+ }
+
+ public CompositeData refreshPackages(long[] arg0) throws IOException
+ {
+ return getFrameworkMBean().refreshPackages(arg0);
+ }
+
+ public boolean resolveBundle(long arg0) throws IOException
+ {
+ return getFrameworkMBean().resolveBundle(arg0);
+ }
+
+ public boolean resolveBundles(long[] arg0) throws IOException
+ {
+ return getFrameworkMBean().resolveBundles(arg0);
+ }
+
+ public void restartFramework() throws IOException
+ {
+ getFrameworkMBean().restartFramework();
+ }
+
+ public void setBundleStartLevel(long arg0, int arg1) throws IOException
+ {
+ getFrameworkMBean().setBundleStartLevel(arg0, arg1);
+ }
+
+ public CompositeData setBundleStartLevels(long[] arg0, int[] arg1) throws IOException
+ {
+ return getFrameworkMBean().setBundleStartLevels(arg0, arg1);
+ }
+
+ public void setFrameworkStartLevel(int arg0) throws IOException
+ {
+ getFrameworkMBean().setFrameworkStartLevel(arg0);
+ }
+
+ public void setInitialBundleStartLevel(int arg0) throws IOException
+ {
+ getFrameworkMBean().setInitialBundleStartLevel(arg0);
+ }
+
+ public void shutdownFramework() throws IOException
+ {
+ getFrameworkMBean().shutdownFramework();
+ }
+
+ public void startBundle(long arg0) throws IOException
+ {
+ getFrameworkMBean().startBundle(arg0);
+ }
+
+ public CompositeData startBundles(long[] arg0) throws IOException
+ {
+ return getFrameworkMBean().startBundles(arg0);
+ }
+
+ public void stopBundle(long arg0) throws IOException
+ {
+ getFrameworkMBean().stopBundle(arg0);
+ }
+
+ public CompositeData stopBundles(long[] arg0) throws IOException
+ {
+ return getFrameworkMBean().stopBundles(arg0);
+ }
+
+ public void uninstallBundle(long arg0) throws IOException
+ {
+ getFrameworkMBean().uninstallBundle(arg0);
+ }
+
+ public CompositeData uninstallBundles(long[] arg0) throws IOException
+ {
+ return getFrameworkMBean().uninstallBundles(arg0);
+ }
+
+ public void updateBundle(long arg0, String arg1) throws IOException
+ {
+ getFrameworkMBean().updateBundle(arg0, arg1);
+ }
+
+ public void updateBundle(long arg0) throws IOException
+ {
+ getFrameworkMBean().updateBundle(arg0);
+ }
+
+ public CompositeData updateBundles(long[] arg0, String[] arg1) throws IOException
+ {
+ return getFrameworkMBean().updateBundles(arg0, arg1);
+ }
+
+ public CompositeData updateBundles(long[] arg0) throws IOException
+ {
+ return getFrameworkMBean().updateBundles(arg0);
+ }
+
+ public void updateFramework() throws IOException
+ {
+ getFrameworkMBean().updateFramework();
+ }
+
+ private FrameworkMBean getFrameworkMBean()
+ {
+ if (delegate == null)
+ {
+ ObjectName objectName = ObjectNameFactory.create(FrameworkMBean.OBJECTNAME);
+ delegate = MBeanProxy.get(mbeanServer, objectName, FrameworkMBean.class);
+ }
+ return delegate;
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/JMXServiceActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/JMXServiceActivator.java 2010-02-23 13:24:49 UTC (rev 101328)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/JMXServiceActivator.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -23,10 +23,6 @@
//$Id$
-import static org.jboss.osgi.jmx.Constants.REMOTE_JMX_HOST;
-import static org.jboss.osgi.jmx.Constants.REMOTE_JMX_RMI_ADAPTOR;
-import static org.jboss.osgi.jmx.Constants.REMOTE_JMX_RMI_PORT;
-
import java.io.IOException;
import javax.management.MBeanServer;
@@ -38,7 +34,7 @@
import javax.naming.StringRefAddr;
import org.jboss.logging.Logger;
-import org.jboss.osgi.spi.management.ManagedFramework;
+import org.jboss.osgi.jmx.JMXConstantsExt;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -60,7 +56,9 @@
private String jmxRmiPort;
private String rmiAdaptorPath;
private MBeanServer mbeanServer;
- private ManagedFrameworkImpl managedFramework;
+ private FrameworkImpl framework;
+ private ServiceStateImpl serviceState;
+ private ManagedBundleTracker bundleTracker;
public void start(BundleContext context)
{
@@ -71,20 +69,27 @@
// Get the system BundleContext
BundleContext sysContext = context.getBundle(0).getBundleContext();
- // Register the ManagedFramework
- managedFramework = new ManagedFrameworkImpl(sysContext, mbeanServer);
- context.registerService(ManagedFramework.class.getName(), managedFramework, null);
- managedFramework.start();
+ // Register the FrameworkMBean
+ framework = new FrameworkImpl(sysContext, mbeanServer);
+ framework.start();
- jmxHost = context.getProperty(REMOTE_JMX_HOST);
+ // Register the ServiceStateMBean
+ serviceState = new ServiceStateImpl(sysContext, mbeanServer);
+ serviceState.start();
+
+ // Start tracking the bundles
+ bundleTracker = new ManagedBundleTracker(sysContext, mbeanServer);
+ bundleTracker.open();
+
+ jmxHost = context.getProperty(JMXConstantsExt.REMOTE_JMX_HOST);
if (jmxHost == null)
jmxHost = "localhost";
- jmxRmiPort = context.getProperty(REMOTE_JMX_RMI_PORT);
+ jmxRmiPort = context.getProperty(JMXConstantsExt.REMOTE_JMX_RMI_PORT);
if (jmxRmiPort == null)
jmxRmiPort = "1098";
- rmiAdaptorPath = context.getProperty(REMOTE_JMX_RMI_ADAPTOR);
+ rmiAdaptorPath = context.getProperty(JMXConstantsExt.REMOTE_JMX_RMI_ADAPTOR);
if (rmiAdaptorPath == null)
rmiAdaptorPath = "jmx/invoker/RMIAdaptor";
@@ -95,9 +100,15 @@
public void stop(BundleContext context)
{
- // Unregister the managed framework
- managedFramework.stop();
+ // Unregister the FrameworkMBean
+ framework.stop();
+ // Unregister the ServiceStateMBean
+ serviceState.stop();
+
+ // Stop tracking the bundles
+ bundleTracker.close();
+
if (jmxConnector != null)
{
jmxConnector.stop();
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/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java 2010-02-23 13:24:49 UTC (rev 101328)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -1,183 +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 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(a)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
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ServiceStateImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ServiceStateImpl.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ServiceStateImpl.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,210 @@
+/*
+ * 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.io.IOException;
+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.ObjectName;
+import javax.management.StandardMBean;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.CompositeDataSupport;
+import javax.management.openmbean.OpenDataException;
+import javax.management.openmbean.TabularData;
+import javax.management.openmbean.TabularDataSupport;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.jmx.FrameworkMBeanExt;
+import org.jboss.osgi.jmx.ServiceStateMBeanExt;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.jmx.framework.ServiceStateMBean;
+
+/**
+ * An extension to {@link ServiceStateMBean}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Feb-2010
+ */
+public class ServiceStateImpl implements ServiceStateMBeanExt
+{
+ // Provide logging
+ private static final Logger log = Logger.getLogger(ServiceStateImpl.class);
+
+ private MBeanServer mbeanServer;
+ private BundleContext context;
+ private ServiceStateMBean delegate;
+
+ public ServiceStateImpl(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;
+ }
+
+ @Override
+ public CompositeData getService(String clazz) throws IOException
+ {
+ ServiceReference sref = context.getServiceReference(clazz);
+ if (sref == null)
+ return null;
+
+ return getCompositeData(sref);
+ }
+
+ @Override
+ public TabularData getServices(String clazz, String filter) throws IOException
+ {
+ ServiceReference[] srefs;
+ try
+ {
+ srefs = context.getServiceReferences(clazz, filter);
+ }
+ catch (InvalidSyntaxException e)
+ {
+ throw new IllegalArgumentException("Invalid filter syntax: " + filter);
+ }
+
+ if (srefs == null)
+ return null;
+
+ TabularDataSupport tabularData = new TabularDataSupport(SERVICES_TYPE);
+ for (ServiceReference sref : srefs)
+ {
+ CompositeDataSupport compData = getCompositeData(sref);
+ tabularData.put(compData.get(IDENTIFIER), compData);
+ }
+
+ return tabularData;
+ }
+
+ private CompositeDataSupport getCompositeData(ServiceReference sref) throws IOException
+ {
+ Long serviceId = (Long)sref.getProperty(Constants.SERVICE_ID);
+
+ List<Long> usingBundles = new ArrayList<Long>();
+ for (Bundle aux : sref.getUsingBundles())
+ usingBundles.add(aux.getBundleId());
+
+ Map<String, Object> items = new HashMap<String, Object>();
+ items.put(BUNDLE_IDENTIFIER, sref.getBundle().getBundleId());
+ items.put(IDENTIFIER, serviceId);
+ items.put(OBJECT_CLASS, sref.getProperty(Constants.OBJECTCLASS));
+ items.put(USING_BUNDLES, usingBundles.toArray(new Long[usingBundles.size()]));
+
+ // [TODO] Remove once ServiceType does not require this item any more
+ items.put(PROPERTIES, getProperties(serviceId));
+
+ CompositeDataSupport compData;
+ try
+ {
+ compData = new CompositeDataSupport(SERVICE_TYPE, items);
+ }
+ catch (OpenDataException ex)
+ {
+ throw new IllegalStateException(ex);
+ }
+ return compData;
+ }
+
+ void start()
+ {
+ try
+ {
+ ObjectName objectName = ObjectNameFactory.create(ServiceStateMBeanExt.OBJECTNAME);
+ StandardMBean mbean = new StandardMBean(this, ServiceStateMBeanExt.class);
+ mbeanServer.registerMBean(mbean, objectName);
+ }
+ catch (JMException ex)
+ {
+ log.warn("Cannot register: " + FrameworkMBeanExt.OBJECTNAME);
+ }
+ }
+
+ void stop()
+ {
+ try
+ {
+ ObjectName objectName = ObjectNameFactory.create(ServiceStateMBeanExt.OBJECTNAME);
+ if (mbeanServer.isRegistered(objectName))
+ mbeanServer.unregisterMBean(objectName);
+ }
+ catch (JMException ex)
+ {
+ log.warn("Cannot register: " + FrameworkMBeanExt.OBJECTNAME);
+ }
+ }
+
+ public long getBundleIdentifier(long arg0) throws IOException
+ {
+ return getServiceStateMBean().getBundleIdentifier(arg0);
+ }
+
+ public String[] getObjectClass(long arg0) throws IOException
+ {
+ return getServiceStateMBean().getObjectClass(arg0);
+ }
+
+ public TabularData getProperties(long arg0) throws IOException
+ {
+ return getServiceStateMBean().getProperties(arg0);
+ }
+
+ public long[] getUsingBundles(long arg0) throws IOException
+ {
+ return getServiceStateMBean().getUsingBundles(arg0);
+ }
+
+ public TabularData listServices() throws IOException
+ {
+ return getServiceStateMBean().listServices();
+ }
+
+ private ServiceStateMBean getServiceStateMBean()
+ {
+ if (delegate == null)
+ {
+ ObjectName objectName = ObjectNameFactory.create(ServiceStateMBean.OBJECTNAME);
+ delegate = MBeanProxy.get(mbeanServer, objectName, ServiceStateMBean.class);
+ }
+ return delegate;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/main/java/org/jboss/osgi/jmx/internal/ServiceStateImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,106 @@
+/*
+ * 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.test.osgi.jmx;
+
+//$Id$
+
+import java.util.ArrayList;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+
+import org.jboss.osgi.jmx.FrameworkMBeanExt;
+import org.jboss.osgi.jmx.ServiceStateMBeanExt;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.osgi.framework.launch.Framework;
+import org.osgi.jmx.framework.BundleStateMBean;
+
+/**
+ * An abstract JMX test case.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Feb-2010
+ */
+public abstract class AbstractJMXTestCase
+{
+ private static Framework framework;
+ private MBeanServer server;
+
+ @BeforeClass
+ public static void setUpClass() throws Exception
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ framework = bootProvider.getFramework();
+ framework.start();
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception
+ {
+ if (framework != null)
+ {
+ framework.stop();
+ framework.waitForStop(3000);
+ }
+ }
+
+ public FrameworkMBeanExt getFramework() throws Exception
+ {
+ ObjectName oname = ObjectNameFactory.create(FrameworkMBeanExt.OBJECTNAME);
+ return MBeanProxy.get(getMBeanServer(), oname, FrameworkMBeanExt.class);
+ }
+
+ public BundleStateMBean getBundleState() throws Exception
+ {
+ ObjectName oname = ObjectNameFactory.create(BundleStateMBean.OBJECTNAME);
+ return MBeanProxy.get(getMBeanServer(), oname, BundleStateMBean.class);
+ }
+
+ public ServiceStateMBeanExt getServiceState() throws Exception
+ {
+ ObjectName oname = ObjectNameFactory.create(ServiceStateMBeanExt.OBJECTNAME);
+ return MBeanProxy.get(getMBeanServer(), oname, ServiceStateMBeanExt.class);
+ }
+
+ protected MBeanServer getMBeanServer()
+ {
+ if (server == null)
+ {
+ ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
+ if (serverArr.size() > 1)
+ throw new IllegalStateException("Multiple MBeanServer instances not supported");
+
+ if (serverArr.size() == 1)
+ server = serverArr.get(0);
+
+ if (server == null)
+ server = MBeanServerFactory.createMBeanServer();
+ }
+ return server;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/AbstractJMXTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateMBeanTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateMBeanTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateMBeanTestCase.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,58 @@
+/*
+ * 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.test.osgi.jmx;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import javax.management.ObjectName;
+import javax.management.openmbean.TabularData;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.junit.Test;
+import org.osgi.jmx.framework.BundleStateMBean;
+
+/**
+ * A test that excercises the BundleStateMBean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Feb-2010
+ */
+public class BundleStateMBeanTestCase extends AbstractJMXTestCase
+{
+ @Test
+ public void testMBeanAccess() throws Exception
+ {
+ ObjectName oname = ObjectNameFactory.create(BundleStateMBean.OBJECTNAME);
+ assertTrue("Registerd " + oname, getMBeanServer().isRegistered(oname));
+ }
+
+ @Test
+ public void listBundles() throws Exception
+ {
+ BundleStateMBean bundleState = getBundleState();
+ TabularData data = bundleState.listBundles();
+ assertEquals("Number of bundles", 8, data.size());
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/BundleStateMBeanTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkMBeanTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkMBeanTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkMBeanTestCase.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,52 @@
+/*
+ * 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.test.osgi.jmx;
+
+//$Id$
+
+import static org.junit.Assert.assertTrue;
+
+import javax.management.ObjectName;
+
+import org.jboss.osgi.jmx.FrameworkMBeanExt;
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.junit.Test;
+import org.osgi.jmx.framework.FrameworkMBean;
+
+/**
+ * A test that excercises the FramworkMBean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Feb-2010
+ */
+public class FrameworkMBeanTestCase extends AbstractJMXTestCase
+{
+ @Test
+ public void testMBeanAccess() throws Exception
+ {
+ ObjectName oname = ObjectNameFactory.create(FrameworkMBean.OBJECTNAME);
+ assertTrue("Registerd " + oname, getMBeanServer().isRegistered(oname));
+
+ oname = ObjectNameFactory.create(FrameworkMBeanExt.OBJECTNAME);
+ assertTrue("Registerd " + oname, getMBeanServer().isRegistered(oname));
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/FrameworkMBeanTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,67 @@
+/*
+ * 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.test.osgi.jmx;
+
+//$Id$
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import javax.management.MBeanServer;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.TabularData;
+
+import org.jboss.osgi.jmx.ServiceStateMBeanExt;
+import org.junit.Test;
+
+/**
+ * A test that excercises the ServiceStateMBean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Feb-2010
+ */
+public class ServiceStateMBeanTestCase extends AbstractJMXTestCase
+{
+ @Test
+ public void listBundles() throws Exception
+ {
+ ServiceStateMBeanExt serviceState = getServiceState();
+ TabularData data = serviceState.listServices();
+ assertEquals("Number of services", 7, data.size());
+ }
+
+ @Test
+ public void getService() throws Exception
+ {
+ ServiceStateMBeanExt serviceState = getServiceState();
+ CompositeData data = serviceState.getService(MBeanServer.class.getName());
+ assertNotNull("MBeanServer service not null", data);
+ }
+
+ @Test
+ public void getServices() throws Exception
+ {
+ ServiceStateMBeanExt serviceState = getServiceState();
+ TabularData data = serviceState.getServices(MBeanServer.class.getName(), null);
+ assertEquals("MBeanServer service not null", 1, data.size());
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/java/org/jboss/test/osgi/jmx/ServiceStateMBeanTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/jboss-osgi-framework.properties (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/jboss-osgi-framework.properties 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,38 @@
+#
+# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
+#
+# $Id$
+#
+
+# Properties to configure the Framework
+org.osgi.framework.storage=${test.archive.directory}/../osgi-store
+org.osgi.framework.storage.clean=onFirstInit
+
+# Extra System Packages
+org.osgi.framework.system.packages.extra=\
+ org.apache.log4j;version=1.2, \
+ org.jboss.logging;version=2.1, \
+ org.jboss.osgi.deployment.deployer;version=1.0, \
+ org.jboss.osgi.deployment.interceptor;version=1.0, \
+ org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.capability;version=1.0, \
+ org.jboss.osgi.spi.framework;version=1.0, \
+ org.jboss.osgi.spi.management;version=1.0, \
+ org.jboss.osgi.spi.service;version=1.0, \
+ org.jboss.osgi.spi.util;version=1.0, \
+ org.jboss.osgi.testing;version=1.0, \
+ org.jboss.virtual;version=2.1, \
+ org.osgi.framework;version=1.5
+
+# Bundles that need to be installed with the Framework automatically
+org.jboss.osgi.spi.framework.autoInstall=\
+ file://${test.archive.directory}/bundles/org.osgi.compendium.jar
+
+# Bundles that need to be started automatically
+org.jboss.osgi.spi.framework.autoStart=\
+ file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
+ file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
+ file://${test.archive.directory}/bundles/jboss-osgi-common-core.jar \
+ file://${test.archive.directory}/bundles/jboss-osgi-jndi.jar \
+ file://${test.archive.directory}/bundles/org.apache.aries.jmx.jar \
+ file://${test.archive.directory}/bundles/jboss-osgi-jmx.jar
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/jboss-osgi-framework.properties
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/log4j.xml (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/log4j.xml 2010-02-23 14:01:24 UTC (rev 101329)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <param name="File" value="${log4j.output.dir}/test.log"/>
+ <param name="Append" value="false"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="INFO" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Show jboss deployer traces
+ <category name="org.jboss.deployers">
+ <priority value="TRACE" />
+ </category>
+ -->
+
+ <!-- Show jboss deployer traces
+ <category name="org.jboss.xb">
+ <priority value="TRACE" />
+ </category>
+ -->
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--appender-ref ref="CONSOLE"/-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/jmx-bundle/src/test/resources/log4j.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml 2010-02-23 13:24:49 UTC (rev 101328)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml 2010-02-23 14:01:24 UTC (rev 101329)
@@ -40,8 +40,11 @@
<!-- Properties -->
<properties>
<version.apache.aries.jmx>1.0.0-incubating-SNAPSHOT</version.apache.aries.jmx>
+ <version.apache.felix.log>1.0.0</version.apache.felix.log>
+ <version.jboss.osgi.common>1.0.4-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
<version.jboss.osgi.jndi>1.0.3-SNAPSHOT</version.jboss.osgi.jndi>
+ <version.jboss.osgi.runtime.felix>2.0.2.SP1-SNAPSHOT</version.jboss.osgi.runtime.felix>
<version.jboss.osgi.spi>1.0.5-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -61,19 +64,44 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version.jboss.osgi.common}</version>
+ </dependency>
+ <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.jndi</groupId>
+ <artifactId>jboss-osgi-jndi</artifactId>
+ <version>${version.jboss.osgi.jndi}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.jndi</groupId>
<artifactId>jboss-osgi-jndi-api</artifactId>
<version>${version.jboss.osgi.jndi}</version>
</dependency>
<dependency>
<groupId>org.apache.aries.jmx</groupId>
+ <artifactId>org.apache.aries.jmx</artifactId>
+ <version>${version.apache.aries.jmx}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.jmx</groupId>
<artifactId>org.apache.aries.jmx.api</artifactId>
<version>${version.apache.aries.jmx}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.log</artifactId>
+ <version>${version.apache.felix.log}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version.jboss.osgi.runtime.felix}</version>
+ </dependency>
<!-- OSGi Dependencies -->
<dependency>
14 years, 3 months
JBoss-OSGI SVN: r101324 - projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2010-02-23 04:19:35 -0500 (Tue, 23 Feb 2010)
New Revision: 101324
Modified:
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/HttpServiceCapability.java
Log:
[JBOSGI-294] WebApp Extender fails on embedded Equinox
Remove dependency on ConfigAdmin from HttpService
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/HttpServiceCapability.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/HttpServiceCapability.java 2010-02-23 09:16:19 UTC (rev 101323)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/HttpServiceCapability.java 2010-02-23 09:19:35 UTC (rev 101324)
@@ -31,7 +31,6 @@
*
* It is ignored if the {@link HttpService} is already registered.
*
- * Dependent Capability: {@link ConfigAdminCapability}
* Installed bundles: pax-web-jetty-bundle.jar
*
* Default properties set by this capability
@@ -51,8 +50,6 @@
super(HttpService.class.getName());
addSystemProperty("org.osgi.service.http.port", "8090");
- addDependency(new ConfigAdminCapability());
-
addBundle("bundles/pax-web-jetty-bundle.jar");
}
}
\ No newline at end of file
14 years, 3 months