[jboss-cvs] JBossAS SVN: r94595 - in projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi: testing and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 9 08:48:59 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-10-09 08:48:58 -0400 (Fri, 09 Oct 2009)
New Revision: 94595
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/ManagedFrameworkMBean.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
Log:
Remove dependency in InvalidSyntaxException
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 2009-10-09 12:47:53 UTC (rev 94594)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFramework.java 2009-10-09 12:48:58 UTC (rev 94595)
@@ -138,10 +138,20 @@
return new ManagedServiceReference(props);
}
- public ManagedServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ public ManagedServiceReference[] getServiceReferences(String clazz, String filter)
{
List<ManagedServiceReference> foundRefs = new ArrayList<ManagedServiceReference>();
- ServiceReference[] srefs = getBundleContext().getServiceReferences(clazz, filter);
+
+ ServiceReference[] srefs;
+ try
+ {
+ srefs = getBundleContext().getServiceReferences(clazz, filter);
+ }
+ catch (InvalidSyntaxException e)
+ {
+ throw new IllegalArgumentException("Invalid filter syntax: " + filter);
+ }
+
if (srefs != null)
{
for (ServiceReference sref : srefs)
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 2009-10-09 12:47:53 UTC (rev 94594)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedFrameworkMBean.java 2009-10-09 12:48:58 UTC (rev 94595)
@@ -27,8 +27,6 @@
import javax.management.ObjectName;
-import org.osgi.framework.InvalidSyntaxException;
-
/**
* The managed view of an OSGi Framework
*
@@ -67,7 +65,7 @@
* that were registered under the specified class, match the specified filter criteria,
* and the packages for the class names under which the services were registered.
*/
- ManagedServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
+ ManagedServiceReference[] getServiceReferences(String clazz, String filter);
/**
* Refresh packages through the PackageAdmin service
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-10-09 12:47:53 UTC (rev 94594)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-10-09 12:48:58 UTC (rev 94595)
@@ -100,7 +100,7 @@
* The returned array of ServiceReference objects contains services that were registered under the specified
* class and match the specified filter criteria.
*/
- OSGiServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
+ OSGiServiceReference[] getServiceReferences(String clazz, String filter);
/**
* Get the initial naming context for this {@link OSGiRuntime}
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-10-09 12:47:53 UTC (rev 94594)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-10-09 12:48:58 UTC (rev 94595)
@@ -115,10 +115,20 @@
return (sref != null ? new EmbeddedServiceReference(sref) : null);
}
- public OSGiServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ public OSGiServiceReference[] getServiceReferences(String clazz, String filter)
{
OSGiServiceReference[] retRefs = null;
- ServiceReference[] srefs = getBundleContext().getServiceReferences(clazz, filter);
+
+ ServiceReference[] srefs;
+ try
+ {
+ srefs = getBundleContext().getServiceReferences(clazz, filter);
+ }
+ catch (InvalidSyntaxException e)
+ {
+ throw new IllegalArgumentException("Invalid filter syntax: " + filter);
+ }
+
if (srefs != null)
{
retRefs = new OSGiServiceReference[srefs.length];
@@ -129,7 +139,7 @@
}
@Override
- public void addCapability(Capability capability) throws BundleException, InvalidSyntaxException
+ public void addCapability(Capability capability) throws BundleException
{
// Copy the properties to the System props
Map<String, String> props = capability.getSystemProperties();
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-10-09 12:47:53 UTC (rev 94594)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-10-09 12:48:58 UTC (rev 94595)
@@ -49,7 +49,6 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.Version;
/**
@@ -77,7 +76,7 @@
return helper;
}
- public void addCapability(Capability capability) throws BundleException, InvalidSyntaxException
+ public void addCapability(Capability capability) throws BundleException
{
// Add dependent capabilies
for (Capability dependency : capability.getDependencies())
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java 2009-10-09 12:47:53 UTC (rev 94594)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java 2009-10-09 12:48:58 UTC (rev 94595)
@@ -27,7 +27,6 @@
import org.jboss.osgi.spi.management.ManagedBundleMBean;
import org.jboss.osgi.spi.management.ManagedServiceReference;
-import org.osgi.framework.InvalidSyntaxException;
/**
* The supported functionality of a remote OSGi Framework
@@ -64,5 +63,5 @@
* that were registered under the specified class, match the specified filter criteria,
* and the packages for the class names under which the services were registered.
*/
- ManagedServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
+ ManagedServiceReference[] getServiceReferences(String clazz, String filter);
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-10-09 12:47:53 UTC (rev 94594)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-10-09 12:48:58 UTC (rev 94595)
@@ -47,7 +47,6 @@
import org.jboss.osgi.spi.util.BundleDeployment;
import org.jboss.osgi.spi.util.BundleDeploymentFactory;
import org.osgi.framework.BundleException;
-import org.osgi.framework.InvalidSyntaxException;
/**
* A remote implementation of the {@link OSGiRuntime}
@@ -167,7 +166,7 @@
return manref != null ? new RemoteServiceReference(manref) : null;
}
- public OSGiServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ public OSGiServiceReference[] getServiceReferences(String clazz, String filter)
{
OSGiServiceReference[] srefs = null;
@@ -284,7 +283,7 @@
return managedFramework.getServiceReference(clazz);
}
- public ManagedServiceReference[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException
+ public ManagedServiceReference[] getServiceReferences(String clazz, String filter)
{
return managedFramework.getServiceReferences(clazz, filter);
}
More information about the jboss-cvs-commits
mailing list