[jboss-osgi-commits] JBoss-OSGI SVN: r101072 - in projects/jboss-osgi/projects: bundles/apache-xerces/trunk/.settings and 35 other directories.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Wed Feb 17 08:55:18 EST 2010
Author: thomas.diesler at jboss.com
Date: 2010-02-17 08:55:15 -0500 (Wed, 17 Feb 2010)
New Revision: 101072
Added:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/MainDeployerClient.java
projects/jboss-osgi/projects/bundles/jmx/trunk/EEG-Feedback-JMX.txt
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxy.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MicrocontainerServiceMBean.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ObjectNameFactory.java
Removed:
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/DeployerServiceClient.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxy.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxyException.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MicrocontainerServiceMBean.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ObjectNameFactory.java
Modified:
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/.classpath
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/internal/XMLParserActivator.java
projects/jboss-osgi/projects/bundles/blueprint/trunk/.classpath
projects/jboss-osgi/projects/bundles/blueprint/trunk/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/bundles/blueprint/trunk/src/main/java/org/jboss/osgi/blueprint/internal/BlueprintEventDispatcher.java
projects/jboss-osgi/projects/bundles/common/trunk/.classpath
projects/jboss-osgi/projects/bundles/common/trunk/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingCapability.java
projects/jboss-osgi/projects/bundles/husky/trunk/.classpath
projects/jboss-osgi/projects/bundles/husky/trunk/.settings/org.eclipse.jdt.core.prefs
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/main/java/org/jboss/osgi/husky/HuskyCapability.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/internal/AbstractInvoker.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntime.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedBundle.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiBundleImpl.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteFramework.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/projects/bundles/jmx/trunk/.classpath
projects/jboss-osgi/projects/bundles/jmx/trunk/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java
projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java
projects/jboss-osgi/projects/bundles/jndi/trunk/.classpath
projects/jboss-osgi/projects/bundles/jndi/trunk/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/bundles/jndi/trunk/pom.xml
projects/jboss-osgi/projects/runtime/deployment/trunk/.classpath
projects/jboss-osgi/projects/runtime/deployment/trunk/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/runtime/deployment/trunk/src/test/java/org/jboss/test/osgi/deployment/simple/DeploymentSerializationTestCase.java
projects/jboss-osgi/projects/runtime/felix/trunk/.classpath
projects/jboss-osgi/projects/runtime/felix/trunk/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/spi/trunk/.classpath
projects/jboss-osgi/projects/spi/trunk/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/Capability.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/ConfigAdminCapability.java
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/LogServiceCapability.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/internal/OSGiBootstrapBean.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java
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
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
Log:
[JBOSGI-126] Replace the SPI JMX functionality by RFC-139 API
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/.classpath 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/.classpath 2010-02-17 13:55:15 UTC (rev 101072)
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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"/>
</classpath>
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,5 +1,12 @@
-#Mon May 25 10:37:04 CEST 2009
+#Wed Feb 17 12:13:47 CET 2010
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/internal/XMLParserActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/internal/XMLParserActivator.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/internal/XMLParserActivator.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -85,47 +85,47 @@
* be added by extending this class and overriding the
* <code>setSAXProperties</code> and <code>setDOMProperties</code> methods.
*/
-public class XMLParserActivator implements BundleActivator, ServiceFactory {
+ at SuppressWarnings({ "rawtypes", "unchecked" })
+public class XMLParserActivator implements BundleActivator, ServiceFactory
+{
/** Context of this bundle */
- private BundleContext context;
+ private BundleContext context;
/**
* Filename containing the SAX Parser Factory Class name. Also used as the
* basis for the <code>SERVICE_PID<code> registration property.
*/
- public static final String SAXFACTORYNAME = "javax.xml.parsers.SAXParserFactory";
+ public static final String SAXFACTORYNAME = "javax.xml.parsers.SAXParserFactory";
/**
* Filename containing the DOM Parser Factory Class name. Also used as the
* basis for the <code>SERVICE_PID</code> registration property.
*/
- public static final String DOMFACTORYNAME = "javax.xml.parsers.DocumentBuilderFactory";
+ public static final String DOMFACTORYNAME = "javax.xml.parsers.DocumentBuilderFactory";
/** Path to the factory class name files */
- private static final String PARSERCLASSFILEPATH = "/META-INF/services/";
+ private static final String PARSERCLASSFILEPATH = "/META-INF/services/";
/** Fully qualified path name of SAX Parser Factory Class Name file */
- public static final String SAXCLASSFILE = PARSERCLASSFILEPATH
- + SAXFACTORYNAME;
+ public static final String SAXCLASSFILE = PARSERCLASSFILEPATH + SAXFACTORYNAME;
/** Fully qualified path name of DOM Parser Factory Class Name file */
- public static final String DOMCLASSFILE = PARSERCLASSFILEPATH
- + DOMFACTORYNAME;
+ public static final String DOMCLASSFILE = PARSERCLASSFILEPATH + DOMFACTORYNAME;
/** SAX Factory Service Description */
- private static final String SAXFACTORYDESCRIPTION = "A JAXP Compliant SAX Parser";
+ private static final String SAXFACTORYDESCRIPTION = "A JAXP Compliant SAX Parser";
/** DOM Factory Service Description */
- private static final String DOMFACTORYDESCRIPTION = "A JAXP Compliant DOM Parser";
+ private static final String DOMFACTORYDESCRIPTION = "A JAXP Compliant DOM Parser";
/**
* Service property specifying if factory is configured to support
* validating parsers. The value is of type <code>Boolean</code>.
*/
- public static final String PARSER_VALIDATING = "parser.validating";
+ public static final String PARSER_VALIDATING = "parser.validating";
/**
* Service property specifying if factory is configured to support namespace
* aware parsers. The value is of type <code>Boolean</code>.
*/
- public static final String PARSER_NAMESPACEAWARE = "parser.namespaceAware";
+ public static final String PARSER_NAMESPACEAWARE = "parser.namespaceAware";
/**
* Key for parser factory name property - this must be saved in the parsers
* properties hashtable so that the parser factory can be instantiated from
* a ServiceReference
*/
- private static final String FACTORYNAMEKEY = "parser.factoryname";
+ private static final String FACTORYNAMEKEY = "parser.factoryname";
/**
* Called when this bundle is started so the Framework can perform the
@@ -146,18 +146,19 @@
* bundle's listeners, unregister all services registered by this
* bundle, and release all services used by this bundle.
*/
- public void start(BundleContext context) throws Exception {
+ public void start(BundleContext context) throws Exception
+ {
this.context = context;
Bundle parserBundle = context.getBundle();
- try {
+ try
+ {
// check for sax parsers
- registerSAXParsers(getParserFactoryClassNames(parserBundle
- .getResource(SAXCLASSFILE)));
+ registerSAXParsers(getParserFactoryClassNames(parserBundle.getResource(SAXCLASSFILE)));
// check for dom parsers
- registerDOMParsers(getParserFactoryClassNames(parserBundle
- .getResource(DOMCLASSFILE)));
+ registerDOMParsers(getParserFactoryClassNames(parserBundle.getResource(DOMCLASSFILE)));
}
- catch (IOException ioe) {
+ catch (IOException ioe)
+ {
// if there were any IO errors accessing the resource files
// containing the class names
ioe.printStackTrace();
@@ -175,7 +176,8 @@
* the bundle's listeners, unregister all services registered by the
* bundle, and release all services used by the bundle.
*/
- public void stop(BundleContext context) throws Exception {
+ public void stop(BundleContext context) throws Exception
+ {
}
/**
@@ -189,36 +191,44 @@
* parserUrl is null
* @throws IOException if there is a problem reading the URL input stream
*/
- private Vector getParserFactoryClassNames(URL parserUrl) throws IOException {
+ private Vector getParserFactoryClassNames(URL parserUrl) throws IOException
+ {
Vector v = new Vector(1);
- if (parserUrl != null) {
+ if (parserUrl != null)
+ {
String parserFactoryClassName = null;
InputStream is = parserUrl.openStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
- while (true) {
+ while (true)
+ {
parserFactoryClassName = br.readLine();
- if (parserFactoryClassName == null) {
+ if (parserFactoryClassName == null)
+ {
break; // end of file reached
}
String pfcName = parserFactoryClassName.trim();
- if (pfcName.length() == 0) {
+ if (pfcName.length() == 0)
+ {
continue; // blank line
}
int commentIdx = pfcName.indexOf("#");
- if (commentIdx == 0) { // comment line
+ if (commentIdx == 0)
+ { // comment line
continue;
}
+ else if (commentIdx < 0)
+ { // no comment on this line
+ v.addElement(pfcName);
+ }
else
- if (commentIdx < 0) { // no comment on this line
- v.addElement(pfcName);
- }
- else {
- v.addElement(pfcName.substring(0, commentIdx).trim());
- }
+ {
+ v.addElement(pfcName.substring(0, commentIdx).trim());
+ }
}
return v;
}
- else {
+ else
+ {
return null;
}
}
@@ -231,18 +241,20 @@
* Factory Classes
* @throws FactoryConfigurationError if thrown from <code>getFactory</code>
*/
- private void registerSAXParsers(Vector parserFactoryClassNames)
- throws FactoryConfigurationError {
- if (parserFactoryClassNames != null) {
+ private void registerSAXParsers(Vector parserFactoryClassNames) throws FactoryConfigurationError
+ {
+ if (parserFactoryClassNames != null)
+ {
Enumeration e = parserFactoryClassNames.elements();
int index = 0;
- while (e.hasMoreElements()) {
- String parserFactoryClassName = (String) e.nextElement();
+ while (e.hasMoreElements())
+ {
+ String parserFactoryClassName = (String)e.nextElement();
// create a sax parser factory just to get it's default
// properties. It will never be used since
// this class will operate as a service factory and give each
// service requestor it's own SaxParserFactory
- SAXParserFactory factory = (SAXParserFactory) getFactory(parserFactoryClassName);
+ SAXParserFactory factory = (SAXParserFactory)getFactory(parserFactoryClassName);
Hashtable properties = new Hashtable(7);
// figure out the default properties of the parser
setDefaultSAXProperties(factory, properties, index);
@@ -275,11 +287,10 @@
* @param factory The <code>SAXParserFactory</code> object
* @param props <code>Hashtable</code> of service properties.
*/
- private void setDefaultSAXProperties(SAXParserFactory factory,
- Hashtable props, int index) {
+ private void setDefaultSAXProperties(SAXParserFactory factory, Hashtable props, int index)
+ {
props.put(Constants.SERVICE_DESCRIPTION, SAXFACTORYDESCRIPTION);
- props.put(Constants.SERVICE_PID, SAXFACTORYNAME + "."
- + context.getBundle().getBundleId() + "." + index);
+ props.put(Constants.SERVICE_PID, SAXFACTORYNAME + "." + context.getBundle().getBundleId() + "." + index);
setSAXProperties(factory, props);
}
@@ -304,25 +315,30 @@
* @param factory - the SAXParserFactory object
* @param properties - the properties object for the service
*/
- public void setSAXProperties(SAXParserFactory factory, Hashtable properties) {
+ public void setSAXProperties(SAXParserFactory factory, Hashtable properties)
+ {
// check if this parser can be configured to validate
boolean validating = true;
factory.setValidating(true);
factory.setNamespaceAware(false);
- try {
+ try
+ {
factory.newSAXParser();
}
- catch (Exception pce_val) {
+ catch (Exception pce_val)
+ {
validating = false;
}
// check if this parser can be configured to be namespaceaware
boolean namespaceaware = true;
factory.setValidating(false);
factory.setNamespaceAware(true);
- try {
+ try
+ {
factory.newSAXParser();
}
- catch (Exception pce_nsa) {
+ catch (Exception pce_nsa)
+ {
namespaceaware = false;
}
// set the factory values
@@ -341,18 +357,20 @@
* Factory Classes
* @throws FactoryConfigurationError if thrown from <code>getFactory</code>
*/
- private void registerDOMParsers(Vector parserFactoryClassNames)
- throws FactoryConfigurationError {
- if (parserFactoryClassNames != null) {
+ private void registerDOMParsers(Vector parserFactoryClassNames) throws FactoryConfigurationError
+ {
+ if (parserFactoryClassNames != null)
+ {
Enumeration e = parserFactoryClassNames.elements();
int index = 0;
- while (e.hasMoreElements()) {
- String parserFactoryClassName = (String) e.nextElement();
+ while (e.hasMoreElements())
+ {
+ String parserFactoryClassName = (String)e.nextElement();
// create a dom parser factory just to get it's default
// properties. It will never be used since
// this class will operate as a service factory and give each
// service requestor it's own DocumentBuilderFactory
- DocumentBuilderFactory factory = (DocumentBuilderFactory) getFactory(parserFactoryClassName);
+ DocumentBuilderFactory factory = (DocumentBuilderFactory)getFactory(parserFactoryClassName);
Hashtable properties = new Hashtable(7);
// figure out the default properties of the parser
setDefaultDOMProperties(factory, properties, index);
@@ -383,11 +401,10 @@
* @param factory The <code>DocumentBuilderFactory</code> object
* @param props <code>Hashtable</code> of service properties.
*/
- private void setDefaultDOMProperties(DocumentBuilderFactory factory,
- Hashtable props, int index) {
+ private void setDefaultDOMProperties(DocumentBuilderFactory factory, Hashtable props, int index)
+ {
props.put(Constants.SERVICE_DESCRIPTION, DOMFACTORYDESCRIPTION);
- props.put(Constants.SERVICE_PID, DOMFACTORYNAME + "."
- + context.getBundle().getBundleId() + "." + index);
+ props.put(Constants.SERVICE_PID, DOMFACTORYNAME + "." + context.getBundle().getBundleId() + "." + index);
setDOMProperties(factory, props);
}
@@ -412,25 +429,30 @@
* @param factory - the DocumentBuilderFactory object
* @param props - Hashtable of service properties.
*/
- public void setDOMProperties(DocumentBuilderFactory factory, Hashtable props) {
+ public void setDOMProperties(DocumentBuilderFactory factory, Hashtable props)
+ {
// check if this parser can be configured to validate
boolean validating = true;
factory.setValidating(true);
factory.setNamespaceAware(false);
- try {
+ try
+ {
factory.newDocumentBuilder();
}
- catch (Exception pce_val) {
+ catch (Exception pce_val)
+ {
validating = false;
}
// check if this parser can be configured to be namespaceaware
boolean namespaceaware = true;
factory.setValidating(false);
factory.setNamespaceAware(true);
- try {
+ try
+ {
factory.newDocumentBuilder();
}
- catch (Exception pce_nsa) {
+ catch (Exception pce_nsa)
+ {
namespaceaware = false;
}
// set the factory values
@@ -449,19 +471,23 @@
* @return a parserFactoryClass Object
* @pre parserFactoryClassName!=null
*/
- private Object getFactory(String parserFactoryClassName)
- throws FactoryConfigurationError {
+ private Object getFactory(String parserFactoryClassName) throws FactoryConfigurationError
+ {
Exception e = null;
- try {
+ try
+ {
return Class.forName(parserFactoryClassName).newInstance();
}
- catch (ClassNotFoundException cnfe) {
+ catch (ClassNotFoundException cnfe)
+ {
e = cnfe;
}
- catch (InstantiationException ie) {
+ catch (InstantiationException ie)
+ {
e = ie;
}
- catch (IllegalAccessException iae) {
+ catch (IllegalAccessException iae)
+ {
e = iae;
}
throw new FactoryConfigurationError(e);
@@ -488,33 +514,28 @@
* @return A new, configured XML Parser Factory object or null if a
* configuration error was encountered
*/
- public Object getService(Bundle bundle, ServiceRegistration registration) {
+ public Object getService(Bundle bundle, ServiceRegistration registration)
+ {
ServiceReference sref = registration.getReference();
- String parserFactoryClassName = (String) sref
- .getProperty(FACTORYNAMEKEY);
- try {
+ String parserFactoryClassName = (String)sref.getProperty(FACTORYNAMEKEY);
+ try
+ {
// need to set factory properties
Object factory = getFactory(parserFactoryClassName);
- if (factory instanceof SAXParserFactory) {
- ((SAXParserFactory) factory).setValidating(((Boolean) sref
- .getProperty(PARSER_VALIDATING)).booleanValue());
- ((SAXParserFactory) factory).setNamespaceAware(((Boolean) sref
- .getProperty(PARSER_NAMESPACEAWARE)).booleanValue());
+ if (factory instanceof SAXParserFactory)
+ {
+ ((SAXParserFactory)factory).setValidating(((Boolean)sref.getProperty(PARSER_VALIDATING)).booleanValue());
+ ((SAXParserFactory)factory).setNamespaceAware(((Boolean)sref.getProperty(PARSER_NAMESPACEAWARE)).booleanValue());
}
- else
- if (factory instanceof DocumentBuilderFactory) {
- ((DocumentBuilderFactory) factory)
- .setValidating(((Boolean) sref
- .getProperty(PARSER_VALIDATING))
- .booleanValue());
- ((DocumentBuilderFactory) factory)
- .setNamespaceAware(((Boolean) sref
- .getProperty(PARSER_NAMESPACEAWARE))
- .booleanValue());
- }
+ else if (factory instanceof DocumentBuilderFactory)
+ {
+ ((DocumentBuilderFactory)factory).setValidating(((Boolean)sref.getProperty(PARSER_VALIDATING)).booleanValue());
+ ((DocumentBuilderFactory)factory).setNamespaceAware(((Boolean)sref.getProperty(PARSER_NAMESPACEAWARE)).booleanValue());
+ }
return factory;
}
- catch (FactoryConfigurationError fce) {
+ catch (FactoryConfigurationError fce)
+ {
fce.printStackTrace();
return null;
}
@@ -529,7 +550,7 @@
* @param service The XML Parser Factory object returned by a previous call
* to the <code>getService</code> method.
*/
- public void ungetService(Bundle bundle, ServiceRegistration registration,
- Object service) {
+ public void ungetService(Bundle bundle, ServiceRegistration registration, Object service)
+ {
}
}
Modified: projects/jboss-osgi/projects/bundles/blueprint/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/blueprint/trunk/.classpath 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/blueprint/trunk/.classpath 2010-02-17 13:55:15 UTC (rev 101072)
@@ -4,7 +4,7 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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"/>
</classpath>
Modified: projects/jboss-osgi/projects/bundles/blueprint/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/bundles/blueprint/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/blueprint/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,6 +1,13 @@
-#Thu Feb 04 08:05:44 CET 2010
+#Wed Feb 17 12:14:28 CET 2010
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
Modified: projects/jboss-osgi/projects/bundles/blueprint/trunk/src/main/java/org/jboss/osgi/blueprint/internal/BlueprintEventDispatcher.java
===================================================================
--- projects/jboss-osgi/projects/bundles/blueprint/trunk/src/main/java/org/jboss/osgi/blueprint/internal/BlueprintEventDispatcher.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/blueprint/trunk/src/main/java/org/jboss/osgi/blueprint/internal/BlueprintEventDispatcher.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -151,7 +151,6 @@
}
}
- @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"})
private static String toString(BlueprintEvent event) {
return "BlueprintEvent[type=" + getEventType(event.getType())
+ (event.getDependencies() != null ? ", dependencies=" + Arrays.asList(event.getDependencies()) : "")
@@ -241,7 +240,6 @@
tracker.open();
}
- @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"})
public void blueprintEvent(BlueprintEvent event) {
EventAdmin eventAdmin = (EventAdmin) tracker.getService();
if (eventAdmin == null) {
Modified: projects/jboss-osgi/projects/bundles/common/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/.classpath 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/common/trunk/.classpath 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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"/>
</classpath>
Modified: projects/jboss-osgi/projects/bundles/common/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/common/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,5 +1,12 @@
-#Tue Apr 14 17:48:49 CEST 2009
+#Wed Feb 17 12:14:50 CET 2010
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Modified: projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingCapability.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/LoggingCapability.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -29,6 +29,7 @@
*
* It is ignored if the {@link LoggingService} is already registered.
*
+ * Dependent Capability: {@link CompendiumCapability}
* Installed bundles: jboss-osgi-common.jar
*
* @author thomas.diesler at jboss.com
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/.classpath 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/.classpath 2010-02-17 13:55:15 UTC (rev 101072)
@@ -3,7 +3,7 @@
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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"/>
</classpath>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,6 +1,13 @@
-#Mon Nov 30 15:53:56 CET 2009
+#Wed Feb 17 12:15:46 CET 2010
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2010-02-17 13:55:15 UTC (rev 101072)
@@ -40,6 +40,9 @@
<!-- 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.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.deployment>1.0.2-SNAPSHOT</version.jboss.osgi.deployment>
<version.osgi>4.2.0</version.osgi>
@@ -52,17 +55,51 @@
<artifactId>bnd</artifactId>
</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.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>
<!-- Provided Dependencies -->
<dependency>
+ <groupId>org.apache.aries.jmx</groupId>
+ <artifactId>org.apache.aries.jmx</artifactId>
+ <version>${version.apache.aries.jmx}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.log</artifactId>
+ <version>${version.apache.felix.log}</version>
+ <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>
<artifactId>org.osgi.core</artifactId>
<version>${version.osgi}</version>
@@ -98,20 +135,21 @@
org.jboss.osgi.testing;version=${version},
</Export-Package>
<Import-Package>
- javax.management,
+ javax.management*,
javax.naming,
- org.jboss.logging;version="[2.1,2.2)",
- org.jboss.osgi.deployment.interceptor;version="[1.0,1.1)",
- org.jboss.osgi.spi;version="[1.0,1.1)",
- org.jboss.osgi.spi.capability;version="[1.0,1.1)",
- org.jboss.osgi.spi.management;version="[1.0,1.1)",
- org.jboss.osgi.spi.util;version="[1.0,1.1)",
- org.jboss.virtual;version="[2.1,2.2)",
+ org.jboss.logging;version="[2.1,3.0)",
+ org.jboss.virtual;version="[2.1,3.0)",
org.junit;version="[4.6,5.0)",
- org.osgi.framework,
- org.osgi.util.tracker,
+ org.jboss.osgi.deployment*;version="[1.0,2.0)",
+ org.jboss.osgi.jmx*;version="[1.0,2.0)",
+ org.jboss.osgi.spi*;version="[1.0,2.0)",
+
+ org.osgi.framework;version="[1.5,2.0)",
+ org.osgi.jmx.framework;version="[1.0,2.0)",
+ org.osgi.util.tracker;version="[1.4,2.0)",
+
<!-- ignore client side -->
!org.jboss.osgi.deployment.deployer,
!org.jboss.osgi.spi.framework,
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-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/scripts/assembly-bundles.xml 2010-02-17 13:55:15 UTC (rev 101072)
@@ -15,6 +15,21 @@
<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>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/HuskyCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/HuskyCapability.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/HuskyCapability.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -24,6 +24,7 @@
//$Id$
import org.jboss.osgi.husky.runtime.Connector;
+import org.jboss.osgi.jmx.JMXCapability;
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.testing.OSGiRuntime;
@@ -33,6 +34,7 @@
*
* It is ignored if a Husky connector is already registered.
*
+ * Dependent Capability: {@link JMXCapability}
* Installed bundles: jboss-osgi-husky.jar
*
* @author thomas.diesler at jboss.com
@@ -44,6 +46,8 @@
{
super(Connector.class.getName());
+ addDependency(new JMXCapability());
+
addBundle("bundles/jboss-osgi-husky.jar");
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/internal/AbstractInvoker.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/internal/AbstractInvoker.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/internal/AbstractInvoker.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -82,7 +82,6 @@
}
}
- @SuppressWarnings("unchecked")
private MBeanServerConnection getMBeanServer()
{
ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/husky/runtime/osgi/JMXConnector.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -100,7 +100,6 @@
return super.process(reqStream);
}
- @SuppressWarnings("unchecked")
private MBeanServer getMBeanServer()
{
MBeanServer mbeanServer = null;
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntime.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/OSGiRuntime.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -28,6 +28,10 @@
import org.jboss.osgi.spi.capability.Capability;
import org.osgi.framework.BundleException;
import org.osgi.framework.Version;
+import org.osgi.jmx.framework.BundleStateMBean;
+import org.osgi.jmx.framework.FrameworkMBean;
+import org.osgi.jmx.framework.PackageStateMBean;
+import org.osgi.jmx.framework.ServiceStateMBean;
import org.osgi.service.packageadmin.PackageAdmin;
/**
@@ -59,6 +63,26 @@
OSGiBundle installBundle(String location) throws BundleException;
/**
+ * Get the FrameworkMBean
+ */
+ FrameworkMBean getFrameworkMBean();
+
+ /**
+ * Get the BundleStateMBean
+ */
+ BundleStateMBean getBundleStateMBean();
+
+ /**
+ * Get the PackageStateMBean
+ */
+ PackageStateMBean getPackageStateMBean();
+
+ /**
+ * Get the ServiceStateMBean
+ */
+ ServiceStateMBean getServiceStateMBean();
+
+ /**
* Get the array of installed {@link OSGiBundle}s
*/
OSGiBundle[] getBundles();
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/OSGiTestHelper.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -123,7 +123,7 @@
try
{
File resourceFile = getResourceFile(resource);
- resURL = resourceFile.toURL();
+ resURL = resourceFile.toURI().toURL();
}
catch (MalformedURLException e)
{
@@ -151,7 +151,7 @@
{
try
{
- return getTestArchiveFile(archive).toURL();
+ return getTestArchiveFile(archive).toURI().toURL();
}
catch (MalformedURLException ex)
{
Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/DeployerServiceClient.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/DeployerServiceClient.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/DeployerServiceClient.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,99 +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 java.net.URL;
-import java.util.Arrays;
-
-import javax.management.MBeanException;
-import javax.management.ObjectName;
-
-import org.jboss.osgi.deployment.deployer.AbstractDeployerService;
-import org.jboss.osgi.deployment.deployer.Deployment;
-import org.jboss.osgi.testing.OSGiRuntime;
-import org.osgi.framework.BundleException;
-
-/**
- * An abstract implementation of the {@link OSGiRuntime}
- *
- * @author Thomas.Diesler at jboss.org
- * @since 25-Sep-2008
- */
-class DeployerServiceClient extends AbstractDeployerService
-{
- private final OSGiRuntime runtime;
- private ObjectName oname;
-
- DeployerServiceClient(OSGiRuntime runtime, ObjectName oname)
- {
- this.runtime = runtime;
- this.oname = oname;
- }
-
- public void deploy(Deployment[] deps) throws BundleException
- {
- invokeDeployerMBean(oname, "deploy", deps, Deployment[].class.getName());
- }
-
- public void deploy(URL url) throws BundleException
- {
- invokeDeployerMBean(oname, "deploy", url, URL.class.getName());
- }
-
- public void undeploy(Deployment[] deps) throws BundleException
- {
- invokeDeployerMBean(oname, "undeploy", deps, Deployment[].class.getName());
- }
-
- public void undeploy(URL url) throws BundleException
- {
- invokeDeployerMBean(oname, "undeploy", url, URL.class.getName());
- }
-
- private void invokeDeployerMBean(ObjectName oname, String method, Object arg, String type) throws BundleException
- {
- try
- {
- this.runtime.getMBeanServer().invoke(oname, method, new Object[] { arg }, new String[] { type });
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- if (ex instanceof MBeanException)
- {
- ex = ((MBeanException)ex).getTargetException();
- if (ex instanceof BundleException)
- throw (BundleException)ex;
- }
-
- if (arg instanceof Deployment[])
- arg = Arrays.asList((Deployment[])arg);
-
- throw new BundleException("Cannot " + method + ": " + arg, ex);
- }
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedBundle.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedBundle.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedBundle.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -25,8 +25,6 @@
import java.net.URL;
import java.util.Dictionary;
-import org.jboss.logging.Logger;
-import org.jboss.osgi.deployment.deployer.DeployerService;
import org.jboss.osgi.spi.util.ExportedPackageHelper;
import org.jboss.osgi.testing.OSGiBundle;
import org.osgi.framework.Bundle;
@@ -44,9 +42,6 @@
*/
public class EmbeddedBundle extends OSGiBundleImpl
{
- // Provide logging
- private static final Logger log = Logger.getLogger(EmbeddedBundle.class);
-
private Bundle bundle;
public EmbeddedBundle(OSGiRuntimeImpl runtime, Bundle bundle)
@@ -158,31 +153,11 @@
public void uninstall() throws BundleException
{
assertNotUninstalled();
- try
- {
- BundleContext context = ((EmbeddedRuntime)getRuntime()).getSystemContext();
- ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
- if (sref != null)
- {
- DeployerService service = (DeployerService)context.getService(sref);
- service.undeploy(new URL(getLocation()));
- }
- else
- {
- bundle.uninstall();
- }
-
- OSGiRuntimeImpl runtimeImpl = (OSGiRuntimeImpl)getRuntime();
- runtimeImpl.unregisterBundle(this);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.error("Cannot uninstall: " + getLocation(), ex);
- }
+
+ bundle.uninstall();
+
+ OSGiRuntimeImpl runtimeImpl = (OSGiRuntimeImpl)getRuntime();
+ runtimeImpl.unregisterBundle(this);
}
private PackageAdmin getPackageAdmin()
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/EmbeddedRuntime.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -33,9 +33,6 @@
import javax.management.MBeanServerFactory;
import org.jboss.logging.Logger;
-import org.jboss.osgi.deployment.deployer.DeployerService;
-import org.jboss.osgi.deployment.deployer.Deployment;
-import org.jboss.osgi.deployment.deployer.DeploymentFactory;
import org.jboss.osgi.spi.capability.Capability;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.util.BundleInfo;
@@ -49,7 +46,6 @@
import org.osgi.framework.BundleException;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
-import org.osgi.framework.Version;
import org.osgi.framework.launch.Framework;
import org.osgi.service.packageadmin.PackageAdmin;
@@ -72,27 +68,11 @@
public OSGiBundle installBundle(String location) throws BundleException
{
BundleInfo info = BundleInfo.createBundleInfo(location);
- Deployment dep = DeploymentFactory.createDeployment(info);
- String symbolicName = info.getSymbolicName();
- Version version = info.getVersion();
- OSGiBundle bundle;
-
BundleContext context = getSystemContext();
- ServiceReference sref = context.getServiceReference(DeployerService.class.getName());
- if (sref != null)
- {
- DeployerService service = (DeployerService)context.getService(sref);
- log.debug("Install using DeployerService: " + service.getClass().getName());
- service.deploy(new Deployment[] { dep });
- bundle = getBundle(symbolicName, version, true);
- }
- else
- {
- log.debug("Install using system context");
- Bundle auxBundle = context.installBundle(info.getLocation());
- bundle = new EmbeddedBundle(this, auxBundle);
- }
+ Bundle auxBundle = context.installBundle(info.getLocation());
+ OSGiBundle bundle = new EmbeddedBundle(this, auxBundle);
+
return registerBundle(bundle.getLocation(), bundle);
}
@@ -183,7 +163,6 @@
}
}
- @SuppressWarnings("unchecked")
public MBeanServerConnection getMBeanServer()
{
ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/MainDeployerClient.java (from rev 101012, projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/DeployerServiceClient.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/MainDeployerClient.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/MainDeployerClient.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -0,0 +1,83 @@
+/*
+ * 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 java.net.URL;
+
+import javax.management.MBeanException;
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.osgi.framework.BundleException;
+
+/**
+ * An abstract implementation of the {@link OSGiRuntime}
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Sep-2008
+ */
+class MainDeployerClient
+{
+ private final OSGiRuntime runtime;
+
+ MainDeployerClient(OSGiRuntime runtime)
+ {
+ this.runtime = runtime;
+ }
+
+ public void deploy(URL url) throws BundleException
+ {
+ invokeDeployerMBean("deploy", url);
+ }
+
+ public void undeploy(URL url) throws BundleException
+ {
+ invokeDeployerMBean("undeploy", url);
+ }
+
+ private void invokeDeployerMBean(String method, URL url) throws BundleException
+ {
+ try
+ {
+ ObjectName objectName = ObjectNameFactory.create("jboss.system:service=MainDeployer");
+ runtime.getMBeanServer().invoke(objectName, method, new Object[] { url }, new String[] { URL.class.getName() });
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ if (ex instanceof MBeanException)
+ {
+ ex = ((MBeanException)ex).getTargetException();
+ if (ex instanceof BundleException)
+ throw (BundleException)ex;
+ }
+
+ throw new BundleException("Cannot " + method + ": " + url, ex);
+ }
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiBundleImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiBundleImpl.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiBundleImpl.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -35,9 +35,9 @@
*/
public abstract class OSGiBundleImpl extends OSGiBundle
{
- private OSGiRuntimeImpl runtime;
+ private OSGiRuntime runtime;
- OSGiBundleImpl(OSGiRuntimeImpl runtime)
+ OSGiBundleImpl(OSGiRuntime runtime)
{
this.runtime = runtime;
}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/OSGiRuntimeImpl.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -36,12 +36,14 @@
import java.util.jar.JarFile;
import java.util.jar.Manifest;
+import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.jboss.logging.Logger;
-import org.jboss.osgi.deployment.deployer.DeployerService;
import org.jboss.osgi.spi.capability.Capability;
+import org.jboss.osgi.spi.management.MBeanProxy;
+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.OSGiRuntime;
@@ -50,6 +52,10 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Version;
+import org.osgi.jmx.framework.BundleStateMBean;
+import org.osgi.jmx.framework.FrameworkMBean;
+import org.osgi.jmx.framework.PackageStateMBean;
+import org.osgi.jmx.framework.ServiceStateMBean;
/**
* An abstract implementation of the {@link OSGiRuntime}
@@ -65,6 +71,11 @@
private OSGiTestHelper helper;
private Map<String, OSGiBundle> bundles = new LinkedHashMap<String, OSGiBundle>();
private List<Capability> capabilities = new ArrayList<Capability>();
+
+ private ServiceStateMBean serviceState;
+ private PackageStateMBean packageState;
+ private BundleStateMBean bundleState;
+ private FrameworkMBean framework;
public OSGiRuntimeImpl(OSGiTestHelper helper)
{
@@ -170,16 +181,56 @@
log.debug("End Shutdown");
}
+ public FrameworkMBean getFrameworkMBean()
+ {
+ if (framework == null)
+ {
+ ObjectName objectName = ObjectNameFactory.create(FrameworkMBean.OBJECTNAME);
+ framework = MBeanProxy.get(getMBeanServer(), objectName, FrameworkMBean.class);
+ }
+ return framework;
+ }
+
+ public BundleStateMBean getBundleStateMBean()
+ {
+ if (bundleState == null)
+ {
+ ObjectName objectName = ObjectNameFactory.create(BundleStateMBean.OBJECTNAME);
+ bundleState = MBeanProxy.get(getMBeanServer(), objectName, BundleStateMBean.class);
+ }
+ return bundleState;
+ }
+
+ public PackageStateMBean getPackageStateMBean()
+ {
+ if (packageState == null)
+ {
+ ObjectName objectName = ObjectNameFactory.create(PackageStateMBean.OBJECTNAME);
+ packageState = MBeanProxy.get(getMBeanServer(), objectName, PackageStateMBean.class);
+ }
+ return packageState;
+ }
+
+ public ServiceStateMBean getServiceStateMBean()
+ {
+ if (serviceState == null)
+ {
+ ObjectName objectName = ObjectNameFactory.create(ServiceStateMBean.OBJECTNAME);
+ serviceState = MBeanProxy.get(getMBeanServer(), objectName, ServiceStateMBean.class);
+ }
+ return serviceState;
+ }
+
void deploy(URL archiveURL) throws Exception
{
- DeployerServiceClient deployer = new DeployerServiceClient(this, DeployerService.MBEAN_DEPLOYER_SERVICE);
- deployer.deploy(archiveURL);
+ //DeployerServiceClient deployer = new DeployerServiceClient(this, DeployerService.MBEAN_DEPLOYER_SERVICE);
+ //deployer.deploy(archiveURL);
}
void undeploy(URL archiveURL) throws Exception
{
- DeployerServiceClient deployer = new DeployerServiceClient(this, DeployerService.MBEAN_DEPLOYER_SERVICE);
- deployer.undeploy(archiveURL);
+ //DeployerServiceClient deployer = new DeployerServiceClient(this, DeployerService.MBEAN_DEPLOYER_SERVICE);
+ //deployer.undeploy(archiveURL);
}
public InitialContext getInitialContext() throws NamingException
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -35,15 +35,16 @@
import javax.management.ObjectName;
import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.ManagedBundle;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
-import org.jboss.osgi.spi.util.BundleInfo;
import org.jboss.osgi.spi.util.UnmodifiableDictionary;
import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiRuntime;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
import org.osgi.framework.Version;
+import org.osgi.jmx.framework.BundleStateMBean;
/**
* An implementation of a remote {@link OSGiBundle}
@@ -56,41 +57,42 @@
// Provide logging
private static final Logger log = Logger.getLogger(RemoteBundle.class);
- private ManagedBundleMBean bundle;
+ private long bundleId;
private String location;
-
- private long bundleId;
private String symbolicName;
private ObjectName objectName;
+ private ManagedBundleMBean bundleMBean;
private Dictionary<String, String> defaultHeaders;
private Dictionary<String, String> rawHeaders;
private Version version;
boolean uninstalled;
- public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle, BundleInfo info)
+ public RemoteBundle(OSGiRuntime runtime, long bundleId)
{
- this(runtime, bundle);
- this.location = info.getLocation();
- }
-
- public RemoteBundle(OSGiRuntimeImpl runtime, ManagedBundleMBean bundle)
- {
super(runtime);
- this.bundle = bundle;
+ this.bundleId = bundleId;
+ BundleStateMBean bundleState = runtime.getBundleStateMBean();
+ try
+ {
+ symbolicName = bundleState.getSymbolicName(bundleId);
+ location = bundleState.getLocation(bundleId);
+
+ String versionStr = bundleState.getVersion(bundleId);
+ version = Version.parseVersion(versionStr);
+ }
+ catch (IOException ex)
+ {
+ throw new IllegalStateException("Cannot initialize remote bundle", ex);
+ }
+
+ objectName = ManagedBundle.getObjectName(bundleId, symbolicName, version);
+ bundleMBean = MBeanProxy.get(runtime.getMBeanServer(), objectName, ManagedBundleMBean.class);
+
// The getHeaders methods must continue to provide the manifest header
// information after the bundle enters the UNINSTALLED state.
-
- bundleId = bundle.getBundleId();
- symbolicName = bundle.getSymbolicName();
- objectName = bundle.getObjectName();
- location = bundle.getLocation();
-
- defaultHeaders = bundle.getHeaders(null);
- rawHeaders = bundle.getHeaders("");
-
- String versionStr = defaultHeaders.get(Constants.BUNDLE_VERSION);
- version = Version.parseVersion(versionStr);
+ defaultHeaders = bundleMBean.getHeaders(null);
+ rawHeaders = bundleMBean.getHeaders("");
}
@Override
@@ -101,13 +103,27 @@
try
{
- return bundle.getState();
+ BundleStateMBean bundleState = getRuntime().getBundleStateMBean();
+ String state = bundleState.getState(bundleId);
+ if ("INSTALLED".equals(state))
+ return Bundle.INSTALLED;
+ if ("RESOLVED".equals(state))
+ return Bundle.RESOLVED;
+ if ("STARTING".equals(state))
+ return Bundle.STARTING;
+ if ("ACTIVE".equals(state))
+ return Bundle.ACTIVE;
+ if ("STOPPING".equals(state))
+ return Bundle.STOPPING;
+ if ("UNINSTALLED".equals(state))
+ return Bundle.UNINSTALLED;
+
}
- catch (RuntimeException rte)
+ catch (Exception rte)
{
Throwable cause = rte.getCause() != null ? rte.getCause() : rte;
if (cause instanceof InstanceNotFoundException == false)
- log.warn("Cannot get state for: " + objectName, cause);
+ log.warn("Cannot get state for bundle: " + bundleId, cause);
}
return Bundle.UNINSTALLED;
}
@@ -152,42 +168,42 @@
else if (locale.length() == 0)
return new UnmodifiableDictionary(rawHeaders);
else
- return bundle.getHeaders(locale);
+ return bundleMBean.getHeaders(locale);
}
@Override
public String getProperty(String key)
{
assertNotUninstalled();
- return bundle.getProperty(key);
+ return bundleMBean.getProperty(key);
}
@Override
public URL getEntry(String path)
{
assertNotUninstalled();
- return toURL(bundle.getEntry(path), null);
+ return toURL(bundleMBean.getEntry(path), null);
}
@Override
public URL getResource(String name)
{
assertNotUninstalled();
- return toURL(bundle.getResource(name), null);
+ return toURL(bundleMBean.getResource(name), null);
}
@Override
public File getDataFile(String filename)
{
assertNotUninstalled();
- return bundle.getDataFile(filename);
+ return bundleMBean.getDataFile(filename);
}
@Override
public OSGiBundle loadClass(String name) throws ClassNotFoundException
{
assertNotUninstalled();
- ObjectName providerBundle = bundle.loadClass(name);
+ ObjectName providerBundle = bundleMBean.loadClass(name);
if (providerBundle == null)
return null;
@@ -199,14 +215,28 @@
public void start() throws BundleException
{
assertNotUninstalled();
- bundle.start();
+ try
+ {
+ getRuntime().getFrameworkMBean().startBundle(bundleId);
+ }
+ catch (IOException ex)
+ {
+ throw new BundleException("Cannot start bundle: " + objectName, ex);
+ }
}
@Override
public void stop() throws BundleException
{
assertNotUninstalled();
- bundle.stop();
+ try
+ {
+ getRuntime().getFrameworkMBean().stopBundle(bundleId);
+ }
+ catch (IOException ex)
+ {
+ throw new BundleException("Cannot stop bundle: " + objectName, ex);
+ }
}
@Override
@@ -216,7 +246,7 @@
try
{
OSGiRuntimeImpl runtimeImpl = (OSGiRuntimeImpl)getRuntime();
- runtimeImpl.undeploy(new URL(location));
+ runtimeImpl.getFrameworkMBean().uninstallBundle(bundleId);
runtimeImpl.unregisterBundle(this);
uninstalled = true;
}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteFramework.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteFramework.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteFramework.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -23,9 +23,6 @@
//$Id$
-import java.util.Set;
-
-import org.jboss.osgi.spi.management.ManagedBundleMBean;
import org.jboss.osgi.spi.management.ManagedServiceReference;
/**
@@ -37,28 +34,11 @@
public interface RemoteFramework
{
/**
- * Get the list of all installed bundles
- */
- Set<ManagedBundleMBean> getBundles();
-
- /**
- * Get the installed bundle
- * @return A managed bundle MBean or null if the identifier does not match any installed bundle.
- */
- ManagedBundleMBean getBundle(String symbolicName, String version);
-
- /**
- * Get the installed bundle by id
- * @return A managed bundle MBean or null if the identifier does not match any installed bundle.
- */
- ManagedBundleMBean getBundle(long bundleId);
-
- /**
* 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
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemotePackageAdmin.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -21,15 +21,14 @@
*/
package org.jboss.osgi.testing.internal;
-import javax.management.ObjectName;
+import java.io.IOException;
import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.management.MBeanProxyException;
-import org.jboss.osgi.spi.management.ManagedBundle;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiPackageAdmin;
-import org.osgi.framework.Version;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.osgi.jmx.framework.FrameworkMBean;
/**
* A remote implementation of the {@link OSGiPackageAdmin}
@@ -39,56 +38,64 @@
*/
public class RemotePackageAdmin implements OSGiPackageAdmin
{
- private OSGiRuntimeImpl runtime;
+ private OSGiRuntime runtime;
- public RemotePackageAdmin(OSGiRuntimeImpl runtime)
+ public RemotePackageAdmin(OSGiRuntime runtime)
{
this.runtime = runtime;
}
public boolean resolveBundles(OSGiBundle[] bundles)
{
- ObjectName[] bundleArr = getBundleNames(bundles);
- try
+ // JMX FrameworkMBean does not allow to resolve/refresh all bundles
+ // 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);
- return mbeanProxy.resolveBundles(bundleArr);
+ return mbeanProxy.resolveAllBundles();
}
- catch (MBeanProxyException ex)
+
+ FrameworkMBean framework = runtime.getFrameworkMBean();
+ try
{
- throw new IllegalStateException("Cannot refresh packages", ex);
+ long[] ids = getBundleIds(bundles);
+ return framework.resolveBundles(ids);
}
+ catch (IOException ex)
+ {
+ throw new IllegalStateException("Cannot resolve bundles", ex);
+ }
}
public void refreshPackages(OSGiBundle[] bundles)
{
- ObjectName[] bundleArr = getBundleNames(bundles);
- try
+ // JMX FrameworkMBean does not allow to resolve/refresh all bundles
+ // 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);
- mbeanProxy.refreshPackages(bundleArr);
+ mbeanProxy.refreshAllPackages();
+ return;
}
- catch (MBeanProxyException ex)
+
+ FrameworkMBean framework = runtime.getFrameworkMBean();
+ try
{
- throw new IllegalStateException("Cannot refresh packages", ex);
+ long[] ids = getBundleIds(bundles);
+ framework.refreshPackages(ids);
}
+ catch (IOException ex)
+ {
+ throw new IllegalStateException("Cannot resolve bundles", ex);
+ }
}
- private ObjectName[] getBundleNames(OSGiBundle[] bundles)
+ private long[] getBundleIds(OSGiBundle[] bundles)
{
- ObjectName[] bundleArr = null;
- if (bundles != null)
- {
- bundleArr = new ObjectName[bundles.length];
- for (int i=0; i < bundles.length; i++)
- {
- OSGiBundle bundle = bundles[i];
- long id = bundle.getBundleId();
- String symbolicName = bundle.getSymbolicName();
- Version version = bundle.getVersion();
- bundleArr[i] = ManagedBundle.getObjectName(id, symbolicName, version);
- }
- }
- return bundleArr;
+ long[] ids = new long[bundles.length];
+ for (int i = 0; i < bundles.length; i++)
+ ids[i] = bundles[i].getBundleId();
+
+ return ids;
}
}
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -25,20 +25,17 @@
import java.net.URL;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Set;
import javax.management.MBeanServerConnection;
-import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
+import javax.management.openmbean.CompositeData;
+import javax.management.openmbean.TabularData;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jboss.osgi.deployment.deployer.DeployerService;
-import org.jboss.osgi.deployment.deployer.Deployment;
-import org.jboss.osgi.deployment.deployer.DeploymentFactory;
import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.management.MBeanProxyException;
-import org.jboss.osgi.spi.management.ManagedBundleMBean;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
import org.jboss.osgi.spi.management.ManagedServiceReference;
import org.jboss.osgi.spi.util.BundleInfo;
@@ -48,6 +45,7 @@
import org.jboss.osgi.testing.OSGiServiceReference;
import org.jboss.osgi.testing.OSGiTestHelper;
import org.osgi.framework.BundleException;
+import org.osgi.jmx.framework.BundleStateMBean;
/**
* A remote implementation of the {@link OSGiRuntime}
@@ -58,8 +56,7 @@
public class RemoteRuntime extends OSGiRuntimeImpl
{
private MBeanServerConnection mbeanServer;
- private ManagedFrameworkMBean managedFramework;
-
+
public RemoteRuntime(OSGiTestHelper helper)
{
super(helper);
@@ -71,29 +68,11 @@
{
// Get the bundle info from the location
BundleInfo info = BundleInfo.createBundleInfo(location);
- Deployment dep = DeploymentFactory.createDeployment(info);
- dep.setAutoStart(false);
+ String rootURL = info.getRootURL().toExternalForm();
- // Deploy the deployemnt through the DeployerService
- DeployerServiceClient deployer = new DeployerServiceClient(this, DeployerService.MBEAN_DEPLOYER_SERVICE);
- deployer.deploy(new Deployment[] { dep });
-
- String symbolicName = info.getSymbolicName();
- String version = info.getVersion().toString();
+ long bundleId = getFrameworkMBean().installBundle(rootURL);
- // The remote framework uses a BundleTracker that works of an asynchronous
- // event to register the installed bundle. It is not available immediately.
- int timeout = 50;
- ManagedBundleMBean bundleMBean = getRemoteFramework().getBundle(symbolicName, version);
- while (bundleMBean == null && 0 < timeout--)
- {
- Thread.sleep(200);
- bundleMBean = getRemoteFramework().getBundle(symbolicName, version);
- }
- if (bundleMBean == null)
- throw new IllegalStateException("Cannot find installed bundle: " + symbolicName + "-" + version);
-
- RemoteBundle bundle = new RemoteBundle(this, bundleMBean, info);
+ RemoteBundle bundle = new RemoteBundle(this, bundleId);
return registerBundle(bundle.getLocation(), bundle);
}
catch (RuntimeException rte)
@@ -113,27 +92,30 @@
public void deploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
- ObjectName oname = getDeployerServiceName(archiveURL);
- DeployerServiceClient deployer = new DeployerServiceClient(this, oname);
+ MainDeployerClient deployer = new MainDeployerClient(this);
deployer.deploy(archiveURL);
}
public void undeploy(String location) throws Exception
{
URL archiveURL = getTestHelper().getTestArchiveURL(location);
- ObjectName oname = getDeployerServiceName(archiveURL);
- DeployerServiceClient deployer = new DeployerServiceClient(this, oname);
+ MainDeployerClient deployer = new MainDeployerClient(this);
deployer.undeploy(archiveURL);
}
public OSGiBundle[] getBundles()
{
+ Set<OSGiBundle> bundles = new HashSet<OSGiBundle>();
try
{
- Set<ManagedBundleMBean> remoteBundles = getRemoteFramework().getBundles();
- Set<OSGiBundle> bundles = new HashSet<OSGiBundle>();
- for (ManagedBundleMBean remoteBundle : remoteBundles)
- bundles.add(new RemoteBundle(this, remoteBundle));
+ TabularData listBundles = getBundleStateMBean().listBundles();
+ Iterator<?> iterator = listBundles.values().iterator();
+ while(iterator.hasNext())
+ {
+ CompositeData next = (CompositeData)iterator.next();
+ Object bundleId = next.get(BundleStateMBean.IDENTIFIER);
+ bundles.add(new RemoteBundle(this, (Long)bundleId));
+ }
OSGiBundle[] bundleArr = new OSGiBundle[bundles.size()];
bundles.toArray(bundleArr);
@@ -147,8 +129,12 @@
public OSGiBundle getBundle(long bundleId)
{
- ManagedBundleMBean bundle = getRemoteFramework().getBundle(bundleId);
- return bundle != null ? new RemoteBundle(this, bundle) : null;
+ for (OSGiBundle bundle : getBundles())
+ {
+ if (bundleId == bundle.getBundleId())
+ return bundle;
+ }
+ return null;
}
public OSGiServiceReference getServiceReference(String clazz)
@@ -196,72 +182,11 @@
private RemoteFramework getRemoteFramework()
{
- try
- {
- if (managedFramework == null)
- managedFramework = MBeanProxy.get(getMBeanServer(), ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, ManagedFrameworkMBean.class);
- }
- catch (MBeanProxyException ex)
- {
- throw new RemoteFrameworkException(ex);
- }
+ ObjectName objectName = ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
+ final ManagedFrameworkMBean managedFramework = MBeanProxy.get(getMBeanServer(), objectName, ManagedFrameworkMBean.class);
return new RemoteFramework()
{
- public ManagedBundleMBean getBundle(String name, String version)
- {
- ManagedBundleMBean bundleMBean = null;
- ObjectName oname = managedFramework.getBundle(name, version);
- if (oname != null)
- {
- try
- {
- bundleMBean = MBeanProxy.get(getMBeanServer(), oname, ManagedBundleMBean.class);
- }
- catch (MBeanProxyException ex)
- {
- throw new RemoteFrameworkException(ex);
- }
- }
- return bundleMBean;
- }
-
- public ManagedBundleMBean getBundle(long bundleId)
- {
- ManagedBundleMBean bundleMBean = null;
- ObjectName oname = managedFramework.getBundle(bundleId);
- if (oname != null)
- {
- try
- {
- bundleMBean = MBeanProxy.get(getMBeanServer(), oname, ManagedBundleMBean.class);
- }
- catch (MBeanProxyException ex)
- {
- throw new RemoteFrameworkException(ex);
- }
- }
- return bundleMBean;
- }
-
- public Set<ManagedBundleMBean> getBundles()
- {
- Set<ManagedBundleMBean> remBundles = new HashSet<ManagedBundleMBean>();
- for (ObjectName bundleOName : managedFramework.getBundles())
- {
- try
- {
- ManagedBundleMBean remBundle = MBeanProxy.get(getMBeanServer(), bundleOName, ManagedBundleMBean.class);
- remBundles.add(remBundle);
- }
- catch (MBeanProxyException ex)
- {
- throw new RemoteFrameworkException(ex);
- }
- }
- return remBundles;
- }
-
public ManagedServiceReference getServiceReference(String clazz)
{
return managedFramework.getServiceReference(clazz);
@@ -278,23 +203,4 @@
{
return true;
}
-
- /**
- * Return ObjectName of the DeployerService MBean if hte archive is a bundle
- * otherwise if returns the ObjectName of the MainDeployer
- */
- private ObjectName getDeployerServiceName(URL archiveURL) throws MalformedObjectNameException
- {
- ObjectName oname;
- try
- {
- BundleInfo.createBundleInfo(archiveURL);
- oname = DeployerService.MBEAN_DEPLOYER_SERVICE;
- }
- catch (Exception e)
- {
- oname = new ObjectName("jboss.system:service=MainDeployer");
- }
- return oname;
- }
}
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-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/test/resources/jboss-osgi-framework.properties 2010-02-17 13:55:15 UTC (rev 101072)
@@ -17,13 +17,16 @@
# 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.logging;version=2.1, \
org.jboss.virtual;version=2.1, \
org.osgi.framework;version=1.5
@@ -32,5 +35,6 @@
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/jboss-osgi-common.jar
+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
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/.classpath 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/.classpath 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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"/>
</classpath>
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,5 +1,12 @@
-#Tue Apr 14 17:48:49 CEST 2009
+#Tue Feb 16 17:21:12 CET 2010
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: projects/jboss-osgi/projects/bundles/jmx/trunk/EEG-Feedback-JMX.txt
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/EEG-Feedback-JMX.txt (rev 0)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/EEG-Feedback-JMX.txt 2010-02-17 13:55:15 UTC (rev 101072)
@@ -0,0 +1,15 @@
+$Id$
+
+------------------------------------------------------------------------------------------
+JMX FrameworkMBean does not allow to resolve/refresh all bundles
+https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1586
+
+The signature and API docs of
+
+FrameworkMBean.refreshBundles(long[] bundleIdentifiers)
+FrameworkMBean.resolveBundles(long[] bundleIdentifiers)
+
+does not obviously allow to resolve/refresh all bundles.
+
+A client would be forced to collect all ids before making the call.
+PackageAdmin however uses a null paramter to mean 'all bundles'.
Property changes on: projects/jboss-osgi/projects/bundles/jmx/trunk/EEG-Feedback-JMX.txt
___________________________________________________________________
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-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/pom.xml 2010-02-17 13:55:15 UTC (rev 101072)
@@ -41,7 +41,6 @@
<properties>
<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.spi>1.0.5-SNAPSHOT</version.jboss.osgi.spi>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -57,11 +56,6 @@
<artifactId>jboss-osgi-jndi</artifactId>
<version>${version.jboss.osgi.jndi}</version>
</dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-spi</artifactId>
- <version>${version.jboss.osgi.spi}</version>
- </dependency>
<!-- OSGi Dependencies -->
<dependency>
@@ -99,16 +93,14 @@
javax.naming.spi,
<!-- jboss-osgi -->
- org.jboss.osgi.spi.capability;version=1.0,
- org.jboss.osgi.spi.management;version=1.0,
+ org.jboss.osgi.spi*;version="[1.0,2.0)",
<!-- osgi -->
- org.osgi.framework;version=1.4,
- org.osgi.service.log,
- org.osgi.service.packageadmin,
- org.osgi.util.tracker,
+ org.osgi.framework;version="[1.5,2.0)",
+ org.osgi.service.packageadmin;version="[1.2,2.0)",
+ org.osgi.util.tracker;version="[1.4,2.0)",
- <!-- FIXME optional -->
+ <!-- FIXME: make optional -->
org.jboss.osgi.jndi,
org.jboss.net.sockets,
org.jnp.interfaces,
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/JMXCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/JMXCapability.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -34,6 +34,7 @@
*
* 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
@@ -59,5 +60,6 @@
addDependency(new JNDICapability());
addBundle("bundles/jboss-osgi-jmx.jar");
+ addBundle("bundles/org.apache.aries.jmx.jar");
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -50,7 +50,6 @@
this.context = context;
}
- @SuppressWarnings("unchecked")
public MBeanServer registerMBeanServer()
{
MBeanServer mbeanServer = null;
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/ManagedFrameworkImpl.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -23,31 +23,18 @@
//$Id$
-import static org.jboss.osgi.spi.OSGiConstants.DOMAIN_NAME;
-import static org.jboss.osgi.spi.management.ManagedBundle.PROPERTY_ID;
-import static org.jboss.osgi.spi.management.ManagedBundle.PROPERTY_SYMBOLIC_NAME;
-import static org.jboss.osgi.spi.management.ManagedBundle.PROPERTY_VERSION;
-
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import javax.management.JMException;
import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.QueryExp;
import javax.management.StandardMBean;
import org.jboss.logging.Logger;
-import org.jboss.osgi.spi.management.ManagedBundle;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
import org.jboss.osgi.spi.management.ManagedServiceReference;
-import org.jboss.osgi.spi.management.ObjectNameFactory;
-import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
@@ -80,83 +67,13 @@
this.context = context;
this.mbeanServer = mbeanServer;
-
this.bundleTracker = new ManagedBundleTracker(context, mbeanServer);
}
- public BundleContext getBundleContext()
- {
- return context;
- }
-
- @SuppressWarnings("unchecked")
- public ObjectName getBundle(String symbolicName, String version)
- {
- ObjectName oname = null;
-
- String namestr = DOMAIN_NAME + ":" + PROPERTY_SYMBOLIC_NAME + "=" + symbolicName + "," + PROPERTY_VERSION + "=" + version + ",*";
- Set<ObjectName> names = mbeanServer.queryNames(ObjectNameFactory.create(namestr), null);
-
- if (names.size() > 0)
- {
- if (names.size() > 1)
- log.warn("Multiple bundles found: " + names);
-
- // Use the bundle with the highest id
- for (ObjectName aux : names)
- {
- if (oname == null)
- oname = aux;
-
- Integer bestId = new Integer(oname.getKeyProperty(PROPERTY_ID));
- Integer auxId = new Integer(aux.getKeyProperty(PROPERTY_ID));
- if (bestId < auxId)
- oname = aux;
- }
- }
-
- if (log.isTraceEnabled())
- log.trace("getBundle(" + symbolicName + "," + version + ") => " + oname);
-
- return oname;
- }
-
- @SuppressWarnings("unchecked")
- public ObjectName getBundle(long bundleId)
- {
- ObjectName oname = null;
-
- ObjectName pattern = ObjectNameFactory.create(DOMAIN_NAME + ":" + PROPERTY_ID + "=" + bundleId + ",*");
- Set<ObjectName> names = mbeanServer.queryNames(pattern, null);
-
- if (names.size() > 0)
- oname = names.iterator().next();
-
- if (log.isTraceEnabled())
- log.trace("getBundle(" + bundleId + ") => " + oname);
-
- return oname;
- }
-
- @SuppressWarnings("unchecked")
- public Set<ObjectName> getBundles()
- {
- // [JBAS-6571] JMX filtering does not work with wildcards
- // ObjectName pattern = ObjectNameFactory.create(Constants.DOMAIN_NAME + ":name=*,*");
- // Set<ObjectName> names = mbeanServer.queryNames(pattern, null);
-
- ObjectName pattern = ObjectNameFactory.create(DOMAIN_NAME + ":*");
- Set<ObjectName> names = mbeanServer.queryNames(pattern, new IsBundleQueryExp());
-
- if (log.isTraceEnabled())
- log.trace("getBundles() => " + names);
-
- return names;
- }
-
+ @Override
public ManagedServiceReference getServiceReference(String clazz)
{
- ServiceReference sref = getBundleContext().getServiceReference(clazz);
+ ServiceReference sref = context.getServiceReference(clazz);
if (sref == null)
return null;
@@ -173,6 +90,7 @@
return msref;
}
+ @Override
public ManagedServiceReference[] getServiceReferences(String clazz, String filter)
{
List<ManagedServiceReference> foundRefs = new ArrayList<ManagedServiceReference>();
@@ -180,7 +98,7 @@
ServiceReference[] srefs;
try
{
- srefs = getBundleContext().getServiceReferences(clazz, filter);
+ srefs = context.getServiceReferences(clazz, filter);
}
catch (InvalidSyntaxException e)
{
@@ -209,51 +127,30 @@
return msrefs;
}
- public void refreshPackages(ObjectName[] objectNames)
+ @Override
+ public void refreshAllPackages()
{
if (log.isTraceEnabled())
- log.trace("refreshPackages(" + (objectNames != null ? Arrays.asList(objectNames) : null) +")");
+ log.trace("refreshPackages(null)");
- Bundle[] bundleArr = getBundles(objectNames);
- ServiceReference sref = getBundleContext().getServiceReference(PackageAdmin.class.getName());
- PackageAdmin service = (PackageAdmin)getBundleContext().getService(sref);
- service.refreshPackages(bundleArr);
+ ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
+ PackageAdmin service = (PackageAdmin)context.getService(sref);
+ service.refreshPackages(null);
}
- public boolean resolveBundles(ObjectName[] objectNames)
+ @Override
+ public boolean resolveAllBundles()
{
if (log.isTraceEnabled())
- log.trace("resolveBundles(" + (objectNames != null ? Arrays.asList(objectNames) : null) +")");
+ log.trace("resolveBundles(null)");
- Bundle[] bundleArr = getBundles(objectNames);
- ServiceReference sref = getBundleContext().getServiceReference(PackageAdmin.class.getName());
- PackageAdmin service = (PackageAdmin)getBundleContext().getService(sref);
- return service.resolveBundles(bundleArr);
+ ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
+ PackageAdmin service = (PackageAdmin)context.getService(sref);
+ return service.resolveBundles(null);
}
- private Bundle[] getBundles(ObjectName[] objectNames)
+ void start()
{
- Bundle[] bundleArr = null;
- if (objectNames != null)
- {
- List<String> symbolicNames = new ArrayList<String>();
- for (ObjectName oname : objectNames)
- symbolicNames.add(oname.getKeyProperty(PROPERTY_SYMBOLIC_NAME));
-
- Set<Bundle> bundleSet = new HashSet<Bundle>();
- for (Bundle bundle : getBundleContext().getBundles())
- {
- if (symbolicNames.contains(bundle.getSymbolicName()))
- bundleSet.add(bundle);
- }
- bundleArr = new Bundle[bundleSet.size()];
- bundleSet.toArray(bundleArr);
- }
- return bundleArr;
- }
-
- public void start()
- {
// Start tracking the bundles
bundleTracker.open();
@@ -271,7 +168,7 @@
}
}
- public void stop()
+ void stop()
{
try
{
@@ -283,19 +180,4 @@
log.warn("Cannot register: " + ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
}
}
-
- // Accept names like "jboss.osgi:id=*"
- static class IsBundleQueryExp implements QueryExp
- {
- private static final long serialVersionUID = 1L;
-
- public boolean apply(ObjectName name)
- {
- return name.getKeyProperty(ManagedBundle.PROPERTY_SYMBOLIC_NAME) != null;
- }
-
- public void setMBeanServer(MBeanServer server)
- {
- }
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/jmx/trunk/src/main/java/org/jboss/osgi/jmx/internal/RMIAdaptor.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -130,13 +130,13 @@
return delegate.isRegistered(name);
}
- @SuppressWarnings({ "rawtypes" })
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public Set queryMBeans(ObjectName name, QueryExp query) throws IOException
{
return delegate.queryMBeans(name, query);
}
- @SuppressWarnings({ "rawtypes" })
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public Set queryNames(ObjectName name, QueryExp query) throws IOException
{
return delegate.queryNames(name, query);
Modified: projects/jboss-osgi/projects/bundles/jndi/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/jndi/trunk/.classpath 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/jndi/trunk/.classpath 2010-02-17 13:55:15 UTC (rev 101072)
@@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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"/>
</classpath>
Modified: projects/jboss-osgi/projects/bundles/jndi/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/bundles/jndi/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/jndi/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,5 +1,12 @@
-#Tue Apr 14 17:48:49 CEST 2009
+#Wed Feb 17 12:16:11 CET 2010
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
Modified: projects/jboss-osgi/projects/bundles/jndi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jndi/trunk/pom.xml 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/bundles/jndi/trunk/pom.xml 2010-02-17 13:55:15 UTC (rev 101072)
@@ -45,14 +45,13 @@
<artifactId>jboss-osgi-spi</artifactId>
<version>${version.jboss.osgi.spi}</version>
</dependency>
-
- <!-- Provided Dependencies -->
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-common</artifactId>
<version>${version.jboss.osgi.common}</version>
- <scope>provided</scope>
</dependency>
+
+ <!-- Provided Dependencies -->
<dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnpserver</artifactId>
@@ -93,14 +92,13 @@
javax.net,
org.jboss.logging,
org.jboss.net.sockets,
- org.jboss.osgi.common.log;version=1.0,
- org.jboss.osgi.spi.capability;version="1.0",
- org.jboss.osgi.spi.util;version="1.0",
org.jboss.util.naming,
- org.jboss.util.threadpool,
+ org.jboss.util.threadpool,
org.jnp.interfaces,
- org.osgi.framework,
- org.osgi.service.log,
+
+ org.jboss.osgi.common*;version="[1.0,2.0)",
+ org.jboss.osgi.spi*;version="[1.0,2.0)",
+ org.osgi.framework;version="[1.5,2.0)",
</Import-Package>
<Embed-Dependency>
jnpserver;inline=false,
Modified: projects/jboss-osgi/projects/runtime/deployment/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/runtime/deployment/trunk/.classpath 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/runtime/deployment/trunk/.classpath 2010-02-17 13:55:15 UTC (rev 101072)
@@ -3,7 +3,7 @@
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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"/>
</classpath>
Modified: projects/jboss-osgi/projects/runtime/deployment/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/runtime/deployment/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/runtime/deployment/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,6 +1,13 @@
-#Tue Nov 24 12:10:53 CET 2009
+#Wed Feb 17 12:15:07 CET 2010
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
Modified: projects/jboss-osgi/projects/runtime/deployment/trunk/src/test/java/org/jboss/test/osgi/deployment/simple/DeploymentSerializationTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/deployment/trunk/src/test/java/org/jboss/test/osgi/deployment/simple/DeploymentSerializationTestCase.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/runtime/deployment/trunk/src/test/java/org/jboss/test/osgi/deployment/simple/DeploymentSerializationTestCase.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -87,7 +87,7 @@
File file = new File("target/test-libs/simple-bundle.jar");
assertTrue("File exists: " + file, file.exists());
- BundleInfo info = BundleInfo.createBundleInfo(file.toURL());
+ BundleInfo info = BundleInfo.createBundleInfo(file.toURI().toURL());
return info;
}
}
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/.classpath 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/.classpath 2010-02-17 13:55:15 UTC (rev 101072)
@@ -3,7 +3,7 @@
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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"/>
</classpath>
Modified: projects/jboss-osgi/projects/runtime/felix/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/runtime/felix/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/runtime/felix/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,12 +1,12 @@
-#Tue Feb 17 14:10:44 CET 2009
+#Wed Feb 17 12:16:33 CET 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
Modified: projects/jboss-osgi/projects/spi/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/.classpath 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/.classpath 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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"/>
</classpath>
Modified: projects/jboss-osgi/projects/spi/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/.settings/org.eclipse.jdt.core.prefs 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,6 +1,13 @@
-#Fri Dec 11 16:24:04 CET 2009
+#Tue Feb 16 17:08:55 CET 2010
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/Capability.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/Capability.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/Capability.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -33,7 +33,7 @@
import org.osgi.framework.BundleException;
/**
- * An abstract OSGi capability that can be installed in an {@link OSGiRuntime}.
+ * An abstract OSGi capability that can be installed in an OSGiRuntime.
*
* The capability is only installed if the service name given in the constructor is not already registered with the OSGi framework.
*
@@ -54,7 +54,7 @@
/**
* Construct a capability that is identified by the given service name.
*
- * If the service name is already registered with the {@link OSGiRuntime} adding this capability
+ * If the service name is already registered with the OSGiRuntime adding this capability
* does nothing.
*
* If the service name is null the capability will install each associated bundle unless a bundle with the
@@ -70,7 +70,7 @@
/**
* Construct a capability that is identified by the given service name and filter string.
*
- * If the service is already registered with the {@link OSGiRuntime} adding this capability
+ * If the service is already registered with the OSGiRuntime adding this capability
* does nothing.
*/
public Capability(String serviceName, String filter)
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/ConfigAdminCapability.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/ConfigAdminCapability.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/ConfigAdminCapability.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -26,7 +26,7 @@
import org.osgi.service.cm.ConfigurationAdmin;
/**
- * Adds the OSGi compedium ConfigAdmin capability to the {@link OSGiRuntime}
+ * Adds the OSGi compedium ConfigAdmin capability to the OSGiRuntime
* under test.
*
* It is ignored if the {@link ConfigurationAdmin} is already registered.
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-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/HttpServiceCapability.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -26,7 +26,7 @@
import org.osgi.service.http.HttpService;
/**
- * Adds the {@link HttpService} capability to the {@link OSGiRuntime}
+ * Adds the {@link HttpService} capability to the OSGiRuntime
* under test.
*
* It is ignored if the {@link HttpService} is already registered.
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/LogServiceCapability.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/LogServiceCapability.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/LogServiceCapability.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -24,7 +24,7 @@
import org.osgi.service.log.LogService;
/**
- * Adds the OSGi compedium LogService capability to the {@link OSGiRuntime}
+ * Adds the OSGi compedium LogService capability to the OSGiRuntime
* under test.
*
* It is ignored if the {@link LogService} is already registered.
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/framework/PropertiesBootstrapProvider.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -368,7 +368,7 @@
File propsFile = new File(extraPropsValue);
try
{
- extraPropsURL = propsFile.toURL();
+ extraPropsURL = propsFile.toURI().toURL();
}
catch (MalformedURLException e)
{
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/internal/OSGiBootstrapBean.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/internal/OSGiBootstrapBean.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/internal/OSGiBootstrapBean.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -162,7 +162,7 @@
{
try
{
- return file.toURL();
+ return file.toURI().toURL();
}
catch (MalformedURLException e)
{
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxy.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxy.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxy.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.spi.management;
-
-// $Id$
-
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-
-/**
- * A simple MBeanProxy
- *
- * @author Thomas.Diesler at jboss.com
- * @since 24-Feb-2009
- */
-public class MBeanProxy
-{
- @SuppressWarnings({ "unchecked" })
- public static <T> T get(MBeanServerConnection server, ObjectName name, Class<T> interf) throws MBeanProxyException
- {
- return (T)MBeanServerInvocationHandler.newProxyInstance(server, name, interf, false);
- }
-}
Copied: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxy.java (from rev 101012, projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxy.java)
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxy.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxy.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.spi.management;
+
+// $Id$
+
+import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectName;
+
+/**
+ * A simple MBeanProxy
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @since 24-Feb-2009
+ */
+public class MBeanProxy
+{
+ public static <T> T get(MBeanServerConnection server, ObjectName name, Class<T> interf)
+ {
+ return (T)MBeanServerInvocationHandler.newProxyInstance(server, name, interf, false);
+ }
+}
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxyException.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxyException.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MBeanProxyException.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.spi.management;
-
-// $Id: $
-
-import javax.management.JMException;
-
-public class MBeanProxyException extends JMException
-{
- private static final long serialVersionUID = 2796580582557329145L;
-
- public MBeanProxyException()
- {
- }
-
- public MBeanProxyException(String msg)
- {
- super(msg);
- }
-}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -34,7 +34,6 @@
import javax.management.ObjectName;
import org.jboss.logging.Logger;
-import org.jboss.osgi.spi.util.ConstantsHelper;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -93,11 +92,13 @@
return ObjectNameFactory.create(oname);
}
+ @Override
public ObjectName getObjectName()
{
return oname;
}
+ @Override
public String getProperty(String key)
{
String value = bundle.getBundleContext().getProperty(key);
@@ -108,41 +109,13 @@
return value;
}
- public int getState()
- {
- int state = bundle.getState();
-
- if (log.isTraceEnabled())
- log.trace("getState[" + oname + "] => " + ConstantsHelper.bundleState(state));
-
- return state;
- }
-
- public long getBundleId()
- {
- return bundle.getBundleId();
- }
-
- public String getSymbolicName()
- {
- return bundle.getSymbolicName();
- }
-
- public String getLocation()
- {
- String location = bundle.getLocation();
-
- if (log.isTraceEnabled())
- log.trace("getLocation[" + oname + "] => " + location);
-
- return location;
- }
-
+ @Override
public Dictionary<String, String> getHeaders()
{
return getHeaders(null);
}
+ @Override
@SuppressWarnings("rawtypes")
public Dictionary<String, String> getHeaders(String locale)
{
@@ -162,6 +135,7 @@
return retHeaders;
}
+ @Override
public String getEntry(String path)
{
URL url = bundle.getEntry(path);
@@ -173,6 +147,7 @@
return entry;
}
+ @Override
public String getResource(String name)
{
URL url = bundle.getResource(name);
@@ -184,6 +159,7 @@
return resource;
}
+ @Override
public ObjectName loadClass(String name) throws ClassNotFoundException
{
Class<?> clazz = bundle.loadClass(name);
@@ -196,6 +172,7 @@
return oname;
}
+ @Override
public File getDataFile(String filename)
{
BundleContext context = bundle.getBundleContext();
@@ -207,22 +184,7 @@
return dataFile;
}
- public void start() throws BundleException
- {
- if (log.isTraceEnabled())
- log.trace("start[" + oname + "]");
-
- bundle.start();
- }
-
- public void stop() throws BundleException
- {
- if (log.isTraceEnabled())
- log.trace("stop[" + oname + "]");
-
- bundle.stop();
- }
-
+ @Override
public void update() throws BundleException
{
if (log.isTraceEnabled())
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -48,28 +48,6 @@
ObjectName getObjectName();
/**
- * Returns this bundle's current state. A bundle can be in only one state at any time.
- *
- * @return An element of UNINSTALLED,INSTALLED, RESOLVED,STARTING, STOPPING,ACTIVE.
- */
- int getState();
-
- /**
- * Returns this bundle's unique identifier.
- */
- long getBundleId();
-
- /**
- * Returns the symbolic name of this bundle as specified by its Bundle-SymbolicName manifest header
- */
- String getSymbolicName();
-
- /**
- * Returns the location of this bundle
- */
- String getLocation();
-
- /**
* Returns the bundle manifest headers
*/
Dictionary<String, String> getHeaders();
@@ -96,7 +74,7 @@
/**
* Returns a string encoded URL to the entry at the specified path in this bundle.
*
- * @param name The path name of the entry
+ * @param path The path name of the entry
* @return A URL to the entry, or null if no entry could be found
*/
String getEntry(String path);
@@ -114,16 +92,6 @@
File getDataFile(String filename);
/**
- * Starts this bundle with no options
- */
- void start() throws BundleException;
-
- /**
- * Stops this bundle with no options.
- */
- void stop() throws BundleException;
-
- /**
* Update this bundle.
*/
void update() throws BundleException;
Modified: 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-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -21,36 +21,21 @@
*/
package org.jboss.osgi.spi.management;
+
//$Id$
-import java.util.Set;
-import javax.management.ObjectName;
-
/**
* The managed view of an OSGi Framework
*
+ * Deprecated: Use FrameworkMBean
+ *
* @author thomas.diesler at jboss.com
* @since 04-Mar-2009
*/
public interface ManagedFramework
{
/**
- * Get the list of all installed bundles
- */
- Set<ObjectName> getBundles();
-
- /**
- * Get the installed bundle
- */
- ObjectName getBundle(String symbolicName, String version);
-
- /**
- * Get the installed bundle
- */
- ObjectName getBundle(long bundleId);
-
- /**
* Returns a ServiceReference object for a service that implements and was registered
* under the specified class.
*/
@@ -66,11 +51,17 @@
/**
* 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 refreshPackages(ObjectName[] bundles);
+ 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 resolveBundles(ObjectName[] bundles);
+ boolean resolveAllBundles();
}
\ No newline at end of file
Modified: 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-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -25,6 +25,7 @@
import javax.management.ObjectName;
+
/**
* The managed view of an OSGi Framework
*
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MicrocontainerServiceMBean.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MicrocontainerServiceMBean.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MicrocontainerServiceMBean.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,48 +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 java.util.List;
-
-import javax.management.ObjectName;
-
-
-/**
- * An OSGi Service the gives access to the Kernel and MBeanServer.
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public interface MicrocontainerServiceMBean
-{
- /**
- * The object name under which the MicrocontainerService is registered: 'jboss.osgi:service=MicrocontainerService'
- */
- ObjectName MBEAN_MICROCONTAINER_SERVICE = ObjectNameFactory.create("jboss.osgi:service=MicrocontainerService");
-
- /**
- * Get the list of registered beans.
- */
- List<String> getRegisteredBeans();
-}
\ No newline at end of file
Copied: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MicrocontainerServiceMBean.java (from rev 101012, projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MicrocontainerServiceMBean.java)
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MicrocontainerServiceMBean.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/MicrocontainerServiceMBean.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -0,0 +1,49 @@
+/*
+ * 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 java.util.List;
+
+import javax.management.ObjectName;
+
+
+
+/**
+ * An OSGi Service the gives access to the Kernel and MBeanServer.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public interface MicrocontainerServiceMBean
+{
+ /**
+ * The object name under which the MicrocontainerService is registered: 'jboss.osgi:service=MicrocontainerService'
+ */
+ ObjectName MBEAN_MICROCONTAINER_SERVICE = ObjectNameFactory.create("jboss.osgi:service=MicrocontainerService");
+
+ /**
+ * Get the list of registered beans.
+ */
+ List<String> listRegisteredBeans();
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ObjectNameFactory.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ObjectNameFactory.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ObjectNameFactory.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -1,74 +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 java.util.Hashtable;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-/**
- * A simple factory for creating safe object names.
- *
- * @author Thomas.Diesler at jboss.org
- * @since 08-May-2006
- */
-public class ObjectNameFactory
-{
- public static ObjectName create(String name)
- {
- try
- {
- return new ObjectName(name);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + name + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, String key, String value)
- {
- try
- {
- return new ObjectName(domain, key, value);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," + key + "," + value + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, Hashtable<String, String> table)
- {
- try
- {
- return new ObjectName(domain, table);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," + table + "; " + e);
- }
- }
-}
Copied: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ObjectNameFactory.java (from rev 101012, projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ObjectNameFactory.java)
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ObjectNameFactory.java (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ObjectNameFactory.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -0,0 +1,74 @@
+/*
+ * 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 java.util.Hashtable;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+/**
+ * A simple factory for creating safe object names.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-May-2006
+ */
+public class ObjectNameFactory
+{
+ public static ObjectName create(String name)
+ {
+ try
+ {
+ return new ObjectName(name);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + name + "; " + e);
+ }
+ }
+
+ public static ObjectName create(String domain, String key, String value)
+ {
+ try
+ {
+ return new ObjectName(domain, key, value);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + domain + "," + key + "," + value + "; " + e);
+ }
+ }
+
+ public static ObjectName create(String domain, Hashtable<String, String> table)
+ {
+ try
+ {
+ return new ObjectName(domain, table);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + domain + "," + table + "; " + e);
+ }
+ }
+}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -56,7 +56,7 @@
/**
* Get the list of registered beans.
*/
- List<String> getRegisteredBeans();
+ List<String> listRegisteredBeans();
/**
* Get a registered bean from the Kernel.
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2010-02-17 13:28:37 UTC (rev 101071)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/util/BundleInfo.java 2010-02-17 13:55:15 UTC (rev 101072)
@@ -66,7 +66,7 @@
URL url = getRealLocation(location);
if (url == null)
- throw new IllegalArgumentException("Cannot obtain root url from: " + location);
+ throw new IllegalArgumentException("Cannot obtain real location for: " + location);
return new BundleInfo(toVirtualFile(url), url.toExternalForm());
}
More information about the jboss-osgi-commits
mailing list