JBoss-OSGI SVN: r89502 - in projects/jboss-osgi/trunk: husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context and 12 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 17:25:40 -0400 (Thu, 28 May 2009)
New Revision: 89502
Added:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java
Removed:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractPackageAdmin.java
Modified:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java
Log:
Rename AbstractBundle to OSGiBundle
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -28,7 +28,7 @@
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.annotation.ProvideContext;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.capability.BlueprintCapability;
@@ -55,7 +55,7 @@
public BundleContext context;
private OSGiRuntime runtime;
- private AbstractBundle bundle;
+ private OSGiBundle bundle;
@Before
public void setUp() throws Exception
Modified: projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -27,7 +27,7 @@
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.annotation.ProvideContext;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.testing.capability.HuskyCapability;
@@ -51,7 +51,7 @@
public BundleContext context;
private OSGiRuntime runtime;
- private AbstractBundle bundle;
+ private OSGiBundle bundle;
@Before
public void setUp() throws BundleException
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -1,53 +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.testing;
-
-import java.util.Dictionary;
-
-import org.osgi.framework.BundleException;
-
-/**
- * An OSGi Test Case
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public abstract class AbstractBundle
-{
- public abstract long getBundleId();
-
- public abstract String getSymbolicName();
-
- public abstract String getVersion();
-
- public abstract Dictionary<String, String> getHeaders();
-
- public abstract int getState();
-
- public abstract String getProperty(String key);
-
- public abstract void start() throws BundleException;
-
- public abstract void stop() throws BundleException;
-
- public abstract void uninstall() throws BundleException;
-}
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractPackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractPackageAdmin.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractPackageAdmin.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -1,34 +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.testing;
-
-
-/**
- * [TODO]
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public abstract class AbstractPackageAdmin
-{
- public abstract void refreshPackages(AbstractBundle[] bundles);
-}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java (from rev 89501, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiBundle.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -0,0 +1,53 @@
+/*
+ * 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.testing;
+
+import java.util.Dictionary;
+
+import org.osgi.framework.BundleException;
+
+/**
+ * An OSGi Test Case
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public abstract class OSGiBundle
+{
+ public abstract long getBundleId();
+
+ public abstract String getSymbolicName();
+
+ public abstract String getVersion();
+
+ public abstract Dictionary<String, String> getHeaders();
+
+ public abstract int getState();
+
+ public abstract String getProperty(String key);
+
+ public abstract void start() throws BundleException;
+
+ public abstract void stop() throws BundleException;
+
+ public abstract void uninstall() throws BundleException;
+}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractPackageAdmin.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiPackageAdmin.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -0,0 +1,34 @@
+/*
+ * 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.testing;
+
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public abstract class OSGiPackageAdmin
+{
+ public abstract void refreshPackages(OSGiBundle[] bundles);
+}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -47,13 +47,13 @@
void stopLogEntryTracking();
- AbstractBundle installBundle(String location) throws BundleException;
+ OSGiBundle installBundle(String location) throws BundleException;
- AbstractBundle[] getBundles();
+ OSGiBundle[] getBundles();
- AbstractBundle getBundle(String symbolicName, String version);
+ OSGiBundle getBundle(String symbolicName, String version);
- AbstractPackageAdmin getPackageAdmin();
+ OSGiPackageAdmin getPackageAdmin();
InitialContext getInitialContext() throws NamingException;
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -24,7 +24,7 @@
import java.util.Dictionary;
import org.jboss.osgi.spi.logging.ExportedPackageHelper;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
@@ -35,7 +35,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
-public class EmbeddedBundle extends AbstractBundle
+public class EmbeddedBundle extends OSGiBundle
{
private Bundle bundle;
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -21,8 +21,8 @@
*/
package org.jboss.osgi.spi.testing.internal;
-import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.AbstractPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
import org.osgi.framework.Bundle;
import org.osgi.service.packageadmin.PackageAdmin;
@@ -32,7 +32,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
-public class EmbeddedPackageAdmin extends AbstractPackageAdmin
+public class EmbeddedPackageAdmin extends OSGiPackageAdmin
{
private PackageAdmin packAdmin;
@@ -42,7 +42,7 @@
}
@Override
- public void refreshPackages(AbstractBundle[] bundles)
+ public void refreshPackages(OSGiBundle[] bundles)
{
Bundle[] bundleArr = null;
if (bundles != null)
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -36,8 +36,8 @@
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.AbstractPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.testing.capability.Capability;
import org.osgi.framework.Bundle;
@@ -61,21 +61,21 @@
super(helper);
}
- public AbstractBundle installBundle(String location) throws BundleException
+ public OSGiBundle installBundle(String location) throws BundleException
{
URL bundleURL = getTestHelper().getTestArchiveURL(location);
Bundle bundle = getBundleContext().installBundle(bundleURL.toExternalForm());
return new EmbeddedBundle(bundle);
}
- public AbstractBundle[] getBundles()
+ public OSGiBundle[] getBundles()
{
- List<AbstractBundle> absBundles = new ArrayList<AbstractBundle>();
+ List<OSGiBundle> absBundles = new ArrayList<OSGiBundle>();
for (Bundle bundle : getBundleContext().getBundles())
{
absBundles.add(new EmbeddedBundle(bundle));
}
- AbstractBundle[] bundleArr = new AbstractBundle[absBundles.size()];
+ OSGiBundle[] bundleArr = new OSGiBundle[absBundles.size()];
absBundles.toArray(bundleArr);
return bundleArr;
}
@@ -147,7 +147,7 @@
return server;
}
- public AbstractPackageAdmin getPackageAdmin()
+ public OSGiPackageAdmin getPackageAdmin()
{
BundleContext context = getBundleContext();
ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -36,7 +36,7 @@
import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.testing.capability.Capability;
@@ -55,7 +55,7 @@
final Logger log = Logger.getLogger(OSGiRuntimeImpl.class);
private OSGiTestHelper helper;
- private Map<String, AbstractBundle> bundles = new HashMap<String, AbstractBundle>();
+ private Map<String, OSGiBundle> bundles = new HashMap<String, OSGiBundle>();
private List<Capability> capabilities = new ArrayList<Capability>();
private LogReaderService logReaderService;
@@ -89,7 +89,7 @@
{
if (bundles.get(location) == null)
{
- AbstractBundle bundle = installBundle(location);
+ OSGiBundle bundle = installBundle(location);
bundle.start();
bundles.put(location, bundle);
@@ -109,7 +109,7 @@
for (String location : bundleLocations)
{
- AbstractBundle bundle = bundles.remove(location);
+ OSGiBundle bundle = bundles.remove(location);
if (bundle != null)
{
try
@@ -187,10 +187,10 @@
return helper.getServerHost();
}
- public AbstractBundle getBundle(String symbolicName, String version)
+ public OSGiBundle getBundle(String symbolicName, String version)
{
- AbstractBundle bundle = null;
- for (AbstractBundle aux : getBundles())
+ OSGiBundle bundle = null;
+ for (OSGiBundle aux : getBundles())
{
if (aux.getSymbolicName().equals(symbolicName))
{
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -25,7 +25,7 @@
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
@@ -35,7 +35,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
-public class RemoteBundle extends AbstractBundle
+public class RemoteBundle extends OSGiBundle
{
// Provide logging
private static final Logger log = Logger.getLogger(RemoteBundle.class);
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -23,8 +23,8 @@
import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
-import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.AbstractPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
/**
* [TODO]
@@ -32,7 +32,7 @@
* @author Thomas.Diesler(a)jboss.org
* @since 25-Sep-2008
*/
-public class RemotePackageAdmin extends AbstractPackageAdmin
+public class RemotePackageAdmin extends OSGiPackageAdmin
{
private RemoteRuntime runtime;
@@ -42,7 +42,7 @@
}
@Override
- public void refreshPackages(AbstractBundle[] bundles)
+ public void refreshPackages(OSGiBundle[] bundles)
{
String[] bundleArr = null;
if (bundles != null)
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -42,8 +42,8 @@
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.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.AbstractPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.jboss.osgi.spi.testing.capability.Capability;
import org.jboss.osgi.spi.testing.capability.ConfigAdminCapability;
@@ -87,7 +87,7 @@
ignoredCaps.add(MicrocontainerCapability.class);
}
- public AbstractBundle installBundle(String location) throws BundleException
+ public OSGiBundle installBundle(String location) throws BundleException
{
String symbolicName = null;
try
@@ -130,16 +130,16 @@
super.addCapability(capability);
}
- public AbstractBundle[] getBundles()
+ public OSGiBundle[] getBundles()
{
try
{
Set<ManagedBundleMBean> remoteBundles = getRemoteFramework().getBundles();
- Set<AbstractBundle> bundles = new HashSet<AbstractBundle>();
+ Set<OSGiBundle> bundles = new HashSet<OSGiBundle>();
for (ManagedBundleMBean remoteBundle : remoteBundles)
bundles.add(new RemoteBundle(this, remoteBundle, null));
- AbstractBundle[] bundleArr = new AbstractBundle[bundles.size()];
+ OSGiBundle[] bundleArr = new OSGiBundle[bundles.size()];
bundles.toArray(bundleArr);
return bundleArr;
@@ -218,7 +218,7 @@
return mbeanServer;
}
- public AbstractPackageAdmin getPackageAdmin()
+ public OSGiPackageAdmin getPackageAdmin()
{
return new RemotePackageAdmin(this);
}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -29,7 +29,7 @@
import java.io.InputStreamReader;
import java.net.URL;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
@@ -48,7 +48,7 @@
public class HttpServiceTestCase extends OSGiTest
{
private static OSGiRuntime runtime;
- private static AbstractBundle testBundle;
+ private static OSGiBundle testBundle;
@BeforeClass
public static void setUpClass() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -30,7 +30,7 @@
import javax.naming.InitialContext;
import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
@@ -50,7 +50,7 @@
public class JMXTestCase extends OSGiTest
{
private static OSGiRuntime runtime;
- private static AbstractBundle bundle;
+ private static OSGiBundle bundle;
@BeforeClass
public static void setUpClass() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -29,7 +29,7 @@
import javax.naming.InitialContext;
import javax.naming.NameNotFoundException;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
@@ -65,7 +65,7 @@
@Test
public void testJNDIAccess() throws Exception
{
- AbstractBundle bundle = runtime.installBundle("example-jndi.jar");
+ OSGiBundle bundle = runtime.installBundle("example-jndi.jar");
bundle.start();
assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -29,7 +29,7 @@
import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.logging.LogEntryFilter;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
@@ -71,7 +71,7 @@
public void testLogEntryFilter() throws Exception
{
// Install and start the test bundle
- AbstractBundle bundleA = runtime.installBundle("example-log.jar");
+ OSGiBundle bundleA = runtime.installBundle("example-log.jar");
bundleA.start();
// Verify that the bundle is active
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -27,7 +27,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.capability.JAXBCapability;
@@ -53,7 +53,7 @@
OSGiRuntime runtime = getEmbeddedRuntime();
try
{
- AbstractBundle bundle = runtime.getBundle("jboss-osgi-apache-xerces", null);
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-apache-xerces", null);
assertNull("Test bundle null", bundle);
runtime.addCapability(new XMLParserCapability());
@@ -73,7 +73,7 @@
OSGiRuntime runtime = getEmbeddedRuntime();
try
{
- AbstractBundle bundle = runtime.getBundle("jboss-osgi-jaxb", null);
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-jaxb", null);
assertNull("Test bundle null", bundle);
runtime.addCapability(new JAXBCapability());
@@ -93,7 +93,7 @@
OSGiRuntime runtime = getEmbeddedRuntime();
try
{
- AbstractBundle bundle = runtime.getBundle("jboss-osgi-xml-binding", null);
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-xml-binding", null);
assertNull("Test bundle null", bundle);
runtime.addCapability(new XMLBindingCapability());
@@ -113,7 +113,7 @@
OSGiRuntime runtime = getEmbeddedRuntime();
try
{
- AbstractBundle bundle = runtime.getBundle("jboss-osgi-jndi", null);
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-jndi", null);
assertNull("Test bundle null", bundle);
runtime.addCapability(new JNDICapability());
@@ -133,7 +133,7 @@
OSGiRuntime runtime = getEmbeddedRuntime();
try
{
- AbstractBundle bundle = runtime.getBundle("jboss-osgi-jmx", null);
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-jmx", null);
assertNull("Test bundle null", bundle);
runtime.addCapability(new JMXCapability());
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -28,7 +28,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
@@ -50,13 +50,13 @@
OSGiRuntime runtime = getDefaultRuntime();
try
{
- AbstractBundle bundleA = runtime.installBundle("jbosgi37-bundleA.jar");
+ OSGiBundle bundleA = runtime.installBundle("jbosgi37-bundleA.jar");
bundleA.start();
assertEquals("Bundle started", Bundle.ACTIVE, bundleA.getState());
List<String> relevant = new ArrayList<String>();
- for (AbstractBundle bundle : runtime.getBundles())
+ for (OSGiBundle bundle : runtime.getBundles())
{
String symbolicName = bundle.getSymbolicName();
if (symbolicName.startsWith("jbosgi37"))
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -26,7 +26,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
@@ -57,7 +57,7 @@
OSGiRuntime runtime = getEmbeddedRuntime();
try
{
- AbstractBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
+ OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
bundleX.start();
@@ -80,10 +80,10 @@
OSGiRuntime runtime = getEmbeddedRuntime();
try
{
- AbstractBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
+ OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
- AbstractBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
+ OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
bundleB.start();
@@ -107,13 +107,13 @@
OSGiRuntime runtime = getEmbeddedRuntime();
try
{
- AbstractBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
+ OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
- AbstractBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
+ OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
- AbstractBundle bundleA = runtime.installBundle("jbosgi38-bundleA.jar");
+ OSGiBundle bundleA = runtime.installBundle("jbosgi38-bundleA.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
bundleA.start();
@@ -138,7 +138,7 @@
OSGiRuntime runtime = getEmbeddedRuntime();
try
{
- AbstractBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
+ OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
try
@@ -151,7 +151,7 @@
// expected
}
- AbstractBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
+ OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
bundleB.start();
@@ -175,10 +175,10 @@
OSGiRuntime runtime = getEmbeddedRuntime();
try
{
- AbstractBundle bundleA = runtime.installBundle("jbosgi38-bundleA.jar");
+ OSGiBundle bundleA = runtime.installBundle("jbosgi38-bundleA.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
- AbstractBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
+ OSGiBundle bundleB = runtime.installBundle("jbosgi38-bundleB.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
try
@@ -191,7 +191,7 @@
// expected
}
- AbstractBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
+ OSGiBundle bundleX = runtime.installBundle("jbosgi38-bundleX.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
bundleB.start();
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -27,8 +27,8 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.AbstractPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiPackageAdmin;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
@@ -55,7 +55,7 @@
OSGiRuntime runtime = getDefaultRuntime();
try
{
- AbstractBundle bundleB = runtime.installBundle("jbosgi39-bundleB.jar");
+ OSGiBundle bundleB = runtime.installBundle("jbosgi39-bundleB.jar");
assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
try
@@ -68,7 +68,7 @@
// expected
}
- AbstractBundle bundleX = runtime.installBundle("jbosgi39-bundleX.jar");
+ OSGiBundle bundleX = runtime.installBundle("jbosgi39-bundleX.jar");
bundleB.start();
@@ -101,8 +101,8 @@
OSGiRuntime runtime = getDefaultRuntime();
try
{
- AbstractBundle bundleX = runtime.installBundle("jbosgi39-bundleX.jar");
- AbstractBundle bundleB = runtime.installBundle("jbosgi39-bundleB.jar");
+ OSGiBundle bundleX = runtime.installBundle("jbosgi39-bundleX.jar");
+ OSGiBundle bundleB = runtime.installBundle("jbosgi39-bundleB.jar");
bundleB.start();
@@ -134,8 +134,8 @@
OSGiRuntime runtime = getDefaultRuntime();
try
{
- AbstractBundle bundleX = runtime.installBundle("jbosgi39-bundleX.jar");
- AbstractBundle bundleB = runtime.installBundle("jbosgi39-bundleB.jar");
+ OSGiBundle bundleX = runtime.installBundle("jbosgi39-bundleX.jar");
+ OSGiBundle bundleB = runtime.installBundle("jbosgi39-bundleB.jar");
bundleB.start();
@@ -147,7 +147,7 @@
bundleB.uninstall();
// Forces the update (replacement) or removal of packages exported by the specified bundles.
- AbstractPackageAdmin packAdmin = runtime.getPackageAdmin();
+ OSGiPackageAdmin packAdmin = runtime.getPackageAdmin();
packAdmin.refreshPackages(null);
// Install B without X
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -31,7 +31,7 @@
import java.io.File;
import java.io.FileReader;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.capability.ConfigAdminCapability;
@@ -56,7 +56,7 @@
{
runtime.addCapability(new ConfigAdminCapability());
- AbstractBundle bundleA = runtime.installBundle("jbosgi41-bundleA.jar");
+ OSGiBundle bundleA = runtime.installBundle("jbosgi41-bundleA.jar");
bundleA.start();
assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
@@ -75,7 +75,7 @@
}
}
- private File getBundleDataFile(AbstractBundle bundleA, String filename)
+ private File getBundleDataFile(OSGiBundle bundleA, String filename)
{
String storageRoot = bundleA.getProperty("org.osgi.framework.storage");
assertNotNull("Storage dir not null", storageRoot);
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelTestCase.java 2009-05-28 21:25:40 UTC (rev 89502)
@@ -25,7 +25,7 @@
import static org.junit.Assert.assertEquals;
-import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiBundle;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.junit.Test;
@@ -45,7 +45,7 @@
OSGiRuntime runtime = getDefaultRuntime();
try
{
- AbstractBundle bundle = runtime.installBundle("service/service-startlevel.jar");
+ OSGiBundle bundle = runtime.installBundle("service/service-startlevel.jar");
bundle.start();
assertEquals("Bundle active", Bundle.ACTIVE, bundle.getState());
17 years, 1 month
JBoss-OSGI SVN: r89501 - in projects/jboss-osgi/trunk: blueprint/testsuite/src/test/resources and 22 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 17:21:07 -0400 (Thu, 28 May 2009)
New Revision: 89501
Added:
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/BlueprintCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/Capability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/ConfigAdminCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/HttpCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/HuskyCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JAXBCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JMXCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JNDICapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/MicrocontainerCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/RemoteLogCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/XMLBindingCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/XMLParserCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFrameworkException.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java
Removed:
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteFramework.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteFrameworkException.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/ConfigAdminCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedPackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteBundleBadName.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemotePackageAdmin.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/
Modified:
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/husky/testsuite/pom.xml
projects/jboss-osgi/trunk/husky/testsuite/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/context/context-basic.bnd
projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/JMXServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNDIServiceTestCase.java
Log:
Restructure testing SPI
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -29,12 +29,12 @@
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.annotation.ProvideContext;
import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.BlueprintCapability;
-import org.jboss.osgi.spi.testing.HuskyCapability;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.MicrocontainerCapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.capability.BlueprintCapability;
+import org.jboss.osgi.spi.testing.capability.HuskyCapability;
+import org.jboss.osgi.spi.testing.capability.JMXCapability;
+import org.jboss.osgi.spi.testing.capability.MicrocontainerCapability;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-05-28 21:21:07 UTC (rev 89501)
@@ -8,6 +8,7 @@
org.jboss.osgi.husky, \
org.jboss.osgi.husky.annotation, \
org.jboss.osgi.spi.testing, \
+ org.jboss.osgi.spi.testing.capability, \
org.junit, \
org.osgi.framework, \
org.osgi.service.blueprint.*
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-05-28 21:21:07 UTC (rev 89501)
@@ -20,6 +20,7 @@
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.testing;version=1.0, \
+ org.jboss.osgi.spi.testing.capability;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
Deleted: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-equinox.properties 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,78 +0,0 @@
-#
-# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
-#
-# $Id$
-#
-
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.equinox.framework.EquinoxIntegration
-
-# Properties to configure the Framework
-org.osgi.framework.storage=${osgi.home}/data/osgi-store
-org.osgi.framework.storage.clean=onFirstInit
-
-# HTTP Service Port
-org.osgi.service.http.port=8090
-
-# Config Admin Service
-felix.cm.dir=${osgi.home}/data/osgi-configadmin
-
-# JMX bundle properties
-org.jboss.osgi.jmx.host=${jboss.bind.address}
-org.jboss.osgi.jmx.rmi.port=1098
-
-# JNDI bundle properties
-org.jboss.osgi.jndi.host=${jboss.bind.address}
-org.jboss.osgi.jndi.rmi.port=1098
-org.jboss.osgi.jndi.port=1099
-
-# Remote Logging
-org.jboss.osgi.service.remote.log.sender=true
-org.jboss.osgi.service.remote.log.host=${jboss.bind.address}
-org.jboss.osgi.service.remote.log.port=5400
-
-# Extra System Packages
-org.osgi.framework.system.packages.extra=\
- org.jboss.logging, \
- org.jboss.net.protocol, \
- org.jboss.osgi.spi, \
- org.jboss.osgi.spi.logging, \
- org.jboss.osgi.spi.management, \
- org.jboss.virtual, \
- org.jboss.virtual.plugins.registry, \
- org.jboss.virtual.plugins.context.jar, \
- org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol, \
- org.apache.log4j, \
- org.jboss.util, \
- org.jboss.util.id, \
- org.jboss.util.threadpool, \
- org.jboss.util.propertyeditor
-
-# These are needed by jboss-remoting
-# org.apache.log4j, \
-# org.jboss.util, \
-# org.jboss.util.id, \
-# org.jboss.util.threadpool, \
-# org.jboss.util.propertyeditor
-
-# Bundles that need to be installed with the Framework automatically
-org.jboss.osgi.spi.framework.autoInstall=\
- file://${osgi.home}/bundles/org.eclipse.osgi.services.jar
-
-# Bundles that need to be started automatically
-org.jboss.osgi.spi.framework.autoStart=\
- file://${osgi.home}/bundles/org.apache.felix.log.jar \
- file://${osgi.home}/bundles/jboss-osgi-apache-xerces.jar \
- file://${osgi.home}/bundles/jboss-osgi-common-core.jar \
- file://${osgi.home}/bundles/jboss-osgi-jaxb.jar \
- file://${osgi.home}/bundles/jboss-osgi-xml-binding.jar \
- file://${osgi.home}/bundles/jboss-osgi-common.jar \
- file://${osgi.home}/bundles/jboss-osgi-logging.jar \
- file://${osgi.home}/bundles/jboss-osgi-jndi.jar \
- file://${osgi.home}/bundles/jboss-osgi-jmx.jar \
- file://${osgi.home}/bundles/jboss-osgi-microcontainer.jar \
- file://${osgi.home}/bundles/org.apache.felix.metatype.jar \
- file://${osgi.home}/bundles/org.apache.felix.configadmin.jar \
- file://${osgi.home}/bundles/org.apache.felix.http.jetty.jar \
- file://${osgi.home}/bundles/jboss-osgi-webconsole.jar
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-28 21:21:07 UTC (rev 89501)
@@ -46,6 +46,7 @@
org.jboss.osgi.spi.logging;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.testing;version=1.0, \
+ org.jboss.osgi.spi.testing.capability;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
Deleted: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-knopflerfish.properties 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,78 +0,0 @@
-#
-# Properties read by the org.jboss.osgi.spi.framework.PropertiesBootstrapProvider
-#
-# $Id$
-#
-
-# The OSGiFramework implementation
-org.jboss.osgi.spi.framework.impl=org.jboss.osgi.knopflerfish.framework.KnopflerfishIntegration
-
-# Properties to configure the Framework
-org.osgi.framework.storage=${osgi.home}/data/osgi-store
-org.osgi.framework.storage.clean=onFirstInit
-
-# HTTP Service Port
-org.osgi.service.http.port=8090
-
-# Config Admin Service
-felix.cm.dir=${osgi.home}/data/osgi-configadmin
-
-# JMX bundle properties
-org.jboss.osgi.jmx.host=${jboss.bind.address}
-org.jboss.osgi.jmx.rmi.port=1098
-
-# JNDI bundle properties
-org.jboss.osgi.jndi.host=${jboss.bind.address}
-org.jboss.osgi.jndi.rmi.port=1098
-org.jboss.osgi.jndi.port=1099
-
-# Remote Logging
-org.jboss.osgi.service.remote.log.sender=true
-org.jboss.osgi.service.remote.log.host=${jboss.bind.address}
-org.jboss.osgi.service.remote.log.port=5400
-
-# Extra System Packages
-org.osgi.framework.system.packages.extra=\
- org.jboss.logging, \
- org.jboss.net.protocol, \
- org.jboss.osgi.spi, \
- org.jboss.osgi.spi.logging, \
- org.jboss.osgi.spi.management, \
- org.jboss.virtual, \
- org.jboss.virtual.plugins.registry, \
- org.jboss.virtual.plugins.context.jar, \
- org.jboss.virtual.plugins.vfs.helpers, \
- org.jboss.virtual.protocol, \
- org.apache.log4j, \
- org.jboss.util, \
- org.jboss.util.id, \
- org.jboss.util.threadpool, \
- org.jboss.util.propertyeditor
-
-# These are needed by jboss-remoting
-# org.apache.log4j, \
-# org.jboss.util, \
-# org.jboss.util.id, \
-# org.jboss.util.threadpool, \
-# org.jboss.util.propertyeditor
-
-# Bundles that need to be installed with the Framework automatically
-org.jboss.osgi.spi.framework.autoInstall=\
- file://${osgi.home}/bundles/org.osgi.compendium.jar
-
-# Bundles that need to be started automatically
-org.jboss.osgi.spi.framework.autoStart=\
- file://${osgi.home}/bundles/org.apache.felix.log.jar \
- file://${osgi.home}/bundles/jboss-osgi-apache-xerces.jar \
- file://${osgi.home}/bundles/jboss-osgi-common-core.jar \
- file://${osgi.home}/bundles/jboss-osgi-jaxb.jar \
- file://${osgi.home}/bundles/jboss-osgi-xml-binding.jar \
- file://${osgi.home}/bundles/jboss-osgi-common.jar \
- file://${osgi.home}/bundles/jboss-osgi-logging.jar \
- file://${osgi.home}/bundles/jboss-osgi-jndi.jar \
- file://${osgi.home}/bundles/jboss-osgi-jmx.jar \
- file://${osgi.home}/bundles/jboss-osgi-microcontainer.jar \
- file://${osgi.home}/bundles/org.apache.felix.metatype.jar \
- file://${osgi.home}/bundles/org.apache.felix.configadmin.jar \
- file://${osgi.home}/bundles/org.apache.felix.http.jetty.jar \
- file://${osgi.home}/bundles/jboss-osgi-webconsole.jar
Modified: projects/jboss-osgi/trunk/husky/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/pom.xml 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/husky/testsuite/pom.xml 2009-05-28 21:21:07 UTC (rev 89501)
@@ -59,6 +59,11 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-husky</artifactId>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/husky/testsuite/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/scripts/assembly-bundles.xml 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/husky/testsuite/scripts/assembly-bundles.xml 2009-05-28 21:21:07 UTC (rev 89501)
@@ -16,6 +16,7 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:jboss-osgi-common:jar</include>
+ <include>*:jboss-osgi-common-core:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-husky:jar</include>
<include>*:org.apache.felix.log:jar</include>
Modified: projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/husky/testsuite/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -28,10 +28,10 @@
import org.jboss.osgi.husky.BridgeFactory;
import org.jboss.osgi.husky.annotation.ProvideContext;
import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.HuskyCapability;
-import org.jboss.osgi.spi.testing.JMXCapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.testing.capability.HuskyCapability;
+import org.jboss.osgi.spi.testing.capability.JMXCapability;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Modified: projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/context/context-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/context/context-basic.bnd 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/context/context-basic.bnd 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,7 +1,15 @@
# bnd build -classpath target/test-classes -output target/test-libs/context-basic.jar src/test/resources/context/context-basic.bnd
Bundle-SymbolicName: context-basic
+
Export-Package: org.jboss.test.osgi.husky.context
-Import-Package: org.jboss.osgi.husky, org.jboss.osgi.husky.annotation, org.jboss.osgi.spi.testing, org.junit, org.osgi.framework
+Import-Package: \
+ org.jboss.osgi.husky, \
+ org.jboss.osgi.husky.annotation, \
+ org.jboss.osgi.spi.testing, \
+ org.jboss.osgi.spi.testing.capability, \
+ org.junit, \
+ org.osgi.framework
+
Test-Package: org.jboss.test.osgi.husky.context
Modified: projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-05-28 21:21:07 UTC (rev 89501)
@@ -23,6 +23,7 @@
org.jboss.logging, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.testing;version=1.0, \
+ org.jboss.osgi.spi.testing.capability;version=1.0, \
org.osgi.framework;version=1.4
# Bundles that need to be installed with the Framework automatically
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteBundle.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteBundle.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,68 +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.framework;
-
-//$Id$
-
-import org.osgi.framework.BundleException;
-
-/**
- * The supported functionality of a remote OSGi Bundle.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 04-Mar-2009
- */
-public interface RemoteBundle
-{
- /**
- * 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 value of the specified property from the BundleContext.
- */
- String getProperty(String key);
-
- /**
- * Starts this bundle with no options
- */
- void start() throws BundleException;
-
- /**
- * Stops this bundle with no options.
- */
- void stop() throws BundleException;
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteFramework.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteFramework.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteFramework.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,45 +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.framework;
-
-//$Id$
-
-import java.util.Set;
-
-/**
- * The supported functionality of a remote OSGi Framework
- *
- * @author thomas.diesler(a)jboss.com
- * @since 04-Mar-2009
- */
-public interface RemoteFramework
-{
- /**
- * Get the list of all installed bundles
- */
- Set<RemoteBundle> getBundles();
-
- /**
- * Get the installed bundle
- */
- RemoteBundle getBundle(String symbolicName);
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteFrameworkException.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteFrameworkException.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteFrameworkException.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.framework;
-
-// $Id$
-
-/**
- * A remote OSGi Framework exception that should be thrown on unrecoverable errors.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jan-2009
- */
-@SuppressWarnings("serial")
-public class RemoteFrameworkException extends RuntimeException
-{
- public RemoteFrameworkException(String message)
- {
- super(message);
- }
-
- public RemoteFrameworkException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public RemoteFrameworkException(Throwable cause)
- {
- super(cause);
- }
-}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -23,6 +23,8 @@
//$Id$
+import java.util.Dictionary;
+
import javax.management.ObjectName;
import org.jboss.osgi.spi.Constants;
@@ -71,6 +73,12 @@
return bundle.getSymbolicName();
}
+ @SuppressWarnings("unchecked")
+ public Dictionary<String, String> getHeaders()
+ {
+ return bundle.getHeaders();
+ }
+
public void start() throws BundleException
{
bundle.start();
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -23,9 +23,11 @@
//$Id$
+import java.util.Dictionary;
+
import javax.management.ObjectName;
-import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.osgi.framework.BundleException;
/**
* The managed view of an OSGi Bundle.
@@ -37,10 +39,47 @@
* @author thomas.diesler(a)jboss.com
* @since 04-Mar-2009
*/
-public interface ManagedBundleMBean extends RemoteBundle
+public interface ManagedBundleMBean
{
/**
* Get the bundles object name.
*/
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 bundle manifest headers
+ */
+ Dictionary<String, String> getHeaders();
+
+ /**
+ * Returns the value of the specified property from the BundleContext.
+ */
+ String getProperty(String key);
+
+ /**
+ * Starts this bundle with no options
+ */
+ void start() throws BundleException;
+
+ /**
+ * Stops this bundle with no options.
+ */
+ void stop() throws BundleException;
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/AbstractBundle.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -21,6 +21,8 @@
*/
package org.jboss.osgi.spi.testing;
+import java.util.Dictionary;
+
import org.osgi.framework.BundleException;
/**
@@ -35,6 +37,10 @@
public abstract String getSymbolicName();
+ public abstract String getVersion();
+
+ public abstract Dictionary<String, String> getHeaders();
+
public abstract int getState();
public abstract String getProperty(String key);
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.spi.testing;
-
-//$Id$
-
-
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class BlueprintCapability extends Capability
-{
- public BlueprintCapability()
- {
- addBundle("bundles/jboss-osgi-blueprint.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,59 +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.testing;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public abstract class Capability
-{
- private Properties props = new Properties();
- private List<String> bundles = new ArrayList<String>();
-
- public Capability()
- {
- }
-
- public Properties getProperties()
- {
- return props;
- }
-
- protected void addBundle(String bundle)
- {
- bundles.add(bundle);
- }
-
- public List<String> getBundles()
- {
- return new ArrayList<String>(bundles);
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/ConfigAdminCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/ConfigAdminCapability.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/ConfigAdminCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,39 +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.testing;
-
-//$Id$
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class ConfigAdminCapability extends Capability
-{
- public ConfigAdminCapability()
- {
- addBundle("bundles/org.apache.felix.metatype.jar");
- addBundle("bundles/org.apache.felix.configadmin.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,92 +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.testing;
-
-import org.jboss.osgi.spi.logging.ExportedPackageHelper;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-/**
- * An OSGi Test Case
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class EmbeddedBundle extends AbstractBundle
-{
- private Bundle bundle;
-
- public EmbeddedBundle(Bundle bundle)
- {
- this.bundle = bundle;
- }
-
- public Bundle getBundle()
- {
- return bundle;
- }
-
- @Override
- public int getState()
- {
- return bundle.getState();
- }
-
- @Override
- public String getSymbolicName()
- {
- return bundle.getSymbolicName();
- }
-
- @Override
- public long getBundleId()
- {
- return bundle.getBundleId();
- }
-
- @Override
- public String getProperty(String key)
- {
- return bundle.getBundleContext().getProperty(key);
- }
-
- @Override
- public void start() throws BundleException
- {
- bundle.start();
-
- ExportedPackageHelper helper = new ExportedPackageHelper(bundle.getBundleContext());
- helper.logExportedPackages(bundle);
- }
-
- @Override
- public void stop() throws BundleException
- {
- bundle.stop();
- }
-
- @Override
- public void uninstall() throws BundleException
- {
- bundle.uninstall();
- }
-}
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedPackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedPackageAdmin.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedPackageAdmin.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,56 +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.testing;
-
-import org.osgi.framework.Bundle;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-/**
- * [TODO]
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class EmbeddedPackageAdmin extends AbstractPackageAdmin
-{
- private PackageAdmin packAdmin;
-
- public EmbeddedPackageAdmin(PackageAdmin packAdmin)
- {
- this.packAdmin = packAdmin;
- }
-
- @Override
- public void refreshPackages(AbstractBundle[] bundles)
- {
- Bundle[] bundleArr = null;
- if (bundles != null)
- {
- bundleArr = new Bundle[bundles.length];
- for (int i=0; i < bundles.length; i++)
- {
- bundleArr[i] = ((EmbeddedBundle)bundles[i]).getBundle();
- }
- }
- packAdmin.refreshPackages(bundleArr);
- }
-}
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,154 +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.testing;
-
-// $Id$
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Properties;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanServerFactory;
-
-import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.testing.internal.OSGiRuntimeImpl;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * [TODO]
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class EmbeddedRuntime extends OSGiRuntimeImpl
-{
- public EmbeddedRuntime(OSGiTestHelper helper)
- {
- super(helper);
- }
-
- public AbstractBundle installBundle(String location) throws BundleException
- {
- URL bundleURL = getTestHelper().getTestArchiveURL(location);
- Bundle bundle = getBundleContext().installBundle(bundleURL.toExternalForm());
- return new EmbeddedBundle(bundle);
- }
-
- public AbstractBundle[] getBundles()
- {
- List<AbstractBundle> absBundles = new ArrayList<AbstractBundle>();
- for (Bundle bundle : getBundleContext().getBundles())
- {
- absBundles.add(new EmbeddedBundle(bundle));
- }
- AbstractBundle[] bundleArr = new AbstractBundle[absBundles.size()];
- absBundles.toArray(bundleArr);
- return bundleArr;
- }
-
- @Override
- public void addCapability(Capability capability) throws BundleException
- {
- // Copy the properties to the System props
- Properties props = capability.getProperties();
- Enumeration<?> names = props.propertyNames();
- while (names.hasMoreElements())
- {
- String key = (String)names.nextElement();
- String value = props.getProperty(key);
- System.setProperty(key, value);
- }
-
- super.addCapability(capability);
- }
-
- public void startLogEntryTracking(final LogEntryCache logEntryCache)
- {
- super.startLogEntryTracking(logEntryCache);
-
- // Track the LogReaderService to add the LogEntryCache as LogListener
- ServiceTracker tracker = new ServiceTracker(getBundleContext(), LogReaderService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference sref)
- {
- LogReaderService logReaderService = (LogReaderService)super.addingService(sref);
- logReaderService.addLogListener(logEntryCache);
- setLogReaderService(logReaderService);
- return logReaderService;
- }
- };
- tracker.open();
- }
-
- @Override
- public void shutdown()
- {
- super.shutdown();
- OSGiBootstrapProvider bootProvider = getTestHelper().getBootstrapProvider();
- bootProvider.getFramework().stop();
- }
-
- public BundleContext getBundleContext()
- {
- OSGiBootstrapProvider bootProvider = getTestHelper().getBootstrapProvider();
- OSGiFramework framework = bootProvider.getFramework();
- return framework.getBundleContext();
- }
-
- @SuppressWarnings("unchecked")
- public MBeanServerConnection getMBeanServer()
- {
- ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
- if (serverArr.size() > 1)
- throw new IllegalStateException("Multiple MBeanServer instances not supported");
-
- MBeanServer server = null;
- if (serverArr.size() == 1)
- server = serverArr.get(0);
-
- if (server == null)
- server = MBeanServerFactory.createMBeanServer();
-
- return server;
- }
-
- public AbstractPackageAdmin getPackageAdmin()
- {
- BundleContext context = getBundleContext();
- ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
- PackageAdmin packAdmin = (PackageAdmin)context.getService(sref);
- return new EmbeddedPackageAdmin(packAdmin);
- }
-}
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,43 +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.testing;
-
-import java.util.Properties;
-
-//$Id$
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class HttpCapability extends Capability
-{
- public HttpCapability()
- {
- Properties props = getProperties();
- props.setProperty("org.osgi.service.http.port", "8090");
-
- addBundle("bundles/org.apache.felix.http.jetty.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,38 +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.testing;
-
-//$Id$
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class HuskyCapability extends Capability
-{
- public HuskyCapability()
- {
- addBundle("bundles/jboss-osgi-husky.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,45 +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.testing;
-
-//$Id$
-
-import java.util.Properties;
-
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class JMXCapability extends Capability
-{
- public JMXCapability()
- {
- Properties props = getProperties();
- props.setProperty("org.jboss.osgi.jmx.host", System.getProperty("jboss.bind.address", "localhost"));
- props.setProperty("org.jboss.osgi.jmx.rmi.port", "1198");
-
- addBundle("bundles/jboss-osgi-jmx.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,47 +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.testing;
-
-//$Id$
-
-import java.util.Properties;
-
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class JNDICapability extends Capability
-{
- public JNDICapability()
- {
- Properties props = getProperties();
- props.setProperty("org.jboss.osgi.jndi.host", System.getProperty("jboss.bind.address", "localhost"));
- props.setProperty("org.jboss.osgi.jndi.rmi.port", "1198");
- props.setProperty("org.jboss.osgi.jndi.port", "1199");
-
- addBundle("bundles/jboss-osgi-common-core.jar");
- addBundle("bundles/jboss-osgi-jndi.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,43 +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.testing;
-
-//$Id$
-
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class MicrocontainerCapability extends Capability
-{
- public MicrocontainerCapability()
- {
- addBundle("bundles/jboss-osgi-apache-xerces.jar");
- addBundle("bundles/jboss-osgi-jaxb.jar");
- addBundle("bundles/jboss-osgi-common-core.jar");
- addBundle("bundles/jboss-osgi-xml-binding.jar");
- addBundle("bundles/jboss-osgi-microcontainer.jar");
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -28,6 +28,7 @@
import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.management.MBeanProxyException;
+import org.jboss.osgi.spi.testing.capability.Capability;
import org.osgi.framework.BundleException;
/**
@@ -48,12 +49,10 @@
AbstractBundle installBundle(String location) throws BundleException;
- void deploy(String location) throws Exception;
+ AbstractBundle[] getBundles();
- void undeploy(String location) throws Exception;
+ AbstractBundle getBundle(String symbolicName, String version);
- AbstractBundle[] getBundles();
-
AbstractPackageAdmin getPackageAdmin();
InitialContext getInitialContext() throws NamingException;
@@ -62,7 +61,12 @@
MBeanServerConnection getMBeanServer();
+ void deploy(String location) throws Exception;
+
+ void undeploy(String location) throws Exception;
+
String getServerHost();
void shutdown();
+
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTest.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -28,7 +28,6 @@
import javax.naming.NamingException;
import org.jboss.logging.Logger;
-import org.jboss.osgi.spi.testing.internal.OSGiRuntimeImpl;
import org.jboss.virtual.VFS;
import org.junit.After;
import org.junit.Before;
@@ -81,12 +80,12 @@
return helper.getDefaultRuntime();
}
- protected OSGiRuntimeImpl getEmbeddedRuntime()
+ protected OSGiRuntime getEmbeddedRuntime()
{
return helper.getEmbeddedRuntime();
}
- public RemoteRuntime getRemoteRuntime()
+ public OSGiRuntime getRemoteRuntime()
{
return helper.getRemoteRuntime();
}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -31,6 +31,8 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.testing.internal.EmbeddedRuntime;
+import org.jboss.osgi.spi.testing.internal.RemoteRuntime;
/**
* An OSGi Test Helper
@@ -79,12 +81,12 @@
return runtime;
}
- public EmbeddedRuntime getEmbeddedRuntime()
+ public OSGiRuntime getEmbeddedRuntime()
{
return new EmbeddedRuntime(this);
}
- public RemoteRuntime getRemoteRuntime()
+ public OSGiRuntime getRemoteRuntime()
{
return new RemoteRuntime(this);
}
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteBundleBadName.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteBundleBadName.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteBundleBadName.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,102 +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.testing;
-
-import org.jboss.logging.Logger;
-import org.jboss.osgi.spi.framework.RemoteBundle;
-import org.osgi.framework.BundleException;
-
-/**
- * An OSGi Test Case
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class RemoteBundleBadName extends AbstractBundle
-{
- // Provide logging
- private static final Logger log = Logger.getLogger(RemoteBundleBadName.class);
-
- private RemoteRuntime runtime;
- private RemoteBundle bundle;
- private String location;
-
- public RemoteBundleBadName(RemoteRuntime runtime, RemoteBundle bundle, String location)
- {
- this.runtime = runtime;
- this.bundle = bundle;
- this.location = location;
- }
-
- @Override
- public int getState()
- {
- return bundle.getState();
- }
-
- @Override
- public String getSymbolicName()
- {
- return bundle.getSymbolicName();
- }
-
- @Override
- public long getBundleId()
- {
- return bundle.getBundleId();
- }
-
- @Override
- public String getProperty(String key)
- {
- return bundle.getProperty(key);
- }
-
- @Override
- public void start() throws BundleException
- {
- bundle.start();
- }
-
- @Override
- public void stop() throws BundleException
- {
- bundle.stop();
- }
-
- @Override
- public void uninstall() throws BundleException
- {
- try
- {
- runtime.undeploy(location);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- log.error("Cannot uninstall: " + location);
- }
- }
-}
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,46 +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.testing;
-
-//$Id$
-
-import java.util.Properties;
-
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 05-May-2009
- */
-public class RemoteLogCapability extends Capability
-{
- public RemoteLogCapability()
- {
- Properties props = getProperties();
- props.setProperty("org.jboss.osgi.service.remote.log.reader", "true");
- props.setProperty("org.jboss.osgi.remote.log.host", System.getProperty("jboss.bind.address", "localhost"));
- props.setProperty("org.jboss.osgi.remote.log.port", "5400");
-
- addBundle("bundles/jboss-osgi-remotelog.jar");
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemotePackageAdmin.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemotePackageAdmin.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemotePackageAdmin.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,64 +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.testing;
-
-import org.jboss.osgi.spi.management.MBeanProxyException;
-import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
-
-/**
- * [TODO]
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class RemotePackageAdmin extends AbstractPackageAdmin
-{
- private RemoteRuntime runtime;
-
- public RemotePackageAdmin(RemoteRuntime runtime)
- {
- this.runtime = runtime;
- }
-
- @Override
- public void refreshPackages(AbstractBundle[] bundles)
- {
- String[] bundleArr = null;
- if (bundles != null)
- {
- bundleArr = new String[bundles.length];
- for (int i=0; i < bundles.length; i++)
- {
- bundleArr[i] = bundles[i].getSymbolicName();
- }
- }
- try
- {
- ManagedFrameworkMBean mbeanProxy = runtime.getMBeanProxy(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
- mbeanProxy.refreshPackages(bundleArr);
- }
- catch (MBeanProxyException ex)
- {
- throw new IllegalStateException("Cannot refresh packages", ex);
- }
- }
-}
Deleted: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,262 +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.testing;
-
-// $Id$
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarInputStream;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.osgi.spi.framework.RemoteBundle;
-import org.jboss.osgi.spi.framework.RemoteFramework;
-import org.jboss.osgi.spi.framework.RemoteFrameworkException;
-import org.jboss.osgi.spi.logging.LogEntryCache;
-import org.jboss.osgi.spi.logging.RemoteLogReaderService;
-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.testing.internal.OSGiRuntimeImpl;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * [TODO]
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class RemoteRuntime extends OSGiRuntimeImpl
-{
- private MBeanServerConnection mbeanServer;
- private ManagedFrameworkMBean managedFramework;
- private Set<Class<?>> ignoredCaps = new HashSet<Class<?>>();
-
- // Needed for remote logging
- private EmbeddedRuntime embeddedRuntime;
- private RemoteLogCapability remoteLogCapability;
-
- public RemoteRuntime(OSGiTestHelper helper)
- {
- super(helper);
-
- // Initialize the ignored capabilities
- ignoredCaps.add(ConfigAdminCapability.class);
- ignoredCaps.add(HttpCapability.class);
- ignoredCaps.add(JNDICapability.class);
- ignoredCaps.add(JMXCapability.class);
- ignoredCaps.add(MicrocontainerCapability.class);
- }
-
- public AbstractBundle installBundle(String location) throws BundleException
- {
- String symbolicName = null;
- try
- {
- File archiveFile = getTestHelper().getTestArchiveFile(location);
- JarInputStream jarInputStream = new JarInputStream(new FileInputStream(archiveFile));
- Attributes attribs = jarInputStream.getManifest().getMainAttributes();
- symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
- jarInputStream.close();
- }
- catch (IOException ex)
- {
-
- }
- if (symbolicName == null)
- throw new IllegalArgumentException("Cannot obtain Bundle-SymbolicName for: " + location);
-
- try
- {
- deploy(location);
- RemoteBundle bundle = getRemoteFramework().getBundle(symbolicName);
- return new RemoteBundleBadName(this, bundle, location);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new BundleException("Cannot install: " + location, ex);
- }
- }
-
- @Override
- public void addCapability(Capability capability) throws BundleException
- {
- if (ignoredCaps.contains(capability.getClass()))
- return;
-
- super.addCapability(capability);
- }
-
- public AbstractBundle[] getBundles()
- {
- try
- {
- Set<RemoteBundle> remoteBundles = getRemoteFramework().getBundles();
- Set<AbstractBundle> bundles = new HashSet<AbstractBundle>();
- for (RemoteBundle remoteBundle : remoteBundles)
- bundles.add(new RemoteBundleBadName(this, remoteBundle, null));
-
- AbstractBundle[] bundleArr = new AbstractBundle[bundles.size()];
- bundles.toArray(bundleArr);
-
- return bundleArr;
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot obtain remote bundles", ex);
- }
- }
-
- public void startLogEntryTracking(final LogEntryCache logEntryCache)
- {
- super.startLogEntryTracking(logEntryCache);
-
- try
- {
- remoteLogCapability = new RemoteLogCapability();
- addCapability(remoteLogCapability);
-
- embeddedRuntime = getTestHelper().getEmbeddedRuntime();
- embeddedRuntime.addCapability(remoteLogCapability);
-
- // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
- BundleContext context = embeddedRuntime.getBundleContext();
- ServiceTracker tracker = new ServiceTracker(context, RemoteLogReaderService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference sref)
- {
- LogReaderService logReaderService = (LogReaderService)super.addingService(sref);
- logReaderService.addLogListener(logEntryCache);
- setLogReaderService(logReaderService);
- return logReaderService;
- }
- };
- tracker.open();
- }
- catch (BundleException ex)
- {
- throw new IllegalStateException("Cannot start log entry tracking", ex);
- }
- }
-
- @Override
- public void stopLogEntryTracking()
- {
- if (remoteLogCapability != null)
- {
- removeCapability(remoteLogCapability);
- remoteLogCapability = null;
- }
-
- if (embeddedRuntime != null)
- {
- embeddedRuntime.shutdown();
- embeddedRuntime = null;
- }
-
- super.stopLogEntryTracking();
- }
-
- public MBeanServerConnection getMBeanServer()
- {
- if (mbeanServer == null)
- {
- try
- {
- InitialContext iniCtx = getInitialContext();
- mbeanServer = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
- }
- catch (NamingException ex)
- {
- throw new IllegalStateException("Cannot obtain MBeanServerConnection", ex);
- }
- }
- return mbeanServer;
- }
-
- public AbstractPackageAdmin getPackageAdmin()
- {
- return new RemotePackageAdmin(this);
- }
-
- private RemoteFramework getRemoteFramework() throws Exception
- {
- if (managedFramework == null)
- managedFramework = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
-
- return new RemoteFramework()
- {
- public RemoteBundle getBundle(String symbolicName)
- {
- ObjectName bundleOName = managedFramework.getBundle(symbolicName);
- if (bundleOName == null)
- throw new IllegalArgumentException("Cannot remote bundle for: " + symbolicName);
-
- try
- {
- return MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getMBeanServer());
- }
- catch (MBeanProxyException ex)
- {
- throw new RemoteFrameworkException(ex);
- }
- }
-
- public Set<RemoteBundle> getBundles()
- {
- Set<RemoteBundle> remBundles = new HashSet<RemoteBundle>();
- for (ObjectName bundleOName : managedFramework.getBundles())
- {
- try
- {
- RemoteBundle remBundle = MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getMBeanServer());
- remBundles.add(remBundle);
- }
- catch (MBeanProxyException ex)
- {
- throw new RemoteFrameworkException(ex);
- }
- }
- return remBundles;
- }
- };
- }
-}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/BlueprintCapability.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/BlueprintCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/BlueprintCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/BlueprintCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,41 @@
+/*
+ * 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.testing.capability;
+
+
+//$Id$
+
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class BlueprintCapability extends Capability
+{
+ public BlueprintCapability()
+ {
+ addBundle("bundles/jboss-osgi-blueprint.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/Capability.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/Capability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/Capability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/Capability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,69 @@
+/*
+ * 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.testing.capability;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public abstract class Capability
+{
+ private Properties props = new Properties();
+ private Set<String> bundles = new LinkedHashSet<String>();
+
+ public Capability()
+ {
+ }
+
+ public Properties getProperties()
+ {
+ return props;
+ }
+
+ protected void addBundle(String bundle)
+ {
+ bundles.add(bundle);
+ }
+
+ protected void addBundles(List<String> bundles)
+ {
+ for (String bundle : bundles)
+ {
+ addBundle(bundle);
+ }
+ }
+
+ public List<String> getBundles()
+ {
+ return new ArrayList<String>(bundles);
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/ConfigAdminCapability.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/ConfigAdminCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/ConfigAdminCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/ConfigAdminCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.testing.capability;
+
+
+//$Id$
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class ConfigAdminCapability extends Capability
+{
+ public ConfigAdminCapability()
+ {
+ addBundle("bundles/org.apache.felix.metatype.jar");
+ addBundle("bundles/org.apache.felix.configadmin.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/HttpCapability.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HttpCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/HttpCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/HttpCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,44 @@
+/*
+ * 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.testing.capability;
+
+import java.util.Properties;
+
+
+//$Id$
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class HttpCapability extends Capability
+{
+ public HttpCapability()
+ {
+ Properties props = getProperties();
+ props.setProperty("org.osgi.service.http.port", "8090");
+
+ addBundle("bundles/org.apache.felix.http.jetty.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/HuskyCapability.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/HuskyCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/HuskyCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/HuskyCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,39 @@
+/*
+ * 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.testing.capability;
+
+
+//$Id$
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class HuskyCapability extends Capability
+{
+ public HuskyCapability()
+ {
+ addBundle("bundles/jboss-osgi-husky.jar");
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JAXBCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JAXBCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JAXBCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,41 @@
+/*
+ * 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.testing.capability;
+
+
+//$Id$
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class JAXBCapability extends Capability
+{
+ public JAXBCapability()
+ {
+ addBundles(new XMLParserCapability().getBundles());
+ addBundle("bundles/jboss-osgi-jaxb.jar");
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JAXBCapability.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JMXCapability.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JMXCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JMXCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JMXCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,46 @@
+/*
+ * 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.testing.capability;
+
+//$Id$
+
+import java.util.Properties;
+
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class JMXCapability extends Capability
+{
+ public JMXCapability()
+ {
+ Properties props = getProperties();
+ props.setProperty("org.jboss.osgi.jmx.host", System.getProperty("jboss.bind.address", "localhost"));
+ props.setProperty("org.jboss.osgi.jmx.rmi.port", "1198");
+
+ addBundle("bundles/jboss-osgi-jmx.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JNDICapability.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/JNDICapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JNDICapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/JNDICapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,48 @@
+/*
+ * 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.testing.capability;
+
+//$Id$
+
+import java.util.Properties;
+
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class JNDICapability extends Capability
+{
+ public JNDICapability()
+ {
+ Properties props = getProperties();
+ props.setProperty("org.jboss.osgi.jndi.host", System.getProperty("jboss.bind.address", "localhost"));
+ props.setProperty("org.jboss.osgi.jndi.rmi.port", "1198");
+ props.setProperty("org.jboss.osgi.jndi.port", "1199");
+
+ addBundle("bundles/jboss-osgi-common-core.jar");
+ addBundle("bundles/jboss-osgi-jndi.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/MicrocontainerCapability.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/MicrocontainerCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/MicrocontainerCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/MicrocontainerCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,42 @@
+/*
+ * 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.testing.capability;
+
+
+//$Id$
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class MicrocontainerCapability extends Capability
+{
+ public MicrocontainerCapability()
+ {
+ addBundles(new JMXCapability().getBundles());
+ addBundles(new XMLBindingCapability().getBundles());
+ addBundle("bundles/jboss-osgi-microcontainer.jar");
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/RemoteLogCapability.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/RemoteLogCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/RemoteLogCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,47 @@
+/*
+ * 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.testing.capability;
+
+//$Id$
+
+import java.util.Properties;
+
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class RemoteLogCapability extends Capability
+{
+ public RemoteLogCapability()
+ {
+ Properties props = getProperties();
+ props.setProperty("org.jboss.osgi.service.remote.log.reader", "true");
+ props.setProperty("org.jboss.osgi.remote.log.host", System.getProperty("jboss.bind.address", "localhost"));
+ props.setProperty("org.jboss.osgi.remote.log.port", "5400");
+
+ addBundle("bundles/jboss-osgi-remotelog.jar");
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/XMLBindingCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/XMLBindingCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/XMLBindingCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,42 @@
+/*
+ * 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.testing.capability;
+
+
+//$Id$
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class XMLBindingCapability extends Capability
+{
+ public XMLBindingCapability()
+ {
+ addBundles(new JAXBCapability().getBundles());
+ addBundle("bundles/jboss-osgi-common-core.jar");
+ addBundle("bundles/jboss-osgi-xml-binding.jar");
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/XMLBindingCapability.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/XMLParserCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/XMLParserCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/XMLParserCapability.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.testing.capability;
+
+
+//$Id$
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-May-2009
+ */
+public class XMLParserCapability extends Capability
+{
+ public XMLParserCapability()
+ {
+ addBundle("bundles/jboss-osgi-apache-xerces.jar");
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/capability/XMLParserCapability.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedBundle.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedBundle.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,109 @@
+/*
+ * 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.testing.internal;
+
+import java.util.Dictionary;
+
+import org.jboss.osgi.spi.logging.ExportedPackageHelper;
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+
+/**
+ * An OSGi Test Case
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class EmbeddedBundle extends AbstractBundle
+{
+ private Bundle bundle;
+
+ public EmbeddedBundle(Bundle bundle)
+ {
+ this.bundle = bundle;
+ }
+
+ public Bundle getBundle()
+ {
+ return bundle;
+ }
+
+ @Override
+ public int getState()
+ {
+ return bundle.getState();
+ }
+
+ @Override
+ public String getSymbolicName()
+ {
+ return bundle.getSymbolicName();
+ }
+
+ @Override
+ public String getVersion()
+ {
+ return getHeaders().get(Constants.BUNDLE_VERSION);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public Dictionary<String, String> getHeaders()
+ {
+ return bundle.getHeaders();
+ }
+
+ @Override
+ public long getBundleId()
+ {
+ return bundle.getBundleId();
+ }
+
+ @Override
+ public String getProperty(String key)
+ {
+ return bundle.getBundleContext().getProperty(key);
+ }
+
+ @Override
+ public void start() throws BundleException
+ {
+ bundle.start();
+
+ ExportedPackageHelper helper = new ExportedPackageHelper(bundle.getBundleContext());
+ helper.logExportedPackages(bundle);
+ }
+
+ @Override
+ public void stop() throws BundleException
+ {
+ bundle.stop();
+ }
+
+ @Override
+ public void uninstall() throws BundleException
+ {
+ bundle.uninstall();
+ }
+}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedPackageAdmin.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedPackageAdmin.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.spi.testing.internal;
+
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.AbstractPackageAdmin;
+import org.osgi.framework.Bundle;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class EmbeddedPackageAdmin extends AbstractPackageAdmin
+{
+ private PackageAdmin packAdmin;
+
+ public EmbeddedPackageAdmin(PackageAdmin packAdmin)
+ {
+ this.packAdmin = packAdmin;
+ }
+
+ @Override
+ public void refreshPackages(AbstractBundle[] bundles)
+ {
+ Bundle[] bundleArr = null;
+ if (bundles != null)
+ {
+ bundleArr = new Bundle[bundles.length];
+ for (int i=0; i < bundles.length; i++)
+ {
+ bundleArr[i] = ((EmbeddedBundle)bundles[i]).getBundle();
+ }
+ }
+ packAdmin.refreshPackages(bundleArr);
+ }
+}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/EmbeddedRuntime.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,157 @@
+/*
+ * 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.testing.internal;
+
+// $Id$
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerFactory;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.logging.LogEntryCache;
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.AbstractPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.testing.capability.Capability;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class EmbeddedRuntime extends OSGiRuntimeImpl
+{
+ public EmbeddedRuntime(OSGiTestHelper helper)
+ {
+ super(helper);
+ }
+
+ public AbstractBundle installBundle(String location) throws BundleException
+ {
+ URL bundleURL = getTestHelper().getTestArchiveURL(location);
+ Bundle bundle = getBundleContext().installBundle(bundleURL.toExternalForm());
+ return new EmbeddedBundle(bundle);
+ }
+
+ public AbstractBundle[] getBundles()
+ {
+ List<AbstractBundle> absBundles = new ArrayList<AbstractBundle>();
+ for (Bundle bundle : getBundleContext().getBundles())
+ {
+ absBundles.add(new EmbeddedBundle(bundle));
+ }
+ AbstractBundle[] bundleArr = new AbstractBundle[absBundles.size()];
+ absBundles.toArray(bundleArr);
+ return bundleArr;
+ }
+
+ @Override
+ public void addCapability(Capability capability) throws BundleException
+ {
+ // Copy the properties to the System props
+ Properties props = capability.getProperties();
+ Enumeration<?> names = props.propertyNames();
+ while (names.hasMoreElements())
+ {
+ String key = (String)names.nextElement();
+ String value = props.getProperty(key);
+ System.setProperty(key, value);
+ }
+
+ super.addCapability(capability);
+ }
+
+ public void startLogEntryTracking(final LogEntryCache logEntryCache)
+ {
+ super.startLogEntryTracking(logEntryCache);
+
+ // Track the LogReaderService to add the LogEntryCache as LogListener
+ ServiceTracker tracker = new ServiceTracker(getBundleContext(), LogReaderService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference sref)
+ {
+ LogReaderService logReaderService = (LogReaderService)super.addingService(sref);
+ logReaderService.addLogListener(logEntryCache);
+ setLogReaderService(logReaderService);
+ return logReaderService;
+ }
+ };
+ tracker.open();
+ }
+
+ @Override
+ public void shutdown()
+ {
+ super.shutdown();
+ OSGiBootstrapProvider bootProvider = getTestHelper().getBootstrapProvider();
+ bootProvider.getFramework().stop();
+ }
+
+ public BundleContext getBundleContext()
+ {
+ OSGiBootstrapProvider bootProvider = getTestHelper().getBootstrapProvider();
+ OSGiFramework framework = bootProvider.getFramework();
+ return framework.getBundleContext();
+ }
+
+ @SuppressWarnings("unchecked")
+ public MBeanServerConnection getMBeanServer()
+ {
+ ArrayList<MBeanServer> serverArr = MBeanServerFactory.findMBeanServer(null);
+ if (serverArr.size() > 1)
+ throw new IllegalStateException("Multiple MBeanServer instances not supported");
+
+ MBeanServer server = null;
+ if (serverArr.size() == 1)
+ server = serverArr.get(0);
+
+ if (server == null)
+ server = MBeanServerFactory.createMBeanServer();
+
+ return server;
+ }
+
+ public AbstractPackageAdmin getPackageAdmin()
+ {
+ BundleContext context = getBundleContext();
+ ServiceReference sref = context.getServiceReference(PackageAdmin.class.getName());
+ PackageAdmin packAdmin = (PackageAdmin)context.getService(sref);
+ return new EmbeddedPackageAdmin(packAdmin);
+ }
+}
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -37,9 +37,9 @@
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.Capability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.testing.capability.Capability;
import org.osgi.framework.BundleException;
import org.osgi.service.log.LogReaderService;
@@ -186,4 +186,21 @@
{
return helper.getServerHost();
}
+
+ public AbstractBundle getBundle(String symbolicName, String version)
+ {
+ AbstractBundle bundle = null;
+ for (AbstractBundle aux : getBundles())
+ {
+ if (aux.getSymbolicName().equals(symbolicName))
+ {
+ if (version == null || version.equals(aux.getVersion()))
+ {
+ bundle = aux;
+ break;
+ }
+ }
+ }
+ return bundle;
+ }
}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteBundleBadName.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteBundle.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,118 @@
+/*
+ * 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.testing.internal;
+
+import java.util.Dictionary;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.management.ManagedBundleMBean;
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+
+/**
+ * An OSGi Test Case
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class RemoteBundle extends AbstractBundle
+{
+ // Provide logging
+ private static final Logger log = Logger.getLogger(RemoteBundle.class);
+
+ private RemoteRuntime runtime;
+ private ManagedBundleMBean bundle;
+ private String location;
+
+ public RemoteBundle(RemoteRuntime runtime, ManagedBundleMBean bundle, String location)
+ {
+ this.runtime = runtime;
+ this.bundle = bundle;
+ this.location = location;
+ }
+
+ @Override
+ public int getState()
+ {
+ return bundle.getState();
+ }
+
+ @Override
+ public String getSymbolicName()
+ {
+ return bundle.getSymbolicName();
+ }
+
+ @Override
+ public String getVersion()
+ {
+ return getHeaders().get(Constants.BUNDLE_VERSION);
+ }
+
+ @Override
+ public Dictionary<String, String> getHeaders()
+ {
+ return bundle.getHeaders();
+ }
+
+ @Override
+ public long getBundleId()
+ {
+ return bundle.getBundleId();
+ }
+
+ @Override
+ public String getProperty(String key)
+ {
+ return bundle.getProperty(key);
+ }
+
+ @Override
+ public void start() throws BundleException
+ {
+ bundle.start();
+ }
+
+ @Override
+ public void stop() throws BundleException
+ {
+ bundle.stop();
+ }
+
+ @Override
+ public void uninstall() throws BundleException
+ {
+ try
+ {
+ runtime.undeploy(location);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot uninstall: " + location);
+ }
+ }
+}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteFramework.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFramework.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,47 @@
+/*
+ * 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.testing.internal;
+
+//$Id$
+
+import java.util.Set;
+
+import org.jboss.osgi.spi.management.ManagedBundleMBean;
+
+/**
+ * The supported functionality of a remote OSGi Framework
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public interface RemoteFramework
+{
+ /**
+ * Get the list of all installed bundles
+ */
+ Set<ManagedBundleMBean> getBundles();
+
+ /**
+ * Get the installed bundle
+ */
+ ManagedBundleMBean getBundle(String symbolicName);
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFrameworkException.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/framework/RemoteFrameworkException.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFrameworkException.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteFrameworkException.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -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.testing.internal;
+
+// $Id$
+
+/**
+ * A remote OSGi Framework exception that should be thrown on unrecoverable errors.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jan-2009
+ */
+@SuppressWarnings("serial")
+public class RemoteFrameworkException extends RuntimeException
+{
+ public RemoteFrameworkException(String message)
+ {
+ super(message);
+ }
+
+ public RemoteFrameworkException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public RemoteFrameworkException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemotePackageAdmin.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemotePackageAdmin.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,66 @@
+/*
+ * 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.testing.internal;
+
+import org.jboss.osgi.spi.management.MBeanProxyException;
+import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.AbstractPackageAdmin;
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class RemotePackageAdmin extends AbstractPackageAdmin
+{
+ private RemoteRuntime runtime;
+
+ public RemotePackageAdmin(RemoteRuntime runtime)
+ {
+ this.runtime = runtime;
+ }
+
+ @Override
+ public void refreshPackages(AbstractBundle[] bundles)
+ {
+ String[] bundleArr = null;
+ if (bundles != null)
+ {
+ bundleArr = new String[bundles.length];
+ for (int i=0; i < bundles.length; i++)
+ {
+ bundleArr[i] = bundles[i].getSymbolicName();
+ }
+ }
+ try
+ {
+ ManagedFrameworkMBean mbeanProxy = runtime.getMBeanProxy(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK);
+ mbeanProxy.refreshPackages(bundleArr);
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new IllegalStateException("Cannot refresh packages", ex);
+ }
+ }
+}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java (from rev 89499, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/RemoteRuntime.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,268 @@
+/*
+ * 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.testing.internal;
+
+// $Id$
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.jar.Attributes;
+import java.util.jar.JarInputStream;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.osgi.spi.logging.LogEntryCache;
+import org.jboss.osgi.spi.logging.RemoteLogReaderService;
+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.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.AbstractPackageAdmin;
+import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.testing.capability.Capability;
+import org.jboss.osgi.spi.testing.capability.ConfigAdminCapability;
+import org.jboss.osgi.spi.testing.capability.HttpCapability;
+import org.jboss.osgi.spi.testing.capability.JMXCapability;
+import org.jboss.osgi.spi.testing.capability.JNDICapability;
+import org.jboss.osgi.spi.testing.capability.MicrocontainerCapability;
+import org.jboss.osgi.spi.testing.capability.RemoteLogCapability;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * [TODO]
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class RemoteRuntime extends OSGiRuntimeImpl
+{
+ private MBeanServerConnection mbeanServer;
+ private ManagedFrameworkMBean managedFramework;
+ private Set<Class<?>> ignoredCaps = new HashSet<Class<?>>();
+
+ // Needed for remote logging
+ private EmbeddedRuntime embeddedRuntime;
+ private RemoteLogCapability remoteLogCapability;
+
+ public RemoteRuntime(OSGiTestHelper helper)
+ {
+ super(helper);
+
+ // Initialize the ignored capabilities
+ ignoredCaps.add(ConfigAdminCapability.class);
+ ignoredCaps.add(HttpCapability.class);
+ ignoredCaps.add(JNDICapability.class);
+ ignoredCaps.add(JMXCapability.class);
+ ignoredCaps.add(MicrocontainerCapability.class);
+ }
+
+ public AbstractBundle installBundle(String location) throws BundleException
+ {
+ String symbolicName = null;
+ try
+ {
+ File archiveFile = getTestHelper().getTestArchiveFile(location);
+ JarInputStream jarInputStream = new JarInputStream(new FileInputStream(archiveFile));
+ Attributes attribs = jarInputStream.getManifest().getMainAttributes();
+ symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
+ jarInputStream.close();
+ }
+ catch (IOException ex)
+ {
+
+ }
+ if (symbolicName == null)
+ throw new IllegalArgumentException("Cannot obtain Bundle-SymbolicName for: " + location);
+
+ try
+ {
+ deploy(location);
+ ManagedBundleMBean bundle = getRemoteFramework().getBundle(symbolicName);
+ return new RemoteBundle(this, bundle, location);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new BundleException("Cannot install: " + location, ex);
+ }
+ }
+
+ @Override
+ public void addCapability(Capability capability) throws BundleException
+ {
+ if (ignoredCaps.contains(capability.getClass()))
+ return;
+
+ super.addCapability(capability);
+ }
+
+ public AbstractBundle[] getBundles()
+ {
+ try
+ {
+ Set<ManagedBundleMBean> remoteBundles = getRemoteFramework().getBundles();
+ Set<AbstractBundle> bundles = new HashSet<AbstractBundle>();
+ for (ManagedBundleMBean remoteBundle : remoteBundles)
+ bundles.add(new RemoteBundle(this, remoteBundle, null));
+
+ AbstractBundle[] bundleArr = new AbstractBundle[bundles.size()];
+ bundles.toArray(bundleArr);
+
+ return bundleArr;
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot obtain remote bundles", ex);
+ }
+ }
+
+ public void startLogEntryTracking(final LogEntryCache logEntryCache)
+ {
+ super.startLogEntryTracking(logEntryCache);
+
+ try
+ {
+ remoteLogCapability = new RemoteLogCapability();
+ addCapability(remoteLogCapability);
+
+ embeddedRuntime = (EmbeddedRuntime)getTestHelper().getEmbeddedRuntime();
+ embeddedRuntime.addCapability(remoteLogCapability);
+
+ // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
+ BundleContext context = embeddedRuntime.getBundleContext();
+ ServiceTracker tracker = new ServiceTracker(context, RemoteLogReaderService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference sref)
+ {
+ LogReaderService logReaderService = (LogReaderService)super.addingService(sref);
+ logReaderService.addLogListener(logEntryCache);
+ setLogReaderService(logReaderService);
+ return logReaderService;
+ }
+ };
+ tracker.open();
+ }
+ catch (BundleException ex)
+ {
+ throw new IllegalStateException("Cannot start log entry tracking", ex);
+ }
+ }
+
+ @Override
+ public void stopLogEntryTracking()
+ {
+ if (remoteLogCapability != null)
+ {
+ removeCapability(remoteLogCapability);
+ remoteLogCapability = null;
+ }
+
+ if (embeddedRuntime != null)
+ {
+ embeddedRuntime.shutdown();
+ embeddedRuntime = null;
+ }
+
+ super.stopLogEntryTracking();
+ }
+
+ public MBeanServerConnection getMBeanServer()
+ {
+ if (mbeanServer == null)
+ {
+ try
+ {
+ InitialContext iniCtx = getInitialContext();
+ mbeanServer = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ }
+ catch (NamingException ex)
+ {
+ throw new IllegalStateException("Cannot obtain MBeanServerConnection", ex);
+ }
+ }
+ return mbeanServer;
+ }
+
+ public AbstractPackageAdmin getPackageAdmin()
+ {
+ return new RemotePackageAdmin(this);
+ }
+
+ private RemoteFramework getRemoteFramework() throws Exception
+ {
+ if (managedFramework == null)
+ managedFramework = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
+
+ return new RemoteFramework()
+ {
+ public ManagedBundleMBean getBundle(String symbolicName)
+ {
+ ObjectName bundleOName = managedFramework.getBundle(symbolicName);
+ if (bundleOName == null)
+ throw new IllegalArgumentException("Cannot remote bundle for: " + symbolicName);
+
+ try
+ {
+ return MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getMBeanServer());
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new RemoteFrameworkException(ex);
+ }
+ }
+
+ public Set<ManagedBundleMBean> getBundles()
+ {
+ Set<ManagedBundleMBean> remBundles = new HashSet<ManagedBundleMBean>();
+ for (ObjectName bundleOName : managedFramework.getBundles())
+ {
+ try
+ {
+ ManagedBundleMBean remBundle = MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getMBeanServer());
+ remBundles.add(remBundle);
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new RemoteFrameworkException(ex);
+ }
+ }
+ return remBundles;
+ }
+ };
+ }
+}
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -30,11 +30,11 @@
import java.net.URL;
import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.ConfigAdminCapability;
-import org.jboss.osgi.spi.testing.HttpCapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.testing.capability.ConfigAdminCapability;
+import org.jboss.osgi.spi.testing.capability.HttpCapability;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -31,11 +31,11 @@
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.JNDICapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.testing.capability.JMXCapability;
+import org.jboss.osgi.spi.testing.capability.JNDICapability;
import org.jboss.test.osgi.example.jmx.bundle.FooMBean;
import org.junit.AfterClass;
import org.junit.BeforeClass;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -30,10 +30,10 @@
import javax.naming.NameNotFoundException;
import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.JNDICapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.testing.capability.JNDICapability;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -38,12 +38,12 @@
import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.JNDICapability;
-import org.jboss.osgi.spi.testing.MicrocontainerCapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.testing.capability.JMXCapability;
+import org.jboss.osgi.spi.testing.capability.JNDICapability;
+import org.jboss.osgi.spi.testing.capability.MicrocontainerCapability;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -1,186 +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.
- */
-
-
-//$Id$
-package org.jboss.test.osgi.bootstrap;
-
-import static org.junit.Assert.*;
-
-import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
-import org.jboss.osgi.spi.testing.OSGiTest;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-/**
- * Test OSGi System bundle access
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public class BundleTestCase extends OSGiTest
-{
- @Test
- public void testApacheXercesBundle() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-apache-xerces.jar");
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-
- bundle.stop();
- assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
-
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJAXBBundle() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-jaxb.jar");
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-
- bundle.stop();
- assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
-
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJBossCommonCoreBundle() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-apache-xerces.jar");
- bundle = runtime.installBundle("bundles/jboss-osgi-common-core.jar");
-
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-
- bundle.stop();
- assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
-
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJBossXBBundle() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-apache-xerces.jar");
- bundle = runtime.installBundle("bundles/jboss-osgi-common-core.jar");
- bundle = runtime.installBundle("bundles/jboss-osgi-jaxb.jar");
- bundle = runtime.installBundle("bundles/jboss-osgi-xml-binding.jar");
-
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-
- bundle.stop();
- assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
-
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJNDIBundle() throws BundleException
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-common-core.jar");
- bundle = runtime.installBundle("bundles/jboss-osgi-jndi.jar");
-
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-
- bundle.stop();
- assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
-
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
- }
- finally
- {
- runtime.shutdown();
- }
- }
-
- @Test
- public void testJMXBundle() throws Exception
- {
- OSGiRuntime runtime = getEmbeddedRuntime();
- try
- {
- AbstractBundle bundle = runtime.installBundle("bundles/jboss-osgi-common-core.jar");
- bundle = runtime.installBundle("bundles/jboss-osgi-jndi.jar");
- bundle = runtime.installBundle("bundles/jboss-osgi-jmx.jar");
-
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
-
- bundle.stop();
- assertEquals("Test bundle RESOLVED", Bundle.RESOLVED, bundle.getState());
-
- bundle.start();
- assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
- }
- finally
- {
- runtime.shutdown();
- }
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java (from rev 89499, projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/CapabilityTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -0,0 +1,149 @@
+/*
+ * 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.
+ */
+
+
+//$Id$
+package org.jboss.test.osgi.bootstrap;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.capability.JAXBCapability;
+import org.jboss.osgi.spi.testing.capability.JMXCapability;
+import org.jboss.osgi.spi.testing.capability.JNDICapability;
+import org.jboss.osgi.spi.testing.capability.XMLBindingCapability;
+import org.jboss.osgi.spi.testing.capability.XMLParserCapability;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * Test OSGi runtime capabilities
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public class CapabilityTestCase extends OSGiTest
+{
+ @Test
+ public void testXMLParserCapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.getBundle("jboss-osgi-apache-xerces", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new XMLParserCapability());
+
+ bundle = runtime.getBundle("jboss-osgi-apache-xerces", null);
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testJAXBCapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.getBundle("jboss-osgi-jaxb", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new JAXBCapability());
+
+ bundle = runtime.getBundle("jboss-osgi-jaxb", null);
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testXMLBindingCapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.getBundle("jboss-osgi-xml-binding", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new XMLBindingCapability());
+
+ bundle = runtime.getBundle("jboss-osgi-xml-binding", null);
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testJNDICapability() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.getBundle("jboss-osgi-jndi", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new JNDICapability());
+
+ bundle = runtime.getBundle("jboss-osgi-jndi", null);
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ @Test
+ public void testJMXCapability() throws Exception
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.getBundle("jboss-osgi-jmx", null);
+ assertNull("Test bundle null", bundle);
+
+ runtime.addCapability(new JMXCapability());
+
+ bundle = runtime.getBundle("jboss-osgi-jmx", null);
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41TestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -32,9 +32,9 @@
import java.io.FileReader;
import org.jboss.osgi.spi.testing.AbstractBundle;
-import org.jboss.osgi.spi.testing.ConfigAdminCapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.capability.ConfigAdminCapability;
import org.junit.Test;
import org.osgi.framework.Bundle;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -28,12 +28,12 @@
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.JNDICapability;
-import org.jboss.osgi.spi.testing.MicrocontainerCapability;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
-import org.jboss.osgi.spi.testing.RemoteRuntime;
+import org.jboss.osgi.spi.testing.capability.JMXCapability;
+import org.jboss.osgi.spi.testing.capability.JNDICapability;
+import org.jboss.osgi.spi.testing.capability.MicrocontainerCapability;
import org.jboss.test.osgi.jbossas.jbosgi36.mbean.FooMBean;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -49,7 +49,7 @@
*/
public class OSGI36TestCase extends OSGiTest
{
- static RemoteRuntime runtime;
+ static OSGiRuntime runtime;
@BeforeClass
public static void setUpClass() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/JMXServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/JMXServiceTestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jmx/JMXServiceTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -28,11 +28,11 @@
import javax.management.MBeanServerConnection;
import javax.naming.InitialContext;
-import org.jboss.osgi.spi.testing.JMXCapability;
-import org.jboss.osgi.spi.testing.JNDICapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.testing.capability.JMXCapability;
+import org.jboss.osgi.spi.testing.capability.JNDICapability;
import org.junit.Ignore;
import org.junit.Test;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNDIServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNDIServiceTestCase.java 2009-05-28 19:46:11 UTC (rev 89500)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/jndi/JNDIServiceTestCase.java 2009-05-28 21:21:07 UTC (rev 89501)
@@ -27,10 +27,10 @@
import javax.naming.InitialContext;
-import org.jboss.osgi.spi.testing.JNDICapability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTest;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
+import org.jboss.osgi.spi.testing.capability.JNDICapability;
import org.junit.Ignore;
import org.junit.Test;
17 years, 1 month
JBoss-OSGI SVN: r89500 - in projects/jboss-osgi/trunk: 3rdparty/jboss-xml-binding and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 15:46:11 -0400 (Thu, 28 May 2009)
New Revision: 89500
Added:
projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/
Removed:
projects/jboss-osgi/trunk/3rdparty/jbossxb/
projects/jboss-osgi/trunk/bundles/logging/
Modified:
projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/.classpath
projects/jboss-osgi/trunk/3rdparty/pom.xml
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/SimpleDeployerService.java
Log:
Fix duplicate deployment from DeploymentScanner
Copied: projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding (from rev 89499, projects/jboss-osgi/trunk/3rdparty/jbossxb)
Modified: projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/.classpath
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jbossxb/.classpath 2009-05-28 18:36:22 UTC (rev 89499)
+++ projects/jboss-osgi/trunk/3rdparty/jboss-xml-binding/.classpath 2009-05-28 19:46:11 UTC (rev 89500)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
+ <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="output" path="target/classes"/>
Modified: projects/jboss-osgi/trunk/3rdparty/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/pom.xml 2009-05-28 18:36:22 UTC (rev 89499)
+++ projects/jboss-osgi/trunk/3rdparty/pom.xml 2009-05-28 19:46:11 UTC (rev 89500)
@@ -17,7 +17,7 @@
<module>apache-xerces</module>
<module>jaxb</module>
<module>jboss-common-core</module>
- <module>jbossxb</module>
+ <module>jboss-xml-binding</module>
</modules>
</project>
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-05-28 18:36:22 UTC (rev 89499)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-05-28 19:46:11 UTC (rev 89500)
@@ -40,6 +40,7 @@
import org.jboss.osgi.common.service.BundleInfo;
import org.jboss.osgi.common.service.DeployerService;
import org.jboss.osgi.common.service.DeploymentScannerService;
+import org.jboss.osgi.common.service.BundleInfo.State;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
@@ -65,6 +66,7 @@
private ScannerThread scannerThread;
private DeployerService deployerService;
private List<BundleInfo> lastScan = new ArrayList<BundleInfo>();
+ private boolean traceBundles = false;
public DeploymentScannerImpl(BundleContext context)
{
@@ -89,7 +91,7 @@
}
};
tracker.open();
-
+
initScanner(context);
}
@@ -114,6 +116,9 @@
{
List<BundleInfo> currScan = Arrays.asList(getBundles());
+ if (traceBundles)
+ logBundleInfos("Current Scan", currScan);
+
processOldDeployments(currScan);
processNewDeployments(currScan);
@@ -122,6 +127,15 @@
scanCount++;
}
+ private void logBundleInfos(String message, List<BundleInfo> bundleInfos)
+ {
+ System.out.println(message);
+ for (BundleInfo info : bundleInfos)
+ {
+ System.out.println(" " + info);
+ }
+ }
+
private void processOldDeployments(List<BundleInfo> currScan)
{
List<BundleInfo> diff = new ArrayList<BundleInfo>();
@@ -129,14 +143,17 @@
// Detect OLD bundles that are not in the current scan
for (BundleInfo info : lastScan)
{
- if (currScan.contains(info) == false)
+ if ((info.getState() == State.INSTALLED || info.getState() == State.ACTIVE) && currScan.contains(info) == false)
diff.add(info);
}
+ if (traceBundles)
+ logBundleInfos("OLD diff", diff);
+
// Undeploy the bundles through the DeployerService
try
{
- BundleInfo[] infoArr = diff.toArray(new BundleInfo[diff.size()]);
+ BundleInfo[] infoArr = diff.toArray(new BundleInfo[diff.size()]);
deployerService.undeploy(infoArr);
}
catch (Exception ex)
@@ -152,14 +169,17 @@
// Detect NEW bundles that are not in the last scan
for (BundleInfo info : currScan)
{
- if (lastScan.contains(info) == false)
+ if (info.getState() == BundleInfo.State.NEW && lastScan.contains(info) == false)
diff.add(info);
}
+ if (traceBundles)
+ logBundleInfos("NEW diff", diff);
+
// Deploy the bundles through the DeployerService
try
{
- BundleInfo[] infoArr = diff.toArray(new BundleInfo[diff.size()]);
+ BundleInfo[] infoArr = diff.toArray(new BundleInfo[diff.size()]);
deployerService.deploy(infoArr);
}
catch (Exception ex)
@@ -238,7 +258,7 @@
JarFile jarFile = new JarFile(file);
Manifest manifest = jarFile.getManifest();
Attributes attribs = manifest.getMainAttributes();
-
+
String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
if (symbolicName == null)
throw new IllegalStateException("Cannot obtain '" + Constants.BUNDLE_SYMBOLICNAME + "' from: " + file);
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/SimpleDeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/SimpleDeployerService.java 2009-05-28 18:36:22 UTC (rev 89499)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/SimpleDeployerService.java 2009-05-28 19:46:11 UTC (rev 89500)
@@ -29,16 +29,13 @@
import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.common.service.BundleInfo;
import org.jboss.osgi.common.service.DeployerService;
-import org.jboss.osgi.common.service.BundleInfo.State;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.service.log.LogService;
/**
- * A {@link DeployerService} that installs/uninstalls the
- * bundles directly on the OSGi framework without going
- * through the MC registered deployers.
+ * A {@link DeployerService} that installs/uninstalls the bundles directly on the OSGi framework without going through the MC registered deployers.
*
* @author thomas.diesler(a)jboss.com
* @since 27-May-2009
@@ -60,19 +57,16 @@
List<Bundle> bundles = new ArrayList<Bundle>();
for (BundleInfo info : bundleInfos)
{
- if (info.getState() == BundleInfo.State.NEW)
+ try
{
- try
- {
- log.log(LogService.LOG_DEBUG, "Install: " + info.getSymbolicName());
- Bundle bundle = context.installBundle(info.getLocation().toExternalForm());
- bundles.add(bundle);
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot install bundle: " + info.getSymbolicName(), ex);
- }
+ log.log(LogService.LOG_DEBUG, "Install: " + info.getSymbolicName());
+ Bundle bundle = context.installBundle(info.getLocation().toExternalForm());
+ bundles.add(bundle);
}
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot install bundle: " + info.getSymbolicName(), ex);
+ }
}
// Start the installed bundles
@@ -97,18 +91,15 @@
Bundle bundle = getInstalledBundle(context, info);
if (bundle != null)
{
- if (info.getState() == State.INSTALLED || info.getState() == State.ACTIVE)
+ try
{
- try
- {
- log.log(LogService.LOG_DEBUG, "Uninstall: " + info.getSymbolicName());
- bundle.uninstall();
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot uninstall bundle", ex);
- }
+ log.log(LogService.LOG_DEBUG, "Uninstall: " + info.getSymbolicName());
+ bundle.uninstall();
}
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot uninstall bundle", ex);
+ }
}
}
}
17 years, 1 month
JBoss-OSGI SVN: r89498 - projects/jboss-osgi/trunk/runtime/felix/src/main/resources.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 10:44:23 -0400 (Thu, 28 May 2009)
New Revision: 89498
Modified:
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
Log:
Remove jboss-osgi-logging from autStart
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-28 13:56:57 UTC (rev 89497)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-05-28 14:44:23 UTC (rev 89498)
@@ -67,7 +67,6 @@
<list elementClass="java.net.URL">
<value>${jboss.server.home.url}/deploy/osgi/org.osgi.compendium.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-common.jar</value>
- <value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-logging.jar</value>
</list>
</property>
</bean>
17 years, 1 month
JBoss-OSGI SVN: r89497 - in projects/jboss-osgi/trunk/bundles: hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 09:56:57 -0400 (Thu, 28 May 2009)
New Revision: 89497
Added:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/BundleInfo.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerService.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScannerService.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/SimpleDeployerService.java
Removed:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScanner.java
Modified:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
Log:
Deployment scanner uses DeploymentService
Added: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/BundleInfo.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/BundleInfo.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/BundleInfo.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -0,0 +1,64 @@
+/*
+ * 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.common.service;
+
+//$Id$
+
+import java.net.URL;
+
+
+/**
+ * An abstraction of a bundle in the scan folder
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public interface BundleInfo
+{
+ /**
+ * The state of the bundle
+ */
+ enum State
+ {
+ NEW, INSTALLED, ACTIVE, UNINSTALLED
+ }
+
+ /**
+ * Get the bundle location
+ */
+ URL getLocation();
+
+ /**
+ * Get the bundle state
+ */
+ BundleInfo.State getState();
+
+ /**
+ * Get the bundle symbolic name
+ */
+ String getSymbolicName();
+
+ /**
+ * Get the bundle version
+ */
+ String getVersion();
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/BundleInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerService.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerService.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -0,0 +1,45 @@
+/*
+ * 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.common.service;
+
+//$Id$
+
+
+/**
+ * A Service that deploys bundles through the deployers that
+ * are registered with the {@link MicrocontainerService}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public interface DeployerService
+{
+ /**
+ * Deploy an array of bundles
+ */
+ void deploy(BundleInfo[] bundles) throws Exception;
+
+ /**
+ * Undeploy an array of bundles
+ */
+ void undeploy(BundleInfo[] bundles) throws Exception;
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeployerService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScanner.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScanner.java 2009-05-28 13:54:17 UTC (rev 89496)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScanner.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -1,108 +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.common.service;
-
-//$Id$
-
-import java.net.URL;
-
-/**
- * The DeploymentScanner service
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public interface DeploymentScanner
-{
- /**
- * The property that names the scan location: org.jboss.osgi.hotdeploy.scandir
- */
- String PROPERTY_SCAN_LOCATION = "org.jboss.osgi.hotdeploy.scandir";
-
- /**
- * The property to defines the scan interval: org.jboss.osgi.hotdeploy.interval
- */
- String PROPERTY_SCAN_INTERVAL = "org.jboss.osgi.hotdeploy.interval";
-
- /**
- * Get the scan location URL.
- *
- * This is can be specified by setting the {@link PROPERTY_SCAN_LOCATION} property.
- */
- URL getScanLocation();
-
- /**
- * The number of scans since the service started
- */
- long getScanCount();
-
- /**
- * The number of milliseconds between scans
- * Defaults to 2000ms
- */
- long getScanInterval();
-
- /**
- * Run a directory scan
- */
- void scan();
-
- /**
- * Returns the array of bundles currently known to the deployemtn scanner.
- */
- BundleInfo[] getBundles();
-
- /**
- * An abstraction of a bundle in the scan folder
- *
- */
- interface BundleInfo
- {
- /**
- * The state of the bundle
- */
- enum State
- {
- NEW, INSTALLED, ACTIVE, UNINSTALLED
- }
-
- /**
- * Get the bundle location
- */
- URL getLocation();
-
- /**
- * Get the bundle state
- */
- State getState();
-
- /**
- * Get the bundle symbolic name
- */
- String getSymbolicName();
-
- /**
- * Get the bundle version
- */
- String getVersion();
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScannerService.java (from rev 89492, projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScanner.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScannerService.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScannerService.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -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.common.service;
+
+//$Id$
+
+import java.net.URL;
+
+
+/**
+ * A service that scans a directory location for new/removed bundles.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public interface DeploymentScannerService
+{
+ /**
+ * The property that names the scan location: org.jboss.osgi.hotdeploy.scandir
+ */
+ String PROPERTY_SCAN_LOCATION = "org.jboss.osgi.hotdeploy.scandir";
+
+ /**
+ * The property to defines the scan interval: org.jboss.osgi.hotdeploy.interval
+ */
+ String PROPERTY_SCAN_INTERVAL = "org.jboss.osgi.hotdeploy.interval";
+
+ /**
+ * Get the scan location URL.
+ *
+ * This is can be specified by setting the {@link PROPERTY_SCAN_LOCATION} property.
+ */
+ URL getScanLocation();
+
+ /**
+ * The number of scans since the service started
+ */
+ long getScanCount();
+
+ /**
+ * The number of milliseconds between scans
+ * Defaults to 2000ms
+ */
+ long getScanInterval();
+
+ /**
+ * Run a directory scan
+ */
+ void scan();
+
+ /**
+ * Returns the array of bundles currently known to the deployemtn scanner.
+ */
+ BundleInfo[] getBundles();
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java 2009-05-28 13:54:17 UTC (rev 89496)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -23,7 +23,6 @@
//$Id$
-import java.net.URL;
import java.util.List;
/**
@@ -64,14 +63,4 @@
* @return null if there is no bean registered under this name
*/
Object getRegisteredBean(String beanName);
-
- /*
- * * Deploy MC beans from URL
- */
- void deploy(URL url) throws Exception;
-
- /*
- * * Undeploy MC beans from URL
- */
- void undeploy(URL url) throws Exception;
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java 2009-05-28 13:54:17 UTC (rev 89496)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -26,11 +26,10 @@
import java.net.URL;
import java.util.Dictionary;
-import org.jboss.osgi.common.service.DeploymentScanner.BundleInfo;
+import org.jboss.osgi.common.service.BundleInfo;
import org.osgi.framework.Bundle;
import org.osgi.framework.Constants;
-
/**
* An abstraction of a bundle in the scan folder
*
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java 2009-05-28 13:54:17 UTC (rev 89496)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -23,12 +23,12 @@
//$Id$
-import org.jboss.osgi.common.service.DeploymentScanner;
+import org.jboss.osgi.common.service.DeploymentScannerService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
/**
- * The {@link DeploymentScanner} service activator
+ * The {@link DeploymentScannerService} service activator
*
* @author thomas.diesler(a)jboss.com
* @since 27-May-2009
@@ -40,7 +40,7 @@
public void start(BundleContext context)
{
service = new DeploymentScannerImpl(context);
- context.registerService(DeploymentScanner.class.getName(), service, null);
+ context.registerService(DeploymentScannerService.class.getName(), service, null);
service.start();
}
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-05-28 13:54:17 UTC (rev 89496)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -37,12 +37,15 @@
import java.util.jar.Manifest;
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.common.service.DeploymentScanner;
-import org.jboss.osgi.common.service.DeploymentScanner.BundleInfo.State;
+import org.jboss.osgi.common.service.BundleInfo;
+import org.jboss.osgi.common.service.DeployerService;
+import org.jboss.osgi.common.service.DeploymentScannerService;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
/**
* The DeploymentScanner service
@@ -50,7 +53,7 @@
* @author thomas.diesler(a)jboss.com
* @since 27-May-2009
*/
-public class DeploymentScannerImpl implements DeploymentScanner
+public class DeploymentScannerImpl implements DeploymentScannerService
{
private LogServiceTracker log;
private BundleContext context;
@@ -60,6 +63,7 @@
private long scanCount;
private ScannerThread scannerThread;
+ private DeployerService deployerService;
private List<BundleInfo> lastScan = new ArrayList<BundleInfo>();
public DeploymentScannerImpl(BundleContext context)
@@ -67,6 +71,25 @@
this.log = new LogServiceTracker(context);
this.context = context;
+ // Init and track the DeployerService
+ deployerService = new SimpleDeployerService(context);
+ ServiceTracker tracker = new ServiceTracker(context, DeployerService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ deployerService = (DeployerService)super.addingService(reference);
+ return deployerService;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ deployerService = new SimpleDeployerService(context);
+ }
+ };
+ tracker.open();
+
initScanner(context);
}
@@ -110,25 +133,16 @@
diff.add(info);
}
- for (BundleInfo info : diff)
+ // Undeploy the bundles through the DeployerService
+ try
{
- Bundle bundle = getInstalledBundle(info.getSymbolicName());
- if (bundle != null)
- {
- if (info.getState() == State.INSTALLED || info.getState() == State.ACTIVE)
- {
- try
- {
- log.log(LogService.LOG_DEBUG, "Uninstall: " + info.getSymbolicName());
- bundle.uninstall();
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot uninstall bundle", ex);
- }
- }
- }
+ BundleInfo[] infoArr = diff.toArray(new BundleInfo[diff.size()]);
+ deployerService.undeploy(infoArr);
}
+ catch (Exception ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot undeploy bundles", ex);
+ }
}
private void processNewDeployments(List<BundleInfo> currScan)
@@ -142,65 +156,26 @@
diff.add(info);
}
- // Install the NEW bundles
- List<Bundle> bundles = new ArrayList<Bundle>();
- for (BundleInfo info : diff)
+ // Deploy the bundles through the DeployerService
+ try
{
- if (info.getState() == BundleInfo.State.NEW)
- {
- try
- {
- log.log(LogService.LOG_DEBUG, "Install: " + info.getSymbolicName());
- Bundle bundle = context.installBundle(info.getLocation().toExternalForm());
- bundles.add(bundle);
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot install bundle: " + info.getSymbolicName(), ex);
- }
- }
+ BundleInfo[] infoArr = diff.toArray(new BundleInfo[diff.size()]);
+ deployerService.deploy(infoArr);
}
-
- // Start the installed bundles
- for (Bundle bundle : bundles)
+ catch (Exception ex)
{
- try
- {
- log.log(LogService.LOG_DEBUG, "Start: " + bundle.getSymbolicName());
- bundle.start();
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot start bundle: " + bundle.getSymbolicName(), ex);
- }
+ log.log(LogService.LOG_ERROR, "Cannot deploy bundles", ex);
}
}
- private Bundle getInstalledBundle(String symbolicName)
- {
- Bundle bundle = null;
-
- for (Bundle aux : context.getBundles())
- {
- if (aux.getSymbolicName().equals(symbolicName))
- {
- bundle = aux;
- break;
- }
- }
-
- return bundle;
- }
-
public BundleInfo[] getBundles()
{
- List<BundleInfoImpl> bundles = new ArrayList<BundleInfoImpl>();
+ List<BundleInfo> bundles = new ArrayList<BundleInfo>();
for (File file : scanLocation.listFiles())
{
- String symbolicName = getSymbolicName(file);
- Bundle bundle = getInstalledBundle(symbolicName);
- BundleInfoImpl bundleInfo = new BundleInfoImpl(toURL(file), symbolicName, bundle);
- bundles.add(bundleInfo);
+ BundleInfo info = getBundleInfo(file);
+ Bundle bundle = SimpleDeployerService.getInstalledBundle(context, info);
+ bundles.add(new BundleInfoImpl(toURL(file), info.getSymbolicName(), bundle));
}
BundleInfo[] arr = new BundleInfoImpl[bundles.size()];
return bundles.toArray(arr);
@@ -256,18 +231,19 @@
scanLocation = scanFile;
}
- private String getSymbolicName(File file)
+ private BundleInfo getBundleInfo(File file)
{
try
{
JarFile jarFile = new JarFile(file);
Manifest manifest = jarFile.getManifest();
Attributes attribs = manifest.getMainAttributes();
- String symbolicName = attribs.getValue(BUNDLE_SYMBOLICNAME);
+
+ String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
if (symbolicName == null)
- throw new IllegalStateException("Cannot obtain '" + BUNDLE_SYMBOLICNAME + "' from: " + file);
+ throw new IllegalStateException("Cannot obtain '" + Constants.BUNDLE_SYMBOLICNAME + "' from: " + file);
- return symbolicName;
+ return new BundleInfoImpl(toURL(file), symbolicName, null);
}
catch (IOException ex)
{
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java 2009-05-28 13:54:17 UTC (rev 89496)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -24,7 +24,7 @@
//$Id$
import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.common.service.DeploymentScanner;
+import org.jboss.osgi.common.service.DeploymentScannerService;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
@@ -38,10 +38,10 @@
{
private LogService log;
- private DeploymentScanner scanner;
+ private DeploymentScannerService scanner;
private boolean active = true;
- public ScannerThread(BundleContext context, DeploymentScanner scanner)
+ public ScannerThread(BundleContext context, DeploymentScannerService scanner)
{
this.log = new LogServiceTracker(context);
this.scanner = scanner;
Added: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/SimpleDeployerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/SimpleDeployerService.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/SimpleDeployerService.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -0,0 +1,132 @@
+/*
+ * 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.service.hotdeploy.internal;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.service.BundleInfo;
+import org.jboss.osgi.common.service.DeployerService;
+import org.jboss.osgi.common.service.BundleInfo.State;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.service.log.LogService;
+
+/**
+ * A {@link DeployerService} that installs/uninstalls the
+ * bundles directly on the OSGi framework without going
+ * through the MC registered deployers.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public class SimpleDeployerService implements DeployerService
+{
+ private LogServiceTracker log;
+ private BundleContext context;
+
+ public SimpleDeployerService(BundleContext context)
+ {
+ this.log = new LogServiceTracker(context);
+ this.context = context;
+ }
+
+ public void deploy(BundleInfo[] bundleInfos) throws BundleException
+ {
+ // Install the NEW bundles
+ List<Bundle> bundles = new ArrayList<Bundle>();
+ for (BundleInfo info : bundleInfos)
+ {
+ if (info.getState() == BundleInfo.State.NEW)
+ {
+ try
+ {
+ log.log(LogService.LOG_DEBUG, "Install: " + info.getSymbolicName());
+ Bundle bundle = context.installBundle(info.getLocation().toExternalForm());
+ bundles.add(bundle);
+ }
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot install bundle: " + info.getSymbolicName(), ex);
+ }
+ }
+ }
+
+ // Start the installed bundles
+ for (Bundle bundle : bundles)
+ {
+ try
+ {
+ log.log(LogService.LOG_DEBUG, "Start: " + bundle.getSymbolicName());
+ bundle.start();
+ }
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot start bundle: " + bundle.getSymbolicName(), ex);
+ }
+ }
+ }
+
+ public void undeploy(BundleInfo[] bundleInfos) throws BundleException
+ {
+ for (BundleInfo info : bundleInfos)
+ {
+ Bundle bundle = getInstalledBundle(context, info);
+ if (bundle != null)
+ {
+ if (info.getState() == State.INSTALLED || info.getState() == State.ACTIVE)
+ {
+ try
+ {
+ log.log(LogService.LOG_DEBUG, "Uninstall: " + info.getSymbolicName());
+ bundle.uninstall();
+ }
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot uninstall bundle", ex);
+ }
+ }
+ }
+ }
+ }
+
+ public static Bundle getInstalledBundle(BundleContext context, BundleInfo bundleInfo)
+ {
+ Bundle bundle = null;
+
+ for (Bundle aux : context.getBundles())
+ {
+ String symbolicName = aux.getSymbolicName();
+ if (symbolicName.equals(bundleInfo.getSymbolicName()))
+ {
+ bundle = aux;
+ break;
+ }
+ }
+
+ return bundle;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/SimpleDeployerService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-28 13:54:17 UTC (rev 89496)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-28 13:56:57 UTC (rev 89497)
@@ -41,6 +41,7 @@
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerContextActions;
import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.client.spi.Deployment;
import org.jboss.deployers.client.spi.main.MainDeployer;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
@@ -49,8 +50,11 @@
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.service.BundleInfo;
+import org.jboss.osgi.common.service.DeployerService;
import org.jboss.osgi.common.service.MicrocontainerService;
import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
+import org.jboss.osgi.spi.NotImplementedException;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
import org.osgi.framework.BundleContext;
@@ -64,7 +68,7 @@
* @author thomas.diesler(a)jboss.com
* @since 23-Jan-2009
*/
-public class MicrocontainerServiceImpl implements MicrocontainerService, MicrocontainerServiceMBean
+public class MicrocontainerServiceImpl implements DeployerService, MicrocontainerService, MicrocontainerServiceMBean
{
private BundleContext context;
private EmbeddedBeansDeployer deployer;
@@ -108,25 +112,34 @@
return context != null ? context.getTarget() : null;
}
- public void deploy(URL url) throws Exception
+ public void deploy(BundleInfo[] bundles) throws Exception
{
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+ List<Deployment> deployments = new ArrayList<Deployment>();
MainDeployer mainDeployer = (MainDeployer)getRegisteredBean("MainDeployer");
- VirtualFile file = VFS.createNewRoot(url);
- VFSDeployment deployment = deploymentFactory.createVFSDeployment(file);
- mainDeployer.addDeployment(deployment);
- String deploymentName = deployment.getName();
+ for (BundleInfo bundle : bundles)
+ {
+ VirtualFile file = VFS.createNewRoot(bundle.getLocation());
+ VFSDeployment deployment = deploymentFactory.createVFSDeployment(file);
+ mainDeployer.addDeployment(deployment);
+ deployments.add(deployment);
+ contextMap.put(bundle.getLocation(), deployment.getName());
+ }
+
+ // Process the deployments
mainDeployer.process();
- contextMap.put(url, deploymentName);
- mainDeployer.checkComplete(deployment);
+
+ // Check for completeness
+ Deployment[] depArr = deployments.toArray(new Deployment[deployments.size()]);
+ mainDeployer.checkComplete(depArr);
}
catch (IOException ex)
{
- DeploymentException.rethrowAsDeploymentException("Cannot deploy: " + url, ex);
+ DeploymentException.rethrowAsDeploymentException("Cannot deploy bundles: ", ex);
}
finally
{
@@ -134,24 +147,39 @@
}
}
- public void undeploy(URL url) throws Exception
+ public void undeploy(BundleInfo[] bundles) throws Exception
{
- String deploymentName = contextMap.remove(url);
- if (deploymentName != null)
+ MainDeployer mainDeployer = (MainDeployer)getRegisteredBean("MainDeployer");
+ for (BundleInfo bundle : bundles)
{
- MainDeployer mainDeployer = (MainDeployer)getRegisteredBean("MainDeployer");
- mainDeployer.removeDeployment(deploymentName);
- mainDeployer.process();
+ String deploymentName = contextMap.remove(bundle.getLocation());
+ if (deploymentName != null)
+ {
+ mainDeployer.removeDeployment(deploymentName);
+ }
+ else
+ {
+ log.log(LogService.LOG_WARNING, "Package not deployed: " + bundle.getLocation());
+ }
}
- else
- {
- log.log(LogService.LOG_WARNING, "Package not deployed: " + url);
- }
+ mainDeployer.process();
}
+ public void deploy(URL url) throws Exception
+ {
+ BundleInfo info = new LocationOnlyBundleInfo(url);
+ deploy(new BundleInfo[] { info });
+ }
+
+ public void undeploy(URL url) throws Exception
+ {
+ BundleInfo info = new LocationOnlyBundleInfo(url);
+ undeploy(new BundleInfo[] { info });
+ }
+
void start()
{
- final MicrocontainerService mcService = this;
+ final MicrocontainerService mcServiceImpl = this;
final Kernel kernel = getKernel();
final KernelController controller = kernel.getController();
@@ -177,8 +205,12 @@
// Register the MicrocontainerService
log.log(LogService.LOG_DEBUG, "Register MicrocontainerService");
- context.registerService(MicrocontainerService.class.getName(), mcService, null);
+ context.registerService(MicrocontainerService.class.getName(), mcServiceImpl, null);
+ // Register the DeployerService
+ log.log(LogService.LOG_DEBUG, "Register DeployerService");
+ context.registerService(DeployerService.class.getName(), mcServiceImpl, null);
+
// Register the MicrocontainerServiceMBean
registerMicrocontainerServiceMBean(mbeanServer);
@@ -253,4 +285,34 @@
super(name, actions, null, target);
}
}
+
+ static class LocationOnlyBundleInfo implements BundleInfo
+ {
+ private URL location;
+
+ public LocationOnlyBundleInfo(URL location)
+ {
+ this.location = location;
+ }
+
+ public URL getLocation()
+ {
+ return location;
+ }
+
+ public State getState()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getSymbolicName()
+ {
+ throw new NotImplementedException();
+ }
+
+ public String getVersion()
+ {
+ throw new NotImplementedException();
+ }
+ }
}
\ No newline at end of file
17 years, 1 month
JBoss-OSGI SVN: r89494 - in projects/jboss-osgi/trunk: 3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal and 29 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 08:41:59 -0400 (Thu, 28 May 2009)
New Revision: 89494
Added:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java
Removed:
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/LogServiceTracker.java
projects/jboss-osgi/trunk/bundles/logging/bin/.settings/
projects/jboss-osgi/trunk/bundles/logging/bin/src/
Modified:
projects/jboss-osgi/trunk/3rdparty/apache-xerces/pom.xml
projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java
projects/jboss-osgi/trunk/3rdparty/jbossxb/pom.xml
projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
projects/jboss-osgi/trunk/blueprint/impl/pom.xml
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
projects/jboss-osgi/trunk/bundles/common/pom.xml
projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java
projects/jboss-osgi/trunk/bundles/jmx/pom.xml
projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java
projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java
projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java
projects/jboss-osgi/trunk/bundles/jndi/pom.xml
projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/InitialContextServiceActivator.java
projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java
projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeansDeployer.java
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/mall/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/mall.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd
Log:
Move LogServiceTracker to common.log
Modified: projects/jboss-osgi/trunk/3rdparty/apache-xerces/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/apache-xerces/pom.xml 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/3rdparty/apache-xerces/pom.xml 2009-05-28 12:41:59 UTC (rev 89494)
@@ -85,7 +85,7 @@
org.xml.sax*,
<!-- import -->
- org.jboss.osgi.common;version=1.0,
+ org.jboss.osgi.common.log;version=1.0,
org.osgi.framework,
org.osgi.service.log,
org.osgi.util.xml,
Modified: projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -26,7 +26,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.SAXParserFactory;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/3rdparty/jbossxb/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jbossxb/pom.xml 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/3rdparty/jbossxb/pom.xml 2009-05-28 12:41:59 UTC (rev 89494)
@@ -78,7 +78,7 @@
com.wutka.dtd,
org.apache.xerces.*,
org.jboss.logging,
- org.jboss.osgi.common;version=1.0,
+ org.jboss.osgi.common.log;version=1.0,
org.jboss.util*,
org.osgi.framework,
org.osgi.service.log,
Modified: projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -26,7 +26,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.SAXParserFactory;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.xb.binding.parser.sax.SaxJBossXBParser;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/trunk/blueprint/impl/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-05-28 12:41:59 UTC (rev 89494)
@@ -65,7 +65,7 @@
<Import-Package>
org.apache.xerces.dom,
org.jboss.osgi.spi,
- org.jboss.osgi.common;version=1.0,
+ org.jboss.osgi.common.log;version=1.0,
org.jboss.xb.*,
org.osgi.framework,
org.osgi.service.log,
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -29,7 +29,7 @@
import org.jboss.osgi.blueprint.context.BlueprintContextImpl;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.Blueprint;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
Modified: projects/jboss-osgi/trunk/bundles/common/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/pom.xml 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/common/pom.xml 2009-05-28 12:41:59 UTC (rev 89494)
@@ -47,7 +47,6 @@
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.common.internal.CommonServicesActivator</Bundle-Activator>
<Export-Package>
- org.jboss.osgi.common;version=${version},
org.jboss.osgi.common.service;version=${version},
org.jboss.osgi.common.log;version=${version}
</Export-Package>
Deleted: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/LogServiceTracker.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/LogServiceTracker.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/LogServiceTracker.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -1,86 +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.common;
-
-//$Id$
-
-import org.jboss.osgi.common.service.SystemLogService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * A combined ServiceTracker/LogService that bundles can use to access the registered LogService.
- *
- * If a LogService is registered, the LogServiceTracker delegates to that LogService.
- * If there is no LogService registered, the LogServiceTracker delegates to the {@link SystemLogService}
- *
- *
- * @author thomas.diesler(a)jboss.com
- * @since 11-Apr-2009
- */
-public class LogServiceTracker extends ServiceTracker implements LogService
-{
- private LogService log;
-
- public LogServiceTracker(BundleContext context)
- {
- super(context, LogService.class.getName(), null);
- log = new SystemLogService(context);
- open();
- }
-
- @Override
- public Object addingService(ServiceReference reference)
- {
- log = (LogService)super.addingService(reference);
- return log;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- super.removedService(reference, service);
- log = new SystemLogService(context);
- }
-
- public void log(int level, String message)
- {
- log.log(level, message);
- }
-
- public void log(int level, String message, Throwable exception)
- {
- log.log(level, message, exception);
- }
-
- public void log(ServiceReference sr, int level, String message)
- {
- log.log(sr, level, message);
- }
-
- public void log(ServiceReference sr, int level, String message, Throwable exception)
- {
- log.log(sr, level, message, exception);
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java (from rev 89492, projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/LogServiceTracker.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -0,0 +1,86 @@
+/*
+ * 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.common.log;
+
+//$Id$
+
+import org.jboss.osgi.common.service.SystemLogService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * A combined ServiceTracker/LogService that bundles can use to access the registered LogService.
+ *
+ * If a LogService is registered, the LogServiceTracker delegates to that LogService.
+ * If there is no LogService registered, the LogServiceTracker delegates to the {@link SystemLogService}
+ *
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Apr-2009
+ */
+public class LogServiceTracker extends ServiceTracker implements LogService
+{
+ private LogService log;
+
+ public LogServiceTracker(BundleContext context)
+ {
+ super(context, LogService.class.getName(), null);
+ log = new SystemLogService(context);
+ open();
+ }
+
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ log = (LogService)super.addingService(reference);
+ return log;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ super.removedService(reference, service);
+ log = new SystemLogService(context);
+ }
+
+ public void log(int level, String message)
+ {
+ log.log(level, message);
+ }
+
+ public void log(int level, String message, Throwable exception)
+ {
+ log.log(level, message, exception);
+ }
+
+ public void log(ServiceReference sr, int level, String message)
+ {
+ log.log(sr, level, message);
+ }
+
+ public void log(ServiceReference sr, int level, String message, Throwable exception)
+ {
+ log.log(sr, level, message, exception);
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml 2009-05-28 12:41:59 UTC (rev 89494)
@@ -52,7 +52,7 @@
<Bundle-Activator>org.jboss.osgi.service.hotdeploy.internal.DeploymentScannerActivator</Bundle-Activator>
<Private-Package>org.jboss.osgi.service.hotdeploy.internal</Private-Package>
<Import-Package>
- org.jboss.osgi.common;version="1.0",
+ org.jboss.osgi.common.log;version="1.0",
org.jboss.osgi.common.service;version="1.0",
org.osgi.framework,
org.osgi.service.log,
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -36,7 +36,7 @@
import java.util.jar.JarFile;
import java.util.jar.Manifest;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.common.service.DeploymentScanner;
import org.jboss.osgi.common.service.DeploymentScanner.BundleInfo.State;
import org.osgi.framework.Bundle;
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.common.service.DeploymentScanner;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/bundles/jmx/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/pom.xml 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/jmx/pom.xml 2009-05-28 12:41:59 UTC (rev 89494)
@@ -66,7 +66,7 @@
javax.naming.spi,
<!-- jboss-osgi -->
- org.jboss.osgi.common;version="1.0",
+ org.jboss.osgi.common.log;version="1.0",
<!-- osgi -->
org.osgi.framework;version=1.4,
Modified: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -36,7 +36,7 @@
import javax.management.remote.JMXServiceURL;
import org.jboss.net.sockets.DefaultSocketFactory;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -28,7 +28,7 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -31,7 +31,7 @@
import javax.naming.Reference;
import javax.naming.StringRefAddr;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
Modified: projects/jboss-osgi/trunk/bundles/jndi/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/jndi/pom.xml 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/jndi/pom.xml 2009-05-28 12:41:59 UTC (rev 89494)
@@ -65,7 +65,7 @@
javax.net,
org.jboss.logging,
org.jboss.net.sockets,
- org.jboss.osgi.common;version="1.0",
+ org.jboss.osgi.common.log;version="1.0",
org.jboss.util.naming,
org.jboss.util.threadpool,
org.osgi.framework,
Modified: projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/InitialContextServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/InitialContextServiceActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/InitialContextServiceActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -25,7 +25,7 @@
import javax.naming.InitialContext;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
Modified: projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -33,7 +33,7 @@
import javax.naming.NamingException;
import org.jboss.net.sockets.DefaultSocketFactory;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jnp.interfaces.Naming;
import org.jnp.server.Main;
import org.jnp.server.NamingBean;
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml 2009-05-28 12:41:59 UTC (rev 89494)
@@ -104,7 +104,7 @@
org.jboss.deployers.*,
org.jboss.joinpoint.*,
org.jboss.logging,
- org.jboss.osgi.common;version="1.0",
+ org.jboss.osgi.common.log;version="1.0",
org.jboss.osgi.common.service;version="1.0",
org.jboss.osgi.spi;version="1.0",
org.jboss.osgi.spi.management;version="1.0",
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeansDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeansDeployer.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeansDeployer.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -27,7 +27,7 @@
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -48,7 +48,7 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.common.service.MicrocontainerService;
import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
import org.jboss.virtual.VFS;
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-28 12:41:59 UTC (rev 89494)
@@ -74,6 +74,7 @@
file://${osgi.home}/bundles/jboss-osgi-common.jar \
file://${osgi.home}/bundles/jboss-osgi-common-core.jar \
file://${osgi.home}/bundles/jboss-osgi-jmx.jar \
+ file://${osgi.home}/bundles/jboss-osgi-jaxb.jar \
file://${osgi.home}/bundles/jboss-osgi-apache-xerces.jar \
file://${osgi.home}/bundles/jboss-osgi-xml-binding.jar \
file://${osgi.home}/bundles/jboss-osgi-microcontainer.jar \
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -25,7 +25,7 @@
import static org.osgi.service.log.LogService.LOG_INFO;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -23,7 +23,7 @@
//$Id: ServiceA.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.jbosgi37.subA.PojoA;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -23,7 +23,7 @@
//$Id: ServiceB.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.jbosgi37.subB.PojoB;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -28,7 +28,7 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -27,7 +27,7 @@
import java.util.Dictionary;
import java.util.Hashtable;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.Configuration;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -23,7 +23,7 @@
//$Id: ServiceActivator.java 87336 2009-04-15 11:31:26Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -34,7 +34,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.ShoppingMall;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/mall/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/mall/ServiceActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/mall/ServiceActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.ShoppingMall;
import org.jboss.test.osgi.trailblazer.frontend.HttpRenderServlet;
import org.osgi.framework.BundleActivator;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -25,7 +25,7 @@
import java.util.Hashtable;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.PaymentService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -25,7 +25,7 @@
import java.util.Hashtable;
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.PaymentService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.Shop;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java 2009-05-28 12:41:59 UTC (rev 89494)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.Shop;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd 2009-05-28 12:41:59 UTC (rev 89494)
@@ -14,7 +14,7 @@
org.osgi.service.http, \
org.osgi.service.log, \
org.osgi.util.tracker, \
- org.jboss.osgi.common
+ org.jboss.osgi.common.log
Include-Resource: \
style/osgishop.css=../META-INF/style/osgishop.css, \
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/mall.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/mall.bnd 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/mall.bnd 2009-05-28 12:41:59 UTC (rev 89494)
@@ -9,6 +9,6 @@
Import-Package: \
org.osgi.framework, \
org.osgi.service.log, \
- org.jboss.osgi.common, \
+ org.jboss.osgi.common.log, \
org.jboss.test.osgi.trailblazer
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd 2009-05-28 12:41:59 UTC (rev 89494)
@@ -8,5 +8,5 @@
Import-Package: \
org.osgi.framework, \
org.osgi.service.log, \
- org.jboss.osgi.common, \
+ org.jboss.osgi.common.log, \
org.jboss.test.osgi.trailblazer
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd 2009-05-28 12:41:59 UTC (rev 89494)
@@ -8,5 +8,5 @@
Import-Package: \
org.osgi.framework, \
org.osgi.service.log, \
- org.jboss.osgi.common, \
+ org.jboss.osgi.common.log, \
org.jboss.test.osgi.trailblazer
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd 2009-05-28 12:41:59 UTC (rev 89494)
@@ -8,5 +8,5 @@
Import-Package: \
org.osgi.framework, \
org.osgi.service.log, \
- org.jboss.osgi.common, \
+ org.jboss.osgi.common.log, \
org.jboss.test.osgi.trailblazer
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd 2009-05-28 12:23:40 UTC (rev 89493)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd 2009-05-28 12:41:59 UTC (rev 89494)
@@ -10,5 +10,5 @@
org.osgi.framework, \
org.osgi.service.log, \
org.jboss.osgi.jndi, \
- org.jboss.osgi.common, \
+ org.jboss.osgi.common.log, \
org.jboss.test.osgi.trailblazer
17 years, 1 month
JBoss-OSGI SVN: r89493 - projects/jboss-osgi/trunk/distribution/runtime/conf.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 08:23:40 -0400 (Thu, 28 May 2009)
New Revision: 89493
Modified:
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
Log:
Bootstrap MC service
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-28 12:21:21 UTC (rev 89492)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-28 12:23:40 UTC (rev 89493)
@@ -72,6 +72,9 @@
org.jboss.osgi.spi.framework.autoStart=\
file://${osgi.home}/bundles/org.apache.felix.log.jar \
file://${osgi.home}/bundles/jboss-osgi-common.jar \
+ file://${osgi.home}/bundles/jboss-osgi-common-core.jar \
file://${osgi.home}/bundles/jboss-osgi-jmx.jar \
+ file://${osgi.home}/bundles/jboss-osgi-apache-xerces.jar \
+ file://${osgi.home}/bundles/jboss-osgi-xml-binding.jar \
file://${osgi.home}/bundles/jboss-osgi-microcontainer.jar \
- file://${osgi.home}/bundles/jboss-osgi-hotdeploy.jar
+ file://${osgi.home}/bundles/jboss-osgi-hotdeploy.jar
\ No newline at end of file
17 years, 1 month
JBoss-OSGI SVN: r89492 - in projects/jboss-osgi/trunk: 3rdparty and 71 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-28 08:21:21 -0400 (Thu, 28 May 2009)
New Revision: 89492
Added:
projects/jboss-osgi/trunk/3rdparty/.project
projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XMLParserActivatorExt.java
projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/resources/
projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/resources/META-INF/
projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
projects/jboss-osgi/trunk/bundles/.project
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/LogServiceTracker.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/LoggingLogListener.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScanner.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/SystemLogService.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java
projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java
projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/InitialContextServiceActivator.java
projects/jboss-osgi/trunk/bundles/logging/bin/
projects/jboss-osgi/trunk/bundles/logging/bin/.project
projects/jboss-osgi/trunk/bundles/logging/bin/.settings/
projects/jboss-osgi/trunk/bundles/logging/bin/src/
projects/jboss-osgi/trunk/bundles/logging/bin/src/main/
projects/jboss-osgi/trunk/bundles/logging/bin/src/main/java/
projects/jboss-osgi/trunk/bundles/logging/bin/src/main/java/org/
projects/jboss-osgi/trunk/bundles/logging/bin/src/main/java/org/jboss/
projects/jboss-osgi/trunk/bundles/logging/bin/src/main/java/org/jboss/osgi/
projects/jboss-osgi/trunk/bundles/logging/bin/src/main/java/org/jboss/osgi/service/
projects/jboss-osgi/trunk/bundles/logging/bin/src/main/java/org/jboss/osgi/service/logging/
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceActivator.java
projects/jboss-osgi/trunk/integration/.project
projects/jboss-osgi/trunk/runtime/.project
Removed:
projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/Activator.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/internal/
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/BundleInfo.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScanner.java
projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/ServiceActivator.java
projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/ServiceActivator.java
projects/jboss-osgi/trunk/bundles/logging/.classpath
projects/jboss-osgi/trunk/bundles/logging/.settings/
projects/jboss-osgi/trunk/bundles/logging/pom.xml
projects/jboss-osgi/trunk/bundles/logging/src/
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/ServiceActivator.java
Modified:
projects/jboss-osgi/trunk/3rdparty/apache-xerces/.classpath
projects/jboss-osgi/trunk/3rdparty/apache-xerces/pom.xml
projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java
projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/resources/META-INF/services/javax.xml.parsers.DocumentBuilderFactory
projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/resources/META-INF/services/javax.xml.parsers.SAXParserFactory
projects/jboss-osgi/trunk/3rdparty/jbossxb/pom.xml
projects/jboss-osgi/trunk/blueprint/impl/pom.xml
projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
projects/jboss-osgi/trunk/blueprint/testsuite/pom.xml
projects/jboss-osgi/trunk/blueprint/testsuite/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd
projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/bundles/common/pom.xml
projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java
projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java
projects/jboss-osgi/trunk/bundles/jmx/pom.xml
projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java
projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java
projects/jboss-osgi/trunk/bundles/jndi/pom.xml
projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java
projects/jboss-osgi/trunk/bundles/logging/.project
projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeansDeployer.java
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/bundles/pom.xml
projects/jboss-osgi/trunk/distribution/pom.xml
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/husky/harness/pom.xml
projects/jboss-osgi/trunk/husky/pom.xml
projects/jboss-osgi/trunk/husky/testsuite/pom.xml
projects/jboss-osgi/trunk/husky/testsuite/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd
projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/pom.xml
projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/mall/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/mall.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd
projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd
Log:
Merge jboss-osgi-logging with jboss-osgi-common
Register XML parser fatories as services
Added: projects/jboss-osgi/trunk/3rdparty/.project
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/.project (rev 0)
+++ projects/jboss-osgi/trunk/3rdparty/.project 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-3rdparty</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: projects/jboss-osgi/trunk/3rdparty/apache-xerces/.classpath
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/apache-xerces/.classpath 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/3rdparty/apache-xerces/.classpath 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" 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="output" path="target/classes"/>
Modified: projects/jboss-osgi/trunk/3rdparty/apache-xerces/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/apache-xerces/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/3rdparty/apache-xerces/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -43,7 +43,15 @@
<version>${version.xml.resolver}</version>
</dependency>
+ <!-- Bundle Dependencies -->
<dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- OSGi Dependencies -->
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
@@ -76,8 +84,10 @@
org.w3c.dom*,
org.xml.sax*,
- <!-- osgi -->
+ <!-- import -->
+ org.jboss.osgi.common;version=1.0,
org.osgi.framework,
+ org.osgi.service.log,
org.osgi.util.xml,
<!-- ignore -->
Added: projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XMLParserActivatorExt.java
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XMLParserActivatorExt.java (rev 0)
+++ projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XMLParserActivatorExt.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,518 @@
+/*
+ * $Header: /cvshome/build/org.osgi.util.xml/src/org/osgi/util/xml/XMLParserActivator.java,v 1.11 2006/10/27 18:17:06 hargrave Exp $
+ *
+ * Copyright (c) OSGi Alliance (2002, 2006). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.osgi.apache.xerces.internal;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceFactory;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * This is a copy of the {@link XMLParserActivatorExt} mentioned in the CVS
+ * Header above with added XInclude support.
+ *
+ * Using this copy is a workarround for issue
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-92
+ *
+ * A BundleActivator class that allows any JAXP compliant XML Parser to register
+ * itself as an OSGi parser service.
+ *
+ * Multiple JAXP compliant parsers can concurrently register by using this
+ * BundleActivator class. Bundles who wish to use an XML parser can then use the
+ * framework's service registry to locate available XML Parsers with the desired
+ * characteristics such as validating and namespace-aware.
+ *
+ * <p>
+ * The services that this bundle activator enables a bundle to provide are:
+ * <ul>
+ * <li><code>javax.xml.parsers.SAXParserFactory</code>({@link #SAXFACTORYNAME})
+ * <li><code>javax.xml.parsers.DocumentBuilderFactory</code>(
+ * {@link #DOMFACTORYNAME})
+ * </ul>
+ *
+ * <p>
+ * The algorithm to find the implementations of the abstract parsers is derived
+ * from the JAR file specifications, specifically the Services API.
+ * <p>
+ * An XMLParserActivator assumes that it can find the class file names of the
+ * factory classes in the following files:
+ * <ul>
+ * <li><code>/META-INF/services/javax.xml.parsers.SAXParserFactory</code> is
+ * a file contained in a jar available to the runtime which contains the
+ * implementation class name(s) of the SAXParserFactory.
+ * <li><code>/META-INF/services/javax.xml.parsers.DocumentBuilderFactory</code>
+ * is a file contained in a jar available to the runtime which contains the
+ * implementation class name(s) of the <code>DocumentBuilderFactory</code>
+ * </ul>
+ * <p>
+ * If either of the files does not exist, <code>XMLParserActivator</code>
+ * assumes that the parser does not support that parser type.
+ *
+ * <p>
+ * <code>XMLParserActivator</code> attempts to instantiate both the
+ * <code>SAXParserFactory</code> and the <code>DocumentBuilderFactory</code>.
+ * It registers each factory with the framework along with service properties:
+ * <ul>
+ * <li>{@link #PARSER_VALIDATING}- indicates if this factory supports
+ * validating parsers. It's value is a <code>Boolean</code>.
+ * <li>{@link #PARSER_NAMESPACEAWARE}- indicates if this factory supports
+ * namespace aware parsers It's value is a <code>Boolean</code>.
+ * </ul>
+ * <p>
+ * Individual parser implementations may have additional features, properties,
+ * or attributes which could be used to select a parser with a filter. These can
+ * be added by extending this class and overriding the
+ * <code>setSAXProperties</code> and <code>setDOMProperties</code> methods.
+ */
+public class XMLParserActivatorExt implements BundleActivator, ServiceFactory
+{
+ /* * Context of this bundle */
+ 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";
+ /*
+ * * 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";
+ /* * Path to the factory class name files */
+ 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;
+ /* * Fully qualified path name of DOM Parser Factory Class Name file */
+ public static final String DOMCLASSFILE = PARSERCLASSFILEPATH + DOMFACTORYNAME;
+ /* * SAX Factory Service Description */
+ private static final String SAXFACTORYDESCRIPTION = "A JAXP Compliant SAX Parser";
+ /* * DOM Factory Service Description */
+ 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";
+ /*
+ * * 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";
+ /*
+ * * Service property specifying if factory is configured to support XInclude aware parsers. The value is of type <code>Boolean</code>.
+ */
+ public static final String PARSER_XINCLUDEAWARE = "parser.xincludeAware";
+ /*
+ * * 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";
+
+ /*
+ * * Called when this bundle is started so the Framework can perform the bundle-specific activities necessary to start this bundle. This method can be used to
+ * register services or to allocate any resources that this bundle needs. <p> This method must complete and return to its caller in a timely manner. <p> This method
+ * attempts to register a SAX and DOM parser with the Framework's service registry.
+ * @param context The execution context of the bundle being started.
+ * @throws java.lang.Exception If this method throws an exception, this bundle is marked as stopped and the Framework will remove this 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
+ {
+ this.context = context;
+ Bundle parserBundle = context.getBundle();
+ try
+ {
+ // check for sax parsers
+ registerSAXParsers(getParserFactoryClassNames(parserBundle.getResource(SAXCLASSFILE)));
+ // check for dom parsers
+ registerDOMParsers(getParserFactoryClassNames(parserBundle.getResource(DOMCLASSFILE)));
+ }
+ catch (IOException ioe)
+ {
+ // if there were any IO errors accessing the resource files
+ // containing the class names
+ ioe.printStackTrace();
+ throw new FactoryConfigurationError(ioe);
+ }
+ }
+
+ /*
+ * * This method has nothing to do as all active service registrations will automatically get unregistered when the bundle stops.
+ * @param context The execution context of the bundle being stopped.
+ * @throws java.lang.Exception If this method throws an exception, the bundle is still marked as stopped, and the Framework will remove 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
+ {
+ }
+
+ /*
+ * * Given the URL for a file, reads and returns the parser class names. There may be multiple classes specified in this file, one per line. There may also be
+ * comment lines in the file, which begin with "#".
+ * @param parserUrl The URL of the service file containing the parser class names
+ * @return A vector of strings containing the parser class names or null if parserUrl is null
+ * @throws IOException if there is a problem reading the URL input stream
+ */
+ private Vector getParserFactoryClassNames(URL parserUrl) throws IOException
+ {
+ Vector v = new Vector(1);
+ if (parserUrl != null)
+ {
+ String parserFactoryClassName = null;
+ InputStream is = parserUrl.openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(is));
+ while (true)
+ {
+ parserFactoryClassName = br.readLine();
+ if (parserFactoryClassName == null)
+ {
+ break; // end of file reached
+ }
+ String pfcName = parserFactoryClassName.trim();
+ if (pfcName.length() == 0)
+ {
+ continue; // blank line
+ }
+ int commentIdx = pfcName.indexOf("#");
+ if (commentIdx == 0)
+ { // comment line
+ continue;
+ }
+ else if (commentIdx < 0)
+ { // no comment on this line
+ v.addElement(pfcName);
+ }
+ else
+ {
+ v.addElement(pfcName.substring(0, commentIdx).trim());
+ }
+ }
+ return v;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /*
+ * * Register SAX Parser Factory Services with the framework.
+ * @param parserFactoryClassNames - a <code>Vector</code> of <code>String</code> objects containing the names of the parser Factory Classes
+ * @throws FactoryConfigurationError if thrown from <code>getFactory</code>
+ */
+ 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();
+ // 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);
+ Hashtable properties = new Hashtable(7);
+ // figure out the default properties of the parser
+ setDefaultSAXProperties(factory, properties, index);
+ // store the parser factory class name in the properties so that
+ // it can be retrieved when getService is called
+ // to return a parser factory
+ properties.put(FACTORYNAMEKEY, parserFactoryClassName);
+ // release the factory
+ factory = null;
+ // register the factory as a service
+ context.registerService(SAXFACTORYNAME, this, properties);
+ index++;
+ }
+ }
+ }
+
+ /*
+ * * <p> Set the SAX Parser Service Properties. By default, the following properties are set: <ul> <li><code>SERVICE_DESCRIPTION</code> <li><code>SERVICE_PID</code>
+ * <li><code>PARSER_VALIDATING</code>- instantiates a parser and queries it to find out whether it is validating or not <li><code>PARSER_NAMESPACEAWARE</code>-
+ * instantiates a parser and queries it to find out whether it is namespace aware or not <ul>
+ * @param factory The <code>SAXParserFactory</code> object
+ * @param props <code>Hashtable</code> of service properties.
+ */
+ 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);
+ setSAXProperties(factory, props);
+ }
+
+ /*
+ * * <p> Set the customizable SAX Parser Service Properties. <p> This method attempts to instantiate a validating parser and a namespaceaware parser to determine if
+ * the parser can support those features. The appropriate properties are then set in the specified properties object. <p> This method can be overridden to add
+ * additional SAX2 features and properties. If you want to be able to filter searches of the OSGi service registry, this method must put a key, value pair into the
+ * properties object for each feature or property. For example, properties.put("http://www.acme.com/features/foo", Boolean.TRUE);
+ * @param factory - the SAXParserFactory object
+ * @param properties - the properties object for the service
+ */
+ public void setSAXProperties(SAXParserFactory factory, Hashtable props)
+ {
+ // check if this parser can be configured to validate
+ boolean validating = true;
+ factory.setValidating(true);
+ factory.setNamespaceAware(false);
+ try
+ {
+ factory.newSAXParser();
+ }
+ 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
+ {
+ factory.newSAXParser();
+ }
+ catch (Exception pce_nsa)
+ {
+ namespaceaware = false;
+ }
+
+ // check if this parser can be configured to be xinclude aware
+ boolean xinclude = true;
+ factory.setValidating(validating);
+ factory.setNamespaceAware(namespaceaware);
+ factory.setXIncludeAware(true);
+ try
+ {
+ factory.newSAXParser();
+ }
+ catch (Exception pce_inc)
+ {
+ xinclude = false;
+ }
+
+ // set the factory values
+ factory.setValidating(validating);
+ factory.setNamespaceAware(namespaceaware);
+ factory.setXIncludeAware(xinclude);
+
+ // set the OSGi service properties
+ props.put(PARSER_NAMESPACEAWARE, new Boolean(namespaceaware));
+ props.put(PARSER_VALIDATING, new Boolean(validating));
+ props.put(PARSER_XINCLUDEAWARE, new Boolean(xinclude));
+ }
+
+ /*
+ * * Register DOM Parser Factory Services with the framework.
+ * @param parserFactoryClassNames - a <code>Vector</code> of <code>String</code> objects containing the names of the parser Factory Classes
+ * @throws FactoryConfigurationError if thrown from <code>getFactory</code>
+ */
+ 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();
+ // 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);
+ Hashtable properties = new Hashtable(7);
+ // figure out the default properties of the parser
+ setDefaultDOMProperties(factory, properties, index);
+ // store the parser factory class name in the properties so that
+ // it can be retrieved when getService is called
+ // to return a parser factory
+ properties.put(FACTORYNAMEKEY, parserFactoryClassName);
+ // release the factory
+ factory = null;
+ // register the factory as a service
+ context.registerService(DOMFACTORYNAME, this, properties);
+ index++;
+ }
+ }
+ }
+
+ /*
+ * * Set the DOM parser service properties. By default, the following properties are set: <ul> <li><code>SERVICE_DESCRIPTION</code> <li><code>SERVICE_PID</code>
+ * <li><code>PARSER_VALIDATING</code> <li><code>PARSER_NAMESPACEAWARE</code> <ul>
+ * @param factory The <code>DocumentBuilderFactory</code> object
+ * @param props <code>Hashtable</code> of service properties.
+ */
+ 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);
+ setDOMProperties(factory, props);
+ }
+
+ /*
+ * * <p> Set the customizable DOM Parser Service Properties. <p> This method attempts to instantiate a validating parser and a namespaceaware parser to determine if
+ * the parser can support those features. The appropriate properties are then set in the specified props object. <p> This method can be overridden to add additional
+ * DOM2 features and properties. If you want to be able to filter searches of the OSGi service registry, this method must put a key, value pair into the properties
+ * object for each feature or property. For example, properties.put("http://www.acme.com/features/foo", Boolean.TRUE);
+ * @param factory - the DocumentBuilderFactory object
+ * @param props - Hashtable of service properties.
+ */
+ 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
+ {
+ factory.newDocumentBuilder();
+ }
+ 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
+ {
+ factory.newDocumentBuilder();
+ }
+ catch (Exception pce_nsa)
+ {
+ namespaceaware = false;
+ }
+
+ // check if this parser can be configured to be xinclude aware
+ boolean xinclude = true;
+ factory.setValidating(validating);
+ factory.setNamespaceAware(namespaceaware);
+ factory.setXIncludeAware(true);
+ try
+ {
+ factory.newDocumentBuilder();
+ }
+ catch (Exception pce_inc)
+ {
+ xinclude = false;
+ }
+
+ // set the factory values
+ factory.setValidating(validating);
+ factory.setNamespaceAware(namespaceaware);
+ factory.setXIncludeAware(xinclude);
+
+ // set the OSGi service properties
+ props.put(PARSER_VALIDATING, new Boolean(validating));
+ props.put(PARSER_NAMESPACEAWARE, new Boolean(namespaceaware));
+ props.put(PARSER_XINCLUDEAWARE, new Boolean(xinclude));
+ }
+
+ /*
+ * * Given a parser factory class name, instantiate that class.
+ * @param parserFactoryClassName A <code>String</code> object containing the name of the parser factory class
+ * @return a parserFactoryClass Object
+ * @pre parserFactoryClassName!=null
+ */
+ private Object getFactory(String parserFactoryClassName) throws FactoryConfigurationError
+ {
+ Exception e = null;
+ try
+ {
+ return Class.forName(parserFactoryClassName).newInstance();
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ e = cnfe;
+ }
+ catch (InstantiationException ie)
+ {
+ e = ie;
+ }
+ catch (IllegalAccessException iae)
+ {
+ e = iae;
+ }
+ throw new FactoryConfigurationError(e);
+ }
+
+ /*
+ * * Creates a new XML Parser Factory object. <p> A unique XML Parser Factory object is returned for each call to this method. <p> The returned XML Parser Factory
+ * object will be configured for validating and namespace aware support as specified in the service properties of the specified ServiceRegistration object. This
+ * method can be overridden to configure additional features in the returned XML Parser Factory object.
+ * @param bundle The bundle using the service.
+ * @param registration The <code>ServiceRegistration</code> object for the service.
+ * @return A new, configured XML Parser Factory object or null if a configuration error was encountered
+ */
+ public Object getService(Bundle bundle, ServiceRegistration registration)
+ {
+ ServiceReference sref = registration.getReference();
+ 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());
+ }
+ 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)
+ {
+ fce.printStackTrace();
+ return null;
+ }
+ }
+
+ /*
+ * * Releases a XML Parser Factory object.
+ * @param bundle The bundle releasing the service.
+ * @param registration The <code>ServiceRegistration</code> object for the service.
+ * @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)
+ {
+ }
+}
Property changes on: projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XMLParserActivatorExt.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/java/org/jboss/osgi/apache/xerces/internal/XercesParserActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,38 +23,71 @@
//$Id$
-import org.osgi.framework.BundleActivator;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.jboss.osgi.common.LogServiceTracker;
import org.osgi.framework.BundleContext;
-import org.osgi.util.xml.XMLParserActivator;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
/**
- * Activat the XML parser using {@link XMLParserActivator}
+ * Activate the XML parser using {@link XMLParserActivatorExt}
*
* @author thomas.diesler(a)jboss.com
* @since 29-Apr-2009
*/
-public class XercesParserActivator implements BundleActivator
+public class XercesParserActivator extends XMLParserActivatorExt
{
- private XMLParserActivator parserActivator;
+ private LogService log;
- public void start(BundleContext context)
+ public void start(BundleContext context) throws Exception
{
- try
+ super.start(context);
+
+ log = new LogServiceTracker(context);
+
+ logSAXParserFactory(context);
+ logDOMParserFactory(context);
+ }
+
+ private void logSAXParserFactory(BundleContext context)
+ {
+ ServiceReference saxRef = context.getServiceReference(SAXParserFactory.class.getName());
+ if (saxRef != null)
{
- parserActivator = new XMLParserActivator();
- parserActivator.start(context);
+ Object factory = context.getService(saxRef);
+ log.log(LogService.LOG_DEBUG, "SAXParserFactory: " + factory.getClass().getName());
+
+ for (String key : saxRef.getPropertyKeys())
+ {
+ Object value = saxRef.getProperty(key);
+ log.log(LogService.LOG_DEBUG, " " + key + "=" + value);
+ }
}
- catch (Exception ex)
+ else
{
- throw new IllegalStateException("Cannot activate XML parser", ex);
+ log.log(LogService.LOG_WARNING, "No SAXParserFactory registered");
}
}
- public void stop(BundleContext context) throws Exception
+ private void logDOMParserFactory(BundleContext context)
{
- if (parserActivator != null)
+ ServiceReference domRef = context.getServiceReference(DocumentBuilderFactory.class.getName());
+ if (domRef != null)
{
- parserActivator.stop(context);
+ Object factory = context.getService(domRef);
+ log.log(LogService.LOG_DEBUG, "DocumentBuilderFactory: " + factory.getClass().getName());
+
+ for (String key : domRef.getPropertyKeys())
+ {
+ Object value = domRef.getProperty(key);
+ log.log(LogService.LOG_DEBUG, " " + key + "=" + value);
+ }
}
+ else
+ {
+ log.log(LogService.LOG_WARNING, "No DocumentBuilderFactory registered");
+ }
}
}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/resources/META-INF (from rev 89486, projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/resources/META-INF)
Modified: projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/resources/META-INF/services/javax.xml.parsers.DocumentBuilderFactory
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/resources/META-INF/services/javax.xml.parsers.DocumentBuilderFactory 2009-05-28 05:30:41 UTC (rev 89486)
+++ projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/resources/META-INF/services/javax.xml.parsers.DocumentBuilderFactory 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1 +1 @@
-org.jboss.osgi.jbossxb.internal.DocumentBuilderFactoryOSGi
\ No newline at end of file
+org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/resources/META-INF/services/javax.xml.parsers.SAXParserFactory
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/resources/META-INF/services/javax.xml.parsers.SAXParserFactory 2009-05-28 05:30:41 UTC (rev 89486)
+++ projects/jboss-osgi/trunk/3rdparty/apache-xerces/src/main/resources/META-INF/services/javax.xml.parsers.SAXParserFactory 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1 +1 @@
-org.jboss.osgi.jbossxb.internal.SAXParserFactoryOSGi
\ No newline at end of file
+org.apache.xerces.jaxp.SAXParserFactoryImpl
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/3rdparty/jbossxb/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jbossxb/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/3rdparty/jbossxb/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -35,6 +35,13 @@
<version>${version.javassist}</version>
</dependency>
+ <!-- Bundle Dependencies -->
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
<!-- Provided Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
@@ -56,7 +63,7 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.jbossxb.internal.Activator</Bundle-Activator>
+ <Bundle-Activator>org.jboss.osgi.jbossxb.internal.XMLBindingActivator</Bundle-Activator>
<Embed-Transitive>true</Embed-Transitive>
<Import-Package>
<!-- system -->
@@ -70,7 +77,8 @@
<!-- import -->
com.wutka.dtd,
org.apache.xerces.*,
- org.jboss.logging,
+ org.jboss.logging,
+ org.jboss.osgi.common;version=1.0,
org.jboss.util*,
org.osgi.framework,
org.osgi.service.log,
Deleted: projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/Activator.java
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/Activator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/Activator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,68 +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.jbossxb.internal;
-
-//$Id$
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.jboss.logging.Logger;
-import org.jboss.xb.binding.parser.sax.SaxJBossXBParser;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * A {@link BundleActivator} that initializes the JBossXB bundle
- *
- * @author thomas.diesler(a)jboss.com
- * @since 13-May-2009
- */
-public class Activator implements BundleActivator
-{
- // Provide logging
- final Logger log = Logger.getLogger(Activator.class);
-
- public void start(BundleContext context) throws Exception
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- String saxFactory = SAXParserFactory.newInstance().getClass().getName();
- String domFactory = DocumentBuilderFactory.newInstance().getClass().getName();
- log.info("JBossXB started: SAXParserFactory=" + saxFactory + ",DocumentBuilderFactory=" + domFactory);
-
- // SaxJBossXBParser initializes the SAXParserFactory in a static block
- // using SAXParserFactory.newInstance(), which internally uses the TCCL
- new SaxJBossXBParser();
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
- }
-
- public void stop(BundleContext context) throws Exception
- {
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java (from rev 89486, projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/Activator.java)
===================================================================
--- projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/3rdparty/jbossxb/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,73 @@
+/*
+ * 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.jbossxb.internal;
+
+//$Id$
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.xb.binding.parser.sax.SaxJBossXBParser;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+/**
+ * A {@link BundleActivator} that initializes the JBossXB bundle
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class XMLBindingActivator implements BundleActivator
+{
+ private LogService log;
+
+ public void start(BundleContext context) throws Exception
+ {
+ log = new LogServiceTracker(context);
+
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+
+ SAXParserFactory saxFactory = SAXParserFactory.newInstance();
+ log.log(LogService.LOG_DEBUG, "JBossXB SAXParserFactory: " + saxFactory);
+
+ DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
+ log.log(LogService.LOG_DEBUG, "JBossXB DocumentBuilderFactory: " + domFactory);
+
+ // SaxJBossXBParser initializes the SAXParserFactory in a static block
+ // using SAXParserFactory.newInstance(), which internally uses the TCCL
+ new SaxJBossXBParser();
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+
+ public void stop(BundleContext context) throws Exception
+ {
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/blueprint/impl/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/blueprint/impl/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -65,7 +65,7 @@
<Import-Package>
org.apache.xerces.dom,
org.jboss.osgi.spi,
- org.jboss.osgi.common.log,
+ org.jboss.osgi.common;version=1.0,
org.jboss.xb.*,
org.osgi.framework,
org.osgi.service.log,
Modified: projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/blueprint/impl/src/main/java/org/jboss/osgi/blueprint/extender/BlueprintExtender.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -29,7 +29,7 @@
import org.jboss.osgi.blueprint.context.BlueprintContextImpl;
import org.jboss.osgi.blueprint.parser.BlueprintParser;
import org.jboss.osgi.blueprint.reflect.Blueprint;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -82,11 +82,6 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-microcontainer</artifactId>
<scope>provided</scope>
</dependency>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/scripts/assembly-bundles.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/scripts/assembly-bundles.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -22,7 +22,6 @@
<include>*:jboss-osgi-husky:jar</include>
<include>*:jboss-osgi-jaxb:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
- <include>*:jboss-osgi-logging:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
<include>*:org.apache.felix.log:jar</include>
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/java/org/jboss/test/osgi/blueprint/context/BlueprintContextTestCase.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -80,7 +80,9 @@
{
if (context == null)
{
- bundle.uninstall();
+ if (bundle != null)
+ bundle.uninstall();
+
runtime.shutdown();
}
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/context/context-basic.bnd 2009-05-28 12:21:21 UTC (rev 89492)
@@ -16,3 +16,5 @@
OSGI-INF/blueprint=OSGI-INF/blueprint
Test-Package: org.jboss.test.osgi.blueprint.context
+
+-removeheaders: Include-Resource
Modified: projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/blueprint/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-05-28 12:21:21 UTC (rev 89492)
@@ -17,15 +17,15 @@
# Extra System Packages
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
- org.jboss.osgi.spi, \
- org.jboss.osgi.spi.management, \
- org.jboss.osgi.spi.testing, \
+ org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.management;version=1.0, \
+ org.jboss.osgi.spi.testing;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
org.jboss.virtual.plugins.vfs.helpers, \
org.jboss.virtual.protocol, \
- org.osgi.framework; version\=1.4
+ org.osgi.framework;version=1.4
# Bundles that need to be installed with the Framework automatically
org.jboss.osgi.spi.framework.autoInstall=\
@@ -34,6 +34,5 @@
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-logging.jar
+ file://${test.archive.directory}/bundles/jboss-osgi-common.jar
\ No newline at end of file
Added: projects/jboss-osgi/trunk/bundles/.project
===================================================================
--- projects/jboss-osgi/trunk/bundles/.project (rev 0)
+++ projects/jboss-osgi/trunk/bundles/.project 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-bundles</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: projects/jboss-osgi/trunk/bundles/common/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/common/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -45,14 +45,17 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+ <Bundle-Activator>org.jboss.osgi.common.internal.CommonServicesActivator</Bundle-Activator>
<Export-Package>
- org.jboss.osgi.common,
- org.jboss.osgi.common.log
+ org.jboss.osgi.common;version=${version},
+ org.jboss.osgi.common.service;version=${version},
+ org.jboss.osgi.common.log;version=${version}
</Export-Package>
<Private-Package>
- org.jboss.osgi.common.log.internal
+ org.jboss.osgi.common.internal
</Private-Package>
<Import-Package>
+ org.jboss.logging,
org.osgi.framework;version=1.4,
org.osgi.service.log;version=1.3,
org.osgi.util.tracker
Copied: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/LogServiceTracker.java (from rev 89486, projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/LogServiceTracker.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/LogServiceTracker.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,86 @@
+/*
+ * 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.common;
+
+//$Id$
+
+import org.jboss.osgi.common.service.SystemLogService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * A combined ServiceTracker/LogService that bundles can use to access the registered LogService.
+ *
+ * If a LogService is registered, the LogServiceTracker delegates to that LogService.
+ * If there is no LogService registered, the LogServiceTracker delegates to the {@link SystemLogService}
+ *
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Apr-2009
+ */
+public class LogServiceTracker extends ServiceTracker implements LogService
+{
+ private LogService log;
+
+ public LogServiceTracker(BundleContext context)
+ {
+ super(context, LogService.class.getName(), null);
+ log = new SystemLogService(context);
+ open();
+ }
+
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ log = (LogService)super.addingService(reference);
+ return log;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ super.removedService(reference, service);
+ log = new SystemLogService(context);
+ }
+
+ public void log(int level, String message)
+ {
+ log.log(level, message);
+ }
+
+ public void log(int level, String message, Throwable exception)
+ {
+ log.log(level, message, exception);
+ }
+
+ public void log(ServiceReference sr, int level, String message)
+ {
+ log.log(sr, level, message);
+ }
+
+ public void log(ServiceReference sr, int level, String message, Throwable exception)
+ {
+ log.log(sr, level, message, exception);
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java (from rev 89486, projects/jboss-osgi/trunk/bundles/logging/src/main/java/org/jboss/osgi/service/logging/LoggingActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/CommonServicesActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,60 @@
+/*
+ * 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.common.internal;
+
+//$Id$
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * The common services activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public class CommonServicesActivator implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ // Track LogReaderService and add/remove LogListener
+ ServiceTracker logTracker = new ServiceTracker(context, LogReaderService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ LogReaderService logReader = (LogReaderService)super.addingService(reference);
+ logReader.addLogListener(new LoggingLogListener());
+ return logReader;
+ }
+ };
+ logTracker.open();
+ }
+
+ public void stop(BundleContext context)
+ {
+ // NOTE: The service is automatically unregistered.
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java (from rev 89486, projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/internal/LogEntryImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/LogEntryImpl.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,137 @@
+/*
+ * 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.common.internal;
+
+// $Id$
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogService;
+
+/**
+ * A unified implementation of a LogEntry.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogEntryImpl implements LogEntry
+{
+ private long time;
+ private int level;
+ private Bundle bundle;
+ private ServiceReference sref;
+ private String message;
+ private Throwable exception;
+
+ private String bndStr;
+ private String srefStr;
+
+ public LogEntryImpl(LogEntry le)
+ {
+ this(le.getTime(), le.getBundle(), le.getServiceReference(), le.getLevel(), le.getMessage(), le.getException());
+ }
+
+ public LogEntryImpl(long time, Bundle bundle, ServiceReference sref, int level, String message, Throwable exception)
+ {
+ this.time = time;
+ this.bundle = bundle;
+ this.sref = sref;
+ this.level = level;
+ this.message = message;
+ this.exception = exception;
+
+ if (bundle != null)
+ bndStr = bundle.getSymbolicName();
+
+ if (sref != null && sref.getBundle() != null)
+ srefStr = sref.getBundle().getSymbolicName();
+ }
+
+ public Bundle getBundle()
+ {
+ return bundle;
+ }
+
+ public Throwable getException()
+ {
+ return exception;
+ }
+
+ public int getLevel()
+ {
+ return level;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public ServiceReference getServiceReference()
+ {
+ return sref;
+ }
+
+ public long getTime()
+ {
+ return time;
+ }
+
+ private String logLevel(int level)
+ {
+ String logLevel;
+ switch (level)
+ {
+ case LogService.LOG_DEBUG:
+ logLevel = "DEBUG";
+ break;
+ case LogService.LOG_INFO:
+ logLevel = "INFO";
+ break;
+ case LogService.LOG_WARNING:
+ logLevel = "WARN";
+ break;
+ case LogService.LOG_ERROR:
+ logLevel = "ERROR";
+ break;
+ default:
+ logLevel = "Level=" + level;
+ }
+ return logLevel;
+ }
+
+ @Override
+ public String toString()
+ {
+ String t = new SimpleDateFormat("dd-MMM-yyyy HH:mm.ss.SSS").format(new Date(time));
+ String l = " " + logLevel(level);
+ String s = srefStr != null ? ",sref=" + srefStr : "";
+ String b = ",bnd=" + bndStr;
+ String m = ",msg=" + message;
+ String e = exception != null ? ",ex=" + exception : "";
+ return "[" + t + l + b + s + m + e + "]";
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/LoggingLogListener.java (from rev 89486, projects/jboss-osgi/trunk/bundles/logging/src/main/java/org/jboss/osgi/service/logging/LoggingLogListener.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/LoggingLogListener.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/internal/LoggingLogListener.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.common.internal;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.Bundle;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogListener;
+import org.osgi.service.log.LogService;
+
+/**
+ * A LogListener the logs LogEntrys to JBossLogging.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public class LoggingLogListener implements LogListener
+{
+ public void logged(LogEntry entry)
+ {
+ Bundle bundle = entry.getBundle();
+ int level = entry.getLevel();
+ Throwable throwable = entry.getException();
+
+ String loggerName = bundle.getSymbolicName();
+ Logger log = Logger.getLogger(loggerName);
+
+ if (level == LogService.LOG_DEBUG)
+ log.debug(entry.getMessage(), throwable);
+
+ else if (level == LogService.LOG_INFO)
+ log.info(entry.getMessage(), throwable);
+
+ else if (level == LogService.LOG_WARNING)
+ log.warn(entry.getMessage(), throwable);
+
+ else if (level == LogService.LOG_ERROR)
+ log.error(entry.getMessage(), throwable);
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -26,7 +26,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.osgi.common.log.internal.LogEntryImpl;
+import org.jboss.osgi.common.internal.LogEntryImpl;
import org.osgi.service.log.LogEntry;
import org.osgi.service.log.LogListener;
Deleted: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,85 +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.common.log;
-
-//$Id$
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * A combined ServiceTracker/LogService that bundles can use to access the registered LogService.
- *
- * If a LogService is registered, the LogServiceTracker delegates to that LogService.
- * If there is no LogService registered, the LogServiceTracker delegates to the {@link SystemLogService}
- *
- *
- * @author thomas.diesler(a)jboss.com
- * @since 11-Apr-2009
- */
-public class LogServiceTracker extends ServiceTracker implements LogService
-{
- private LogService log;
-
- public LogServiceTracker(BundleContext context)
- {
- super(context, LogService.class.getName(), null);
- log = new SystemLogService(context);
- open();
- }
-
- @Override
- public Object addingService(ServiceReference reference)
- {
- log = (LogService)super.addingService(reference);
- return log;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- super.removedService(reference, service);
- log = new SystemLogService(context);
- }
-
- public void log(int level, String message)
- {
- log.log(level, message);
- }
-
- public void log(int level, String message, Throwable exception)
- {
- log.log(level, message, exception);
- }
-
- public void log(ServiceReference sr, int level, String message)
- {
- log.log(sr, level, message);
- }
-
- public void log(ServiceReference sr, int level, String message, Throwable exception)
- {
- log.log(sr, level, message, exception);
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,115 +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.common.log;
-
-//$Id$
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-
-/**
- * A basic LogService that writes to System.out
- *
- * @author thomas.diesler(a)jboss.com
- * @since 11-Apr-2009
- */
-public class SystemLogService implements LogService
-{
- private BundleContext context;
-
- public SystemLogService(BundleContext context)
- {
- this.context = context;
- }
-
- public void log(int level, String message)
- {
- logInternal(null, level, message, null);
- }
-
- public void log(int level, String message, Throwable exception)
- {
- logInternal(null, level, message, exception);
- }
-
- public void log(ServiceReference sr, int level, String message)
- {
- logInternal(sr, level, message, null);
- }
-
- public void log(ServiceReference sr, int level, String message, Throwable exception)
- {
- logInternal(sr, level, message, exception);
- }
-
- private void logInternal(ServiceReference sref, int level, String message, Throwable exception)
- {
- long time = System.currentTimeMillis();
- Bundle bundle = context.getBundle();
-
- String bndStr = bundle.getSymbolicName();
-
- String srefStr = null;
- if (sref != null && sref.getBundle() != null)
- srefStr = sref.getBundle().getSymbolicName();
-
- String t = new SimpleDateFormat("dd-MMM-yyyy HH:mm.ss.SSS").format(new Date(time));
- String l = " " + logLevel(level);
- String s = srefStr != null ? ",sref=" + srefStr : "";
- String b = ",bnd=" + bndStr;
- String m = ",msg=" + message;
- String e = exception != null ? ",ex=" + exception : "";
-
- System.out.println("[" + t + l + b + s + m + e + "]");
-
- if (exception != null)
- exception.printStackTrace(System.out);
- }
-
- private String logLevel(int level)
- {
- String logLevel;
- switch (level)
- {
- case LogService.LOG_DEBUG:
- logLevel = "DEBUG";
- break;
- case LogService.LOG_INFO:
- logLevel = "INFO";
- break;
- case LogService.LOG_WARNING:
- logLevel = "WARN";
- break;
- case LogService.LOG_ERROR:
- logLevel = "ERROR";
- break;
- default:
- logLevel = "Level=" + level;
- }
- return logLevel;
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScanner.java (from rev 89486, projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScanner.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScanner.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/DeploymentScanner.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,108 @@
+/*
+ * 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.common.service;
+
+//$Id$
+
+import java.net.URL;
+
+/**
+ * The DeploymentScanner service
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public interface DeploymentScanner
+{
+ /**
+ * The property that names the scan location: org.jboss.osgi.hotdeploy.scandir
+ */
+ String PROPERTY_SCAN_LOCATION = "org.jboss.osgi.hotdeploy.scandir";
+
+ /**
+ * The property to defines the scan interval: org.jboss.osgi.hotdeploy.interval
+ */
+ String PROPERTY_SCAN_INTERVAL = "org.jboss.osgi.hotdeploy.interval";
+
+ /**
+ * Get the scan location URL.
+ *
+ * This is can be specified by setting the {@link PROPERTY_SCAN_LOCATION} property.
+ */
+ URL getScanLocation();
+
+ /**
+ * The number of scans since the service started
+ */
+ long getScanCount();
+
+ /**
+ * The number of milliseconds between scans
+ * Defaults to 2000ms
+ */
+ long getScanInterval();
+
+ /**
+ * Run a directory scan
+ */
+ void scan();
+
+ /**
+ * Returns the array of bundles currently known to the deployemtn scanner.
+ */
+ BundleInfo[] getBundles();
+
+ /**
+ * An abstraction of a bundle in the scan folder
+ *
+ */
+ interface BundleInfo
+ {
+ /**
+ * The state of the bundle
+ */
+ enum State
+ {
+ NEW, INSTALLED, ACTIVE, UNINSTALLED
+ }
+
+ /**
+ * Get the bundle location
+ */
+ URL getLocation();
+
+ /**
+ * Get the bundle state
+ */
+ State getState();
+
+ /**
+ * Get the bundle symbolic name
+ */
+ String getSymbolicName();
+
+ /**
+ * Get the bundle version
+ */
+ String getVersion();
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java (from rev 89486, projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/MicrocontainerService.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,77 @@
+/*
+ * 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.common.service;
+
+//$Id$
+
+import java.net.URL;
+import java.util.List;
+
+/**
+ * An OSGi Service the gives access to the Kernel and MBeanServer.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public interface MicrocontainerService
+{
+ /*
+ * The name under which the system bundle context is registered: 'jboss.osgi:service=BundleContext'
+ */
+ String BEAN_SYSTEM_BUNDLE_CONTEXT = "jboss.osgi:service=BundleContext";
+
+ /*
+ * The name under which the MBeanServer is registered: 'jboss.osgi:service=MBeanServer'
+ */
+ String BEAN_MBEAN_SERVER = "jboss.osgi:service=MBeanServer";
+
+ /*
+ * The name under which the KernelController is registered: 'jboss.kernel:service=KernelController'
+ */
+ String BEAN_KERNEL_CONTROLLER = "jboss.kernel:service=KernelController";
+
+ /*
+ * The name under which the Kernel is registered: 'jboss.kernel:service=Kernel'
+ */
+ String BEAN_KERNEL = "jboss.kernel:service=Kernel";
+
+ /*
+ * * Get the list of registered beans.
+ */
+ List<String> getRegisteredBeans();
+
+ /*
+ * * Get a registered bean from the Kernel.
+ * @return null if there is no bean registered under this name
+ */
+ Object getRegisteredBean(String beanName);
+
+ /*
+ * * Deploy MC beans from URL
+ */
+ void deploy(URL url) throws Exception;
+
+ /*
+ * * Undeploy MC beans from URL
+ */
+ void undeploy(URL url) throws Exception;
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/SystemLogService.java (from rev 89486, projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/SystemLogService.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/common/src/main/java/org/jboss/osgi/common/service/SystemLogService.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,115 @@
+/*
+ * 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.common.service;
+
+//$Id$
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+
+/**
+ * A basic LogService that writes to System.out
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Apr-2009
+ */
+public class SystemLogService implements LogService
+{
+ private BundleContext context;
+
+ public SystemLogService(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public void log(int level, String message)
+ {
+ logInternal(null, level, message, null);
+ }
+
+ public void log(int level, String message, Throwable exception)
+ {
+ logInternal(null, level, message, exception);
+ }
+
+ public void log(ServiceReference sr, int level, String message)
+ {
+ logInternal(sr, level, message, null);
+ }
+
+ public void log(ServiceReference sr, int level, String message, Throwable exception)
+ {
+ logInternal(sr, level, message, exception);
+ }
+
+ private void logInternal(ServiceReference sref, int level, String message, Throwable exception)
+ {
+ long time = System.currentTimeMillis();
+ Bundle bundle = context.getBundle();
+
+ String bndStr = bundle.getSymbolicName();
+
+ String srefStr = null;
+ if (sref != null && sref.getBundle() != null)
+ srefStr = sref.getBundle().getSymbolicName();
+
+ String t = new SimpleDateFormat("dd-MMM-yyyy HH:mm.ss.SSS").format(new Date(time));
+ String l = " " + logLevel(level);
+ String s = srefStr != null ? ",sref=" + srefStr : "";
+ String b = ",bnd=" + bndStr;
+ String m = ",msg=" + message;
+ String e = exception != null ? ",ex=" + exception : "";
+
+ System.out.println("[" + t + l + b + s + m + e + "]");
+
+ if (exception != null)
+ exception.printStackTrace(System.out);
+ }
+
+ private String logLevel(int level)
+ {
+ String logLevel;
+ switch (level)
+ {
+ case LogService.LOG_DEBUG:
+ logLevel = "DEBUG";
+ break;
+ case LogService.LOG_INFO:
+ logLevel = "INFO";
+ break;
+ case LogService.LOG_WARNING:
+ logLevel = "WARN";
+ break;
+ case LogService.LOG_ERROR:
+ logLevel = "ERROR";
+ break;
+ default:
+ logLevel = "Level=" + level;
+ }
+ return logLevel;
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -8,7 +8,7 @@
<artifactId>jboss-osgi-hotdeploy</artifactId>
<packaging>bundle</packaging>
- <version>1.0.0</version>
+ <version>1.0.0.Beta2</version>
<!-- Parent -->
<parent>
@@ -51,11 +51,9 @@
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.service.hotdeploy.internal.DeploymentScannerActivator</Bundle-Activator>
<Private-Package>org.jboss.osgi.service.hotdeploy.internal</Private-Package>
- <Export-Package>
- org.jboss.osgi.service.hotdeploy;version=${version}
- </Export-Package>
<Import-Package>
- org.jboss.osgi.common.log,
+ org.jboss.osgi.common;version="1.0",
+ org.jboss.osgi.common.service;version="1.0",
org.osgi.framework,
org.osgi.service.log,
org.osgi.util.tracker
Deleted: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/BundleInfo.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/BundleInfo.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/BundleInfo.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,111 +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.service.hotdeploy;
-
-import java.net.URL;
-
-import org.osgi.framework.Bundle;
-
-//$Id$
-
-/**
- * An abstraction of a bundle in the scan folder
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class BundleInfo
-{
- public enum State
- {
- NEW, INSTALLED, ACTIVE, UNINSTALLED
- };
-
- private URL location;
- private String symbolicName;
- private State state;
-
- public BundleInfo(URL bundleURL, String symbolicName, Bundle bundle)
- {
- this.symbolicName = symbolicName;
- this.location = bundleURL;
- this.state = State.NEW;
-
- if (bundle != null)
- {
- int bundleState = bundle.getState();
- switch (bundleState)
- {
- case Bundle.INSTALLED:
- case Bundle.RESOLVED:
- case Bundle.STARTING:
- case Bundle.STOPPING:
- state = State.INSTALLED;
- break;
-
- case Bundle.ACTIVE:
- state = State.ACTIVE;
- break;
-
- case Bundle.UNINSTALLED:
- state = State.UNINSTALLED;
- break;
- }
- }
- }
-
- public URL getLocation()
- {
- return location;
- }
-
- public State getState()
- {
- return state;
- }
-
- public String getSymbolicName()
- {
- return symbolicName;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if ((obj instanceof BundleInfo) == false)
- return false;
-
- BundleInfo other = (BundleInfo)obj;
- return symbolicName.equals(other.symbolicName);
- }
-
- @Override
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- public String toString()
- {
- return "[" + state + "," + symbolicName + "]";
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScanner.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScanner.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScanner.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,73 +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.service.hotdeploy;
-
-//$Id$
-
-import java.net.URL;
-
-/**
- * The DeploymentScanner service
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public interface DeploymentScanner
-{
- /**
- * The property that names the scan location: org.jboss.osgi.hotdeploy.scandir
- */
- String PROPERTY_SCAN_LOCATION = "org.jboss.osgi.hotdeploy.scandir";
-
- /**
- * The property to defines the scan interval: org.jboss.osgi.hotdeploy.interval
- */
- String PROPERTY_SCAN_INTERVAL = "org.jboss.osgi.hotdeploy.interval";
-
- /**
- * Get the scan location URL.
- *
- * This is can be specified by setting the {@link PROPERTY_SCAN_LOCATION} property.
- */
- URL getScanLocation();
-
- /**
- * The number of scans since the service started
- */
- long getScanCount();
-
- /**
- * The number of milliseconds between scans
- * Defaults to 2000ms
- */
- long getScanInterval();
-
- /**
- * Run a directory scan
- */
- void scan();
-
- /**
- * Returns the array of bundles currently known to the deployemtn scanner.
- */
- BundleInfo[] getBundles();
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java (from rev 89486, projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/BundleInfo.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/BundleInfoImpl.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,123 @@
+/*
+ * 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.service.hotdeploy.internal;
+
+//$Id$
+
+import java.net.URL;
+import java.util.Dictionary;
+
+import org.jboss.osgi.common.service.DeploymentScanner.BundleInfo;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+
+
+/**
+ * An abstraction of a bundle in the scan folder
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public class BundleInfoImpl implements BundleInfo
+{
+ private URL location;
+ private String symbolicName;
+ private String version;
+ private State state;
+
+ @SuppressWarnings("unchecked")
+ public BundleInfoImpl(URL bundleURL, String symbolicName, Bundle bundle)
+ {
+ this.symbolicName = symbolicName;
+ this.location = bundleURL;
+ this.version = "0.0.0";
+ this.state = State.NEW;
+
+ if (bundle != null)
+ {
+ Dictionary headers = bundle.getHeaders();
+ String bundleVersion = (String)headers.get(Constants.BUNDLE_VERSION);
+ if (bundleVersion != null)
+ this.version = bundleVersion;
+
+ int bundleState = bundle.getState();
+ switch (bundleState)
+ {
+ case Bundle.INSTALLED:
+ case Bundle.RESOLVED:
+ case Bundle.STARTING:
+ case Bundle.STOPPING:
+ state = State.INSTALLED;
+ break;
+
+ case Bundle.ACTIVE:
+ state = State.ACTIVE;
+ break;
+
+ case Bundle.UNINSTALLED:
+ state = State.UNINSTALLED;
+ break;
+ }
+ }
+ }
+
+ public URL getLocation()
+ {
+ return location;
+ }
+
+ public State getState()
+ {
+ return state;
+ }
+
+ public String getSymbolicName()
+ {
+ return symbolicName;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if ((obj instanceof BundleInfoImpl) == false)
+ return false;
+
+ BundleInfoImpl other = (BundleInfoImpl)obj;
+ return symbolicName.equals(other.symbolicName) && version.equals(other.version);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ public String toString()
+ {
+ return "[" + state + "," + symbolicName + "," + version + "]";
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.service.hotdeploy.DeploymentScanner;
+import org.jboss.osgi.common.service.DeploymentScanner;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -36,10 +36,9 @@
import java.util.jar.JarFile;
import java.util.jar.Manifest;
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.service.hotdeploy.BundleInfo;
-import org.jboss.osgi.service.hotdeploy.DeploymentScanner;
-import org.jboss.osgi.service.hotdeploy.BundleInfo.State;
+import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.service.DeploymentScanner;
+import org.jboss.osgi.common.service.DeploymentScanner.BundleInfo.State;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -195,15 +194,15 @@
public BundleInfo[] getBundles()
{
- List<BundleInfo> bundles = new ArrayList<BundleInfo>();
+ List<BundleInfoImpl> bundles = new ArrayList<BundleInfoImpl>();
for (File file : scanLocation.listFiles())
{
String symbolicName = getSymbolicName(file);
Bundle bundle = getInstalledBundle(symbolicName);
- BundleInfo bundleInfo = new BundleInfo(toURL(file), symbolicName, bundle);
+ BundleInfoImpl bundleInfo = new BundleInfoImpl(toURL(file), symbolicName, bundle);
bundles.add(bundleInfo);
}
- BundleInfo[] arr = new BundleInfo[bundles.size()];
+ BundleInfo[] arr = new BundleInfoImpl[bundles.size()];
return bundles.toArray(arr);
}
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/ScannerThread.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,8 +23,8 @@
//$Id$
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.service.hotdeploy.DeploymentScanner;
+import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.service.DeploymentScanner;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
@@ -54,15 +54,17 @@
{
while (active == true)
{
- sleep(scanner.getScanInterval());
try
{
scanner.scan();
}
catch (RuntimeException ex)
{
- log.log(LogService.LOG_ERROR, "Hot deployment error", ex);
+ log.log(LogService.LOG_ERROR, "Deployment error", ex);
}
+
+ // Sleep for the duration of the configured interval
+ sleep(scanner.getScanInterval());
}
}
catch (InterruptedException ex)
Modified: projects/jboss-osgi/trunk/bundles/jmx/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/jmx/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -57,7 +57,7 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.jmx.internal.ServiceActivator</Bundle-Activator>
+ <Bundle-Activator>org.jboss.osgi.jmx.internal.MBeanServerServiceActivator</Bundle-Activator>
<Import-Package>
<!-- system -->
@@ -66,7 +66,7 @@
javax.naming.spi,
<!-- jboss-osgi -->
- org.jboss.osgi.common.log,
+ org.jboss.osgi.common;version="1.0",
<!-- osgi -->
org.osgi.framework;version=1.4,
Modified: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/JMXConnectorService.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -36,7 +36,7 @@
import javax.management.remote.JMXServiceURL;
import org.jboss.net.sockets.DefaultSocketFactory;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerService.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -28,7 +28,7 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogService;
@@ -49,6 +49,7 @@
{
log = new LogServiceTracker(context);
+ // Check if there is an MBeanServer service already
ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
if (sref == null)
{
@@ -57,10 +58,16 @@
throw new IllegalStateException("Multiple MBeanServer instances not supported");
if (serverArr.size() == 1)
+ {
mbeanServer = serverArr.get(0);
+ log.log(LogService.LOG_DEBUG, "Found MBeanServer: " + mbeanServer.getDefaultDomain());
+ }
if (mbeanServer == null)
+ {
+ log.log(LogService.LOG_DEBUG, "No MBeanServer, create one ...");
mbeanServer = MBeanServerFactory.createMBeanServer();
+ }
log.log(LogService.LOG_DEBUG, "Register MBeanServer");
context.registerService(MBeanServer.class.getName(), mbeanServer, null);
Copied: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java (from rev 89486, projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/ServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/MBeanServerServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,162 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jmx.internal;
+
+//$Id$
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerConnection;
+import javax.management.remote.JMXServiceURL;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.StringRefAddr;
+
+import org.jboss.osgi.common.LogServiceTracker;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * A BundleActivator for the MBeanServer related services
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class MBeanServerServiceActivator implements BundleActivator
+{
+ public static final String REMOTE_JMX_HOST = "org.jboss.osgi.jmx.host";
+ public static final String REMOTE_JMX_RMI_PORT = "org.jboss.osgi.jmx.rmi.port";
+ public static final String REMOTE_JMX_RMI_ADAPTOR = "org.jboss.osgi.jmx.rmi.adaptor";
+
+ private JMXConnectorService jmxConnector;
+ private String jmxHost;
+ private String jmxRmiPort;
+ private String rmiAdaptorPath;
+ private MBeanServer mbanServer;
+
+ private LogService log;
+
+ public void start(BundleContext context)
+ {
+ log = new LogServiceTracker(context);
+
+ MBeanServerService mbeanService = new MBeanServerService(context);
+ mbanServer = mbeanService.getMBeanServer();
+
+ jmxHost = context.getProperty(REMOTE_JMX_HOST);
+ if (jmxHost == null)
+ jmxHost = "localhost";
+
+ jmxRmiPort = context.getProperty(REMOTE_JMX_RMI_PORT);
+ if (jmxRmiPort == null)
+ jmxRmiPort = "1098";
+
+ rmiAdaptorPath = context.getProperty(REMOTE_JMX_RMI_ADAPTOR);
+ if (rmiAdaptorPath == null)
+ rmiAdaptorPath = "jmx/invoker/RMIAdaptor";
+
+ // Start tracking the NamingService
+ InitialContextTracker tracker = new InitialContextTracker(context, rmiAdaptorPath);
+ tracker.open();
+ }
+
+ public void stop(BundleContext context)
+ {
+ stopJMXConnectorService();
+ }
+
+ private void stopJMXConnectorService()
+ {
+ if (jmxConnector != null)
+ {
+ jmxConnector.stop();
+ jmxConnector = null;
+ }
+ }
+
+ class InitialContextTracker extends ServiceTracker
+ {
+ private String rmiAdaptorPath;
+
+ public InitialContextTracker(BundleContext context, String rmiAdaptorPath)
+ {
+ super(context, InitialContext.class.getName(), null);
+ this.rmiAdaptorPath = rmiAdaptorPath;
+ }
+
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ InitialContext iniCtx = (InitialContext)super.addingService(reference);
+
+ // Start JMXConnectorService
+ if (jmxConnector == null)
+ {
+ jmxConnector = new JMXConnectorService(context, mbanServer, jmxHost, Integer.parseInt(jmxRmiPort));
+ jmxConnector.start();
+ }
+
+ // Bind the RMIAdaptor
+ try
+ {
+ iniCtx.createSubcontext("jmx").createSubcontext("invoker");
+ StringRefAddr addr = new StringRefAddr(JMXServiceURL.class.getName(), jmxConnector.getServiceURL().toString());
+ Reference ref = new Reference(MBeanServerConnection.class.getName(), addr, RMIAdaptorFactory.class.getName(), null);
+ iniCtx.bind(rmiAdaptorPath, ref);
+
+ log.log(LogService.LOG_INFO, "MBeanServerConnection bound to: " + rmiAdaptorPath);
+ }
+ catch (NamingException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot bind RMIAdoaptor", ex);
+ }
+
+ return iniCtx;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ InitialContext iniCtx = (InitialContext)service;
+
+ // Stop JMXConnectorService
+ stopJMXConnectorService();
+
+ // Unbind the RMIAdaptor
+ try
+ {
+ iniCtx.unbind(rmiAdaptorPath);
+
+ log.log(LogService.LOG_INFO, "MBeanServerConnection unbound from: " + rmiAdaptorPath);
+ }
+ catch (NamingException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot unbind RMIAdoaptor", ex);
+ }
+
+ super.removedService(reference, service);
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/ServiceActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/jmx/src/main/java/org/jboss/osgi/jmx/internal/ServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,162 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.osgi.jmx.internal;
-
-//$Id$
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXServiceURL;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.StringRefAddr;
-
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * A BundleActivator for the MBeanServer related services
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Apr-2009
- */
-public class ServiceActivator implements BundleActivator
-{
- public static final String REMOTE_JMX_HOST = "org.jboss.osgi.jmx.host";
- public static final String REMOTE_JMX_RMI_PORT = "org.jboss.osgi.jmx.rmi.port";
- public static final String REMOTE_JMX_RMI_ADAPTOR = "org.jboss.osgi.jmx.rmi.adaptor";
-
- private JMXConnectorService jmxConnector;
- private String jmxHost;
- private String jmxRmiPort;
- private String rmiAdaptorPath;
- private MBeanServer mbanServer;
-
- private LogService log;
-
- public void start(BundleContext context)
- {
- log = new LogServiceTracker(context);
-
- MBeanServerService mbeanService = new MBeanServerService(context);
- mbanServer = mbeanService.getMBeanServer();
-
- jmxHost = context.getProperty(REMOTE_JMX_HOST);
- if (jmxHost == null)
- jmxHost = "localhost";
-
- jmxRmiPort = context.getProperty(REMOTE_JMX_RMI_PORT);
- if (jmxRmiPort == null)
- jmxRmiPort = "1098";
-
- rmiAdaptorPath = context.getProperty(REMOTE_JMX_RMI_ADAPTOR);
- if (rmiAdaptorPath == null)
- rmiAdaptorPath = "jmx/invoker/RMIAdaptor";
-
- // Start tracking the NamingService
- NamingServiceTracker tracker = new NamingServiceTracker(context, rmiAdaptorPath);
- tracker.open();
- }
-
- public void stop(BundleContext context)
- {
- stopJMXConnectorService();
- }
-
- private void stopJMXConnectorService()
- {
- if (jmxConnector != null)
- {
- jmxConnector.stop();
- jmxConnector = null;
- }
- }
-
- class NamingServiceTracker extends ServiceTracker
- {
- private String rmiAdaptorPath;
-
- public NamingServiceTracker(BundleContext context, String rmiAdaptorPath)
- {
- super(context, InitialContext.class.getName(), null);
- this.rmiAdaptorPath = rmiAdaptorPath;
- }
-
- @Override
- public Object addingService(ServiceReference reference)
- {
- InitialContext iniCtx = (InitialContext)super.addingService(reference);
-
- // Start JMXConnectorService
- if (jmxConnector == null)
- {
- jmxConnector = new JMXConnectorService(context, mbanServer, jmxHost, Integer.parseInt(jmxRmiPort));
- jmxConnector.start();
- }
-
- // Bind the RMIAdaptor
- try
- {
- iniCtx.createSubcontext("jmx").createSubcontext("invoker");
- StringRefAddr addr = new StringRefAddr(JMXServiceURL.class.getName(), jmxConnector.getServiceURL().toString());
- Reference ref = new Reference(MBeanServerConnection.class.getName(), addr, RMIAdaptorFactory.class.getName(), null);
- iniCtx.bind(rmiAdaptorPath, ref);
-
- log.log(LogService.LOG_INFO, "MBeanServerConnection bound to: " + rmiAdaptorPath);
- }
- catch (NamingException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot bind RMIAdoaptor", ex);
- }
-
- return iniCtx;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- InitialContext iniCtx = (InitialContext)service;
-
- // Stop JMXConnectorService
- stopJMXConnectorService();
-
- // Unbind the RMIAdaptor
- try
- {
- iniCtx.unbind(rmiAdaptorPath);
-
- log.log(LogService.LOG_INFO, "MBeanServerConnection unbound from: " + rmiAdaptorPath);
- }
- catch (NamingException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot unbind RMIAdoaptor", ex);
- }
-
- super.removedService(reference, service);
- }
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/jndi/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/jndi/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/jndi/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -59,13 +59,13 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.jndi.internal.ServiceActivator</Bundle-Activator>
+ <Bundle-Activator>org.jboss.osgi.jndi.internal.InitialContextServiceActivator</Bundle-Activator>
<Import-Package>
javax.naming*,
javax.net,
org.jboss.logging,
org.jboss.net.sockets,
- org.jboss.osgi.common.log,
+ org.jboss.osgi.common;version="1.0",
org.jboss.util.naming,
org.jboss.util.threadpool,
org.osgi.framework,
Copied: projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/InitialContextServiceActivator.java (from rev 89486, projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/ServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/InitialContextServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/InitialContextServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.osgi.jndi.internal;
+
+//$Id$
+
+import javax.naming.InitialContext;
+
+import org.jboss.osgi.common.LogServiceTracker;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.log.LogService;
+
+/**
+ * A BundleActivator for the JNDI related services
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class InitialContextServiceActivator implements BundleActivator
+{
+ public static final String REMOTE_JNDI_HOST = "org.jboss.osgi.jndi.host";
+ public static final String REMOTE_JNDI_RMI_PORT = "org.jboss.osgi.jndi.rmi.port";
+ public static final String REMOTE_JNDI_PORT = "org.jboss.osgi.jndi.port";
+
+ private ServiceRegistration registration;
+ private JNPServer jnpServer;
+ private LogService log;
+
+ public void start(BundleContext context)
+ {
+ log = new LogServiceTracker(context);
+
+ String jndiHost = context.getProperty(REMOTE_JNDI_HOST);
+ if (jndiHost == null)
+ jndiHost = "localhost";
+
+ String jndiRmiPort = context.getProperty(REMOTE_JNDI_RMI_PORT);
+ if (jndiRmiPort == null)
+ jndiRmiPort = "1098";
+
+ String jndiPort = context.getProperty(REMOTE_JNDI_PORT);
+ if (jndiPort == null)
+ jndiPort = "1099";
+
+ jnpServer = new JNPServer(context, jndiHost, Integer.parseInt(jndiPort), Integer.parseInt(jndiRmiPort));
+ jnpServer.start();
+
+ InitialContextFactory serviceFactory = new InitialContextFactory(jndiHost, jndiPort);
+ registration = context.registerService(InitialContext.class.getName(), serviceFactory, null);
+ log.log(LogService.LOG_DEBUG, "InitialContext registered");
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ }
+
+ if (jnpServer != null)
+ {
+ jnpServer.stop();
+ jnpServer = null;
+ }
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/JNPServer.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -33,7 +33,7 @@
import javax.naming.NamingException;
import org.jboss.net.sockets.DefaultSocketFactory;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.jnp.interfaces.Naming;
import org.jnp.server.Main;
import org.jnp.server.NamingBean;
Deleted: projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/ServiceActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/jndi/src/main/java/org/jboss/osgi/jndi/internal/ServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,88 +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.jndi.internal;
-
-//$Id$
-
-import javax.naming.InitialContext;
-
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.log.LogService;
-
-/**
- * A BundleActivator for the JNDI related services
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Apr-2009
- */
-public class ServiceActivator implements BundleActivator
-{
- public static final String REMOTE_JNDI_HOST = "org.jboss.osgi.jndi.host";
- public static final String REMOTE_JNDI_RMI_PORT = "org.jboss.osgi.jndi.rmi.port";
- public static final String REMOTE_JNDI_PORT = "org.jboss.osgi.jndi.port";
-
- private ServiceRegistration registration;
- private JNPServer jnpServer;
- private LogService log;
-
- public void start(BundleContext context)
- {
- log = new LogServiceTracker(context);
-
- String jndiHost = context.getProperty(REMOTE_JNDI_HOST);
- if (jndiHost == null)
- jndiHost = "localhost";
-
- String jndiRmiPort = context.getProperty(REMOTE_JNDI_RMI_PORT);
- if (jndiRmiPort == null)
- jndiRmiPort = "1098";
-
- String jndiPort = context.getProperty(REMOTE_JNDI_PORT);
- if (jndiPort == null)
- jndiPort = "1099";
-
- jnpServer = new JNPServer(context, jndiHost, Integer.parseInt(jndiPort), Integer.parseInt(jndiRmiPort));
- jnpServer.start();
-
- InitialContextFactory serviceFactory = new InitialContextFactory(jndiHost, jndiPort);
- registration = context.registerService(InitialContext.class.getName(), serviceFactory, null);
- log.log(LogService.LOG_DEBUG, "InitialContext registered");
- }
-
- public void stop(BundleContext context)
- {
- if (registration != null)
- {
- registration.unregister();
- registration = null;
- }
-
- if (jnpServer != null)
- {
- jnpServer.stop();
- jnpServer = null;
- }
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundles/logging/.classpath
===================================================================
--- projects/jboss-osgi/trunk/bundles/logging/.classpath 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/logging/.classpath 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,7 +0,0 @@
-<?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="output" path="target/classes"/>
-</classpath>
Modified: projects/jboss-osgi/trunk/bundles/logging/.project
===================================================================
--- projects/jboss-osgi/trunk/bundles/logging/.project 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/logging/.project 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>jboss-osgi-service-logging</name>
+ <name>jboss-osgi-logging</name>
<comment></comment>
<projects>
</projects>
Added: projects/jboss-osgi/trunk/bundles/logging/bin/.project
===================================================================
--- projects/jboss-osgi/trunk/bundles/logging/bin/.project (rev 0)
+++ projects/jboss-osgi/trunk/bundles/logging/bin/.project 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-logging</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Deleted: projects/jboss-osgi/trunk/bundles/logging/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/logging/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/logging/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <name>JBossOSGi Bundles - Logging</name>
-
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
- <packaging>bundle</packaging>
-
- <version>1.0.0.Beta2</version>
-
- <!-- Parent -->
- <parent>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-bundles</artifactId>
- <version>1.0.0.Beta2</version>
- </parent>
-
- <!-- Dependencies -->
- <dependencies>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- OSGi Dependencies -->
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.service.logging.LoggingActivator</Bundle-Activator>
- <Private-Package>org.jboss.osgi.service.logging</Private-Package>
- <Import-Package>
- org.jboss.logging,
- org.osgi.framework,
- org.osgi.service.log,
- org.osgi.util.tracker
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -76,7 +76,7 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.microcontainer.internal.ServiceActivator</Bundle-Activator>
+ <Bundle-Activator>org.jboss.osgi.microcontainer.internal.MicrocontainerServiceActivator</Bundle-Activator>
<Export-Package>
org.jboss.osgi.microcontainer;version=${version.jboss.microcontainer}
</Export-Package>
@@ -104,9 +104,10 @@
org.jboss.deployers.*,
org.jboss.joinpoint.*,
org.jboss.logging,
- org.jboss.osgi.common.log,
- org.jboss.osgi.spi,
- org.jboss.osgi.spi.management,
+ org.jboss.osgi.common;version="1.0",
+ org.jboss.osgi.common.service;version="1.0",
+ org.jboss.osgi.spi;version="1.0",
+ org.jboss.osgi.spi.management;version="1.0",
org.jboss.reflect.*,
org.jboss.util.*,
org.jboss.virtual*,
Deleted: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,84 +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.microcontainer;
-
-//$Id$
-
-import java.net.URL;
-import java.util.List;
-
-import org.jboss.kernel.Kernel;
-
-/**
- * An OSGi Service the gives access to the Kernel and MBeanServer.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public interface MicrocontainerService
-{
- /*
- * The name under which the system bundle context is registered: 'jboss.osgi:service=BundleContext'
- */
- String BEAN_SYSTEM_BUNDLE_CONTEXT = "jboss.osgi:service=BundleContext";
-
- /*
- * The name under which the MBeanServer is registered: 'jboss.osgi:service=MBeanServer'
- */
- String BEAN_MBEAN_SERVER = "jboss.osgi:service=MBeanServer";
-
- /*
- * The name under which the KernelController is registered: 'jboss.kernel:service=KernelController'
- */
- String BEAN_KERNEL_CONTROLLER = "jboss.kernel:service=KernelController";
-
- /*
- * The name under which the Kernel is registered: 'jboss.kernel:service=Kernel'
- */
- String BEAN_KERNEL = "jboss.kernel:service=Kernel";
-
- /*
- * Get the Microcontainer Kernel
- */
- Kernel getKernel();
-
- /*
- * * Get the list of registered beans.
- */
- List<String> getRegisteredBeans();
-
- /*
- * * Get a registered bean from the Kernel.
- * @return null if there is no bean registered under this name
- */
- Object getRegisteredBean(String beanName);
-
- /*
- * * Deploy MC beans from URL
- */
- void deploy(URL url) throws Exception;
-
- /*
- * * Undeploy MC beans from URL
- */
- void undeploy(URL url) throws Exception;
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeansDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeansDeployer.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedBeansDeployer.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -27,7 +27,7 @@
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Copied: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceActivator.java (from rev 89486, projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/ServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,60 @@
+/*
+ * 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.microcontainer.internal;
+
+//$Id$
+
+import org.jboss.osgi.common.service.MicrocontainerService;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A BundleActivator that registers the {@link MicrocontainerService}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class MicrocontainerServiceActivator implements BundleActivator
+{
+ private MicrocontainerServiceImpl mcService;
+
+ public void start(BundleContext context)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+ mcService = new MicrocontainerServiceImpl(context);
+ mcService.start();
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (mcService != null)
+ mcService.stop();
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -48,8 +48,8 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.microcontainer.MicrocontainerService;
+import org.jboss.osgi.common.LogServiceTracker;
+import org.jboss.osgi.common.service.MicrocontainerService;
import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
@@ -152,15 +152,15 @@
void start()
{
final MicrocontainerService mcService = this;
-
+
final Kernel kernel = getKernel();
final KernelController controller = kernel.getController();
-
+
// Preregister some beans
installBean(controller, BEAN_SYSTEM_BUNDLE_CONTEXT, context);
installBean(controller, BEAN_KERNEL, kernel);
installBean(controller, BEAN_KERNEL_CONTROLLER, controller);
-
+
// Register the MicrocontainerServiceMBean
ServiceTracker tracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
{
@@ -170,27 +170,18 @@
// Install the MBeanServer
MBeanServer mbeanServer = (MBeanServer)super.addingService(reference);
installBean(controller, BEAN_MBEAN_SERVER, mbeanServer);
-
+
// Deploy the deployer beans
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- URL deployersURL = context.getBundle().getResource("META-INF/base-deployers-beans.xml");
- deployer.deploy(deployersURL);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
+ URL deployersURL = context.getBundle().getResource("META-INF/base-deployers-beans.xml");
+ deployer.deploy(deployersURL);
// Register the MicrocontainerService
log.log(LogService.LOG_DEBUG, "Register MicrocontainerService");
context.registerService(MicrocontainerService.class.getName(), mcService, null);
-
+
// Register the MicrocontainerServiceMBean
registerMicrocontainerServiceMBean(mbeanServer);
-
+
return mbeanServer;
}
};
@@ -218,7 +209,7 @@
throw new IllegalStateException("Cannot register bean: " + beanName, ex);
}
}
-
+
private void registerMicrocontainerServiceMBean(MBeanServer mbeanServer)
{
// Register the MicrocontainerServiceMBean
Deleted: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/ServiceActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/ServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,60 +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.microcontainer.internal;
-
-//$Id$
-
-import org.jboss.osgi.microcontainer.MicrocontainerService;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * A BundleActivator that registers the {@link MicrocontainerService}
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Apr-2009
- */
-public class ServiceActivator implements BundleActivator
-{
- private MicrocontainerServiceImpl mcService;
-
- public void start(BundleContext context)
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
- mcService = new MicrocontainerServiceImpl(context);
- mcService.start();
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
- }
-
- public void stop(BundleContext context)
- {
- if (mcService != null)
- mcService.stop();
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/bundles/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -20,7 +20,6 @@
<modules>
<!-- jboss-osgi -->
<module>common</module>
- <module>logging</module>
<module>hotdeploy</module>
<module>jmx</module>
<module>jndi</module>
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -112,10 +112,6 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-microcontainer</artifactId>
</dependency>
<dependency>
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-28 12:21:21 UTC (rev 89492)
@@ -42,10 +42,10 @@
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.spi, \
- org.jboss.osgi.spi.logging, \
- org.jboss.osgi.spi.management, \
- org.jboss.osgi.spi.testing, \
+ org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.logging;version=1.0, \
+ org.jboss.osgi.spi.management;version=1.0, \
+ org.jboss.osgi.spi.testing;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
@@ -72,5 +72,6 @@
org.jboss.osgi.spi.framework.autoStart=\
file://${osgi.home}/bundles/org.apache.felix.log.jar \
file://${osgi.home}/bundles/jboss-osgi-common.jar \
- file://${osgi.home}/bundles/jboss-osgi-logging.jar \
+ file://${osgi.home}/bundles/jboss-osgi-jmx.jar \
+ file://${osgi.home}/bundles/jboss-osgi-microcontainer.jar \
file://${osgi.home}/bundles/jboss-osgi-hotdeploy.jar
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -115,7 +115,6 @@
<include name="jboss-osgi-runtime-felix.jar" />
<include name="jboss-osgi-spi.jar" />
<include name="jboss-osgi-common.jar" />
- <include name="jboss-osgi-logging.jar" />
<include name="jboss-osgi-webconsole.jar" />
<include name="org.apache.felix.framework.jar" />
<include name="org.apache.felix.configadmin.jar" />
@@ -132,7 +131,6 @@
<include name="jboss-osgi-runtime-felix-sources.jar" />
<include name="jboss-osgi-spi-sources.jar" />
<include name="jboss-osgi-common-sources.jar" />
- <include name="jboss-osgi-logging-sources.jar" />
<include name="jboss-osgi-webconsole-sources.jar" />
</fileset>
@@ -176,7 +174,6 @@
<include name="jboss-osgi-jaxb.jar" />
<include name="jboss-osgi-common-core.jar" />
<include name="jboss-osgi-common.jar" />
- <include name="jboss-osgi-logging.jar" />
<include name="jboss-osgi-hotdeploy.jar" />
<include name="jboss-osgi-jndi.jar" />
<include name="jboss-osgi-jmx.jar" />
@@ -258,7 +255,6 @@
<include name="org.apache.felix.log.jar" />
<include name="org.apache.felix.metatype.jar" />
<include name="jboss-osgi-common.jar" />
- <include name="jboss-osgi-logging.jar" />
<include name="jboss-osgi-webconsole.jar" />
</fileset>
Modified: projects/jboss-osgi/trunk/husky/harness/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/husky/harness/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/husky/harness/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-husky-parent</artifactId>
- <version>1.0.0</version>
+ <version>1.0.0.Beta2</version>
</parent>
<!-- Dependencies -->
Modified: projects/jboss-osgi/trunk/husky/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/husky/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/husky/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -22,7 +22,7 @@
<artifactId>jboss-osgi-husky-parent</artifactId>
<packaging>pom</packaging>
- <version>1.0.0</version>
+ <version>1.0.0.Beta2</version>
<!-- Parent -->
<parent>
Modified: projects/jboss-osgi/trunk/husky/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/husky/testsuite/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-husky-parent</artifactId>
- <version>1.0.0</version>
+ <version>1.0.0.Beta2</version>
</parent>
<!-- Dependencies -->
@@ -68,11 +68,6 @@
<artifactId>jboss-osgi-jmx</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
- <scope>provided</scope>
- </dependency>
</dependencies>
<build>
Modified: projects/jboss-osgi/trunk/husky/testsuite/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/scripts/assembly-bundles.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/husky/testsuite/scripts/assembly-bundles.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -18,7 +18,6 @@
<include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-husky:jar</include>
- <include>*:jboss-osgi-logging:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.osgi.compendium:jar</include>
</includes>
Modified: projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/husky/testsuite/src/test/resources/jboss-osgi-felix.properties 2009-05-28 12:21:21 UTC (rev 89492)
@@ -21,9 +21,9 @@
# Extra System Packages
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
- org.jboss.osgi.spi, \
- org.jboss.osgi.spi.testing, \
- org.osgi.framework; version\=1.4
+ org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.testing;version=1.0, \
+ org.osgi.framework;version=1.4
# Bundles that need to be installed with the Framework automatically
org.jboss.osgi.spi.framework.autoInstall=\
@@ -32,5 +32,4 @@
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-logging.jar
\ No newline at end of file
+ file://${test.archive.directory}/bundles/jboss-osgi-common.jar
Added: projects/jboss-osgi/trunk/integration/.project
===================================================================
--- projects/jboss-osgi/trunk/integration/.project (rev 0)
+++ projects/jboss-osgi/trunk/integration/.project 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-integration</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -9,6 +9,15 @@
<version>1.0.0.Beta2</version>
+ <url>http://www.jboss.org/community/wiki/JBossOSGi</url>
+ <description>JBossOSGi</description>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi</developerConnection>
+ <url>http://fisheye.jboss.com/qsearch/JBossOSGi</url>
+ </scm>
+
<!-- Modules -->
<modules>
<module>spi</module>
@@ -52,13 +61,12 @@
<version.jboss.osgi.common>1.0.0.Beta2</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.11</version.jboss.osgi.common.core>
<version.jboss.osgi.deployers>1.0.0.Beta2</version.jboss.osgi.deployers>
- <version.jboss.osgi.hotdeploy>1.0.0</version.jboss.osgi.hotdeploy>
- <version.jboss.osgi.husky>1.0.0</version.jboss.osgi.husky>
+ <version.jboss.osgi.hotdeploy>1.0.0.Beta2</version.jboss.osgi.hotdeploy>
+ <version.jboss.osgi.husky>1.0.0.Beta2</version.jboss.osgi.husky>
<version.jboss.osgi.integration.jbossas>1.0.0.Beta2</version.jboss.osgi.integration.jbossas>
<version.jboss.osgi.jaxb>2.1.10</version.jboss.osgi.jaxb>
<version.jboss.osgi.jmx>1.0.0.Beta2</version.jboss.osgi.jmx>
<version.jboss.osgi.jndi>1.0.0.Beta2</version.jboss.osgi.jndi>
- <version.jboss.osgi.logging>1.0.0.Beta2</version.jboss.osgi.logging>
<version.jboss.osgi.microcontainer>1.0.0.Beta2</version.jboss.osgi.microcontainer>
<version.jboss.osgi.remotelog>1.0.0.Beta2</version.jboss.osgi.remotelog>
<version.jboss.osgi.runtime.equinox>1.0.0.Beta2</version.jboss.osgi.runtime.equinox>
@@ -127,11 +135,6 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
- <version>${version.jboss.osgi.logging}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-microcontainer</artifactId>
<version>${version.jboss.osgi.microcontainer}</version>
</dependency>
@@ -380,6 +383,20 @@
</configuration>
</plugin>
<plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Implementation-URL>${url}</Implementation-URL>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
@@ -460,14 +477,6 @@
</pluginRepository>
</pluginRepositories>
- <!-- Source Repository -->
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi
- </developerConnection>
- <url>http://fisheye.jboss.com/qsearch/JBossOSGi</url>
- </scm>
-
<!-- Licenses -->
<licenses>
<license>
@@ -646,6 +655,17 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemProperties>
+ <!--
+ You can copy these properties in Eclipse to debug the tests
+
+ -Djava.protocol.handler.pkgs=org.jboss.net.protocol|org.jboss.virtual.protocol
+ -Djndi.server.port=1199
+ -Dlog4j.output.dir=${workspace_loc:jboss-osgi-testsuite-example/target}
+ -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeAwareParserConfiguration
+ -Djboss.osgi.framework.properties=jboss-osgi-felix.properties
+ -Dorg.jboss.osgi.husky.Invoker=org.jboss.osgi.husky.internal.OSGiInvoker
+ -Dtest.archive.directory=${workspace_loc:jboss-osgi-testsuite-example/target}/test-libs
+ -->
<property>
<name>java.protocol.handler.pkgs</name>
<value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
@@ -659,14 +679,16 @@
<value>${project.build.directory}</value>
</property>
<property>
+ <name>jboss.osgi.framework.properties</name>
+ <value>${jboss.osgi.framework.properties}</value>
+ </property>
+ <!--
+ <property>
<name>org.apache.xerces.xni.parser.XMLParserConfiguration</name>
<value>org.apache.xerces.parsers.XIncludeAwareParserConfiguration</value>
</property>
+ -->
<property>
- <name>jboss.osgi.framework.properties</name>
- <value>${jboss.osgi.framework.properties}</value>
- </property>
- <property>
<name>org.jboss.osgi.husky.Invoker</name>
<value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
</property>
Added: projects/jboss-osgi/trunk/runtime/.project
===================================================================
--- projects/jboss-osgi/trunk/runtime/.project (rev 0)
+++ projects/jboss-osgi/trunk/runtime/.project 2009-05-28 12:21:21 UTC (rev 89492)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-runtime</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -21,7 +21,6 @@
<include>*:jboss-osgi-jaxb:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
- <include>*:jboss-osgi-logging:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
<include>*:jboss-osgi-remotelog:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -25,7 +25,7 @@
import static org.osgi.service.log.LogService.LOG_INFO;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,9 +23,9 @@
//$Id$
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_KERNEL;
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MBEAN_SERVER;
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
+import static org.jboss.osgi.common.service.MicrocontainerService.BEAN_KERNEL;
+import static org.jboss.osgi.common.service.MicrocontainerService.BEAN_MBEAN_SERVER;
+import static org.jboss.osgi.common.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
import static org.junit.Assert.assertFalse;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,9 +23,9 @@
//$Id$
-import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
+import static org.jboss.osgi.common.service.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
-import org.jboss.osgi.microcontainer.MicrocontainerService;
+import org.jboss.osgi.common.service.MicrocontainerService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-05-28 12:21:21 UTC (rev 89492)
@@ -18,15 +18,15 @@
org.osgi.framework.system.packages.extra=\
org.jboss.logging, \
org.jboss.net.protocol, \
- org.jboss.osgi.spi, \
- org.jboss.osgi.spi.logging, \
- org.jboss.osgi.spi.management, \
+ org.jboss.osgi.spi;version=1.0, \
+ org.jboss.osgi.spi.logging;version=1.0, \
+ org.jboss.osgi.spi.management;version=1.0, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
org.jboss.virtual.plugins.vfs.helpers, \
org.jboss.virtual.protocol, \
- org.osgi.framework;version\=1.4, \
+ org.osgi.framework;version=1.4, \
org.apache.log4j, \
org.jboss.util, \
org.jboss.util.id, \
@@ -47,5 +47,4 @@
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-logging.jar
\ No newline at end of file
+ file://${test.archive.directory}/bundles/jboss-osgi-common.jar
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,6 +1,9 @@
# bnd build -classpath target/test-classes -output target/test-libs/example-mcservice-bundleA.jar src/test/resources/mcservice/example-mcservice-bundleA.bnd
Bundle-SymbolicName: example-mcservice-bundleA
+
Bundle-Activator: org.jboss.test.osgi.example.microcontainer.bundleA.ServiceActivator
+
Export-Package: org.jboss.test.osgi.example.microcontainer.bundleA
-Import-Package: org.jboss.osgi.microcontainer, org.osgi.framework
+
+Import-Package: org.jboss.osgi.common.service, org.osgi.framework
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd 2009-05-28 12:21:21 UTC (rev 89492)
@@ -1,6 +1,10 @@
# bnd build -classpath target/test-classes -output target/test-libs/mcservice-bundleB.jar src/test/resources/mcservice/mcservice-bundleB.bnd
Bundle-SymbolicName: example-mcservice-bundleB
+
Export-Package: org.jboss.test.osgi.example.microcontainer.bundleB
+
Import-Package: javax.management
-Include-Resource: META-INF/mcservice-jboss-beans.xml=META-INF/mcservice-jboss-beans.xml
\ No newline at end of file
+
+Include-Resource: META-INF/mcservice-jboss-beans.xml=META-INF/mcservice-jboss-beans.xml
+-removeheaders: Include-Resource
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -21,7 +21,6 @@
<include>*:jboss-osgi-jaxb:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
- <include>*:jboss-osgi-logging:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
<include>*:jboss-osgi-remotelog:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,7 +23,7 @@
//$Id: ServiceA.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.jboss.test.osgi.jbosgi37.subA.PojoA;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,7 +23,7 @@
//$Id: ServiceB.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.jboss.test.osgi.jbosgi37.subB.PojoB;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -28,7 +28,7 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -27,7 +27,7 @@
import java.util.Dictionary;
import java.util.Hashtable;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.cm.Configuration;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,7 +23,7 @@
//$Id: ServiceActivator.java 87336 2009-04-15 11:31:26Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-felix.properties 2009-05-28 12:21:21 UTC (rev 89492)
@@ -12,7 +12,7 @@
org.osgi.framework.storage.clean=onFirstInit
# Framework bootdelegation
-org.osgi.framework.bootdelegation=org.osgi.service.log
+# org.osgi.framework.bootdelegation=org.osgi.service.log
# Extra System Packages
org.osgi.framework.system.packages.extra=\
@@ -41,11 +41,10 @@
# org.jboss.util.propertyeditor
# Bundles that need to be installed with the Framework automatically
-org.jboss.osgi.spi.framework.autoInstall=\
- file://${test.archive.directory}/bundles/org.osgi.compendium.jar
+# org.jboss.osgi.spi.framework.autoInstall=
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
+ file://${test.archive.directory}/bundles/org.osgi.compendium.jar \
file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-logging.jar
\ No newline at end of file
+ file://${test.archive.directory}/bundles/jboss-osgi-common.jar
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -88,11 +88,6 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-microcontainer</artifactId>
<scope>provided</scope>
</dependency>
@@ -101,6 +96,8 @@
<artifactId>jboss-osgi-remotelog</artifactId>
<scope>provided</scope>
</dependency>
+
+ <!-- OSGi Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/scripts/assembly-bundles.xml 2009-05-28 12:21:21 UTC (rev 89492)
@@ -21,7 +21,6 @@
<include>*:jboss-osgi-jaxb:jar</include>
<include>*:jboss-osgi-jmx:jar</include>
<include>*:jboss-osgi-jndi:jar</include>
- <include>*:jboss-osgi-logging:jar</include>
<include>*:jboss-osgi-microcontainer:jar</include>
<include>*:jboss-osgi-remotelog:jar</include>
<include>*:jboss-osgi-xml-binding:jar</include>
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/HttpRenderServlet.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -34,7 +34,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.ShoppingMall;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/frontend/ServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/mall/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/mall/ServiceActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/mall/ServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.ShoppingMall;
import org.jboss.test.osgi.trailblazer.frontend.HttpRenderServlet;
import org.osgi.framework.BundleActivator;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/creditcard/ServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -25,7 +25,7 @@
import java.util.Hashtable;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.PaymentService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/pay/paypal/ServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -25,7 +25,7 @@
import java.util.Hashtable;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.PaymentService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/pets/ServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.Shop;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/java/org/jboss/test/osgi/trailblazer/shop/sports/ServiceActivator.java 2009-05-28 12:21:21 UTC (rev 89492)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.common.LogServiceTracker;
import org.jboss.test.osgi.trailblazer.Shop;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/jboss-osgi-felix.properties 2009-05-28 12:21:21 UTC (rev 89492)
@@ -47,5 +47,4 @@
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
file://${test.archive.directory}/bundles/org.apache.felix.log.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-common.jar \
- file://${test.archive.directory}/bundles/jboss-osgi-logging.jar
\ No newline at end of file
+ file://${test.archive.directory}/bundles/jboss-osgi-common.jar
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/frontend.bnd 2009-05-28 12:21:21 UTC (rev 89492)
@@ -14,8 +14,11 @@
org.osgi.service.http, \
org.osgi.service.log, \
org.osgi.util.tracker, \
- org.jboss.osgi.common.log
+ org.jboss.osgi.common
Include-Resource: \
style/osgishop.css=../META-INF/style/osgishop.css, \
- notes=../META-INF/notes
\ No newline at end of file
+ notes=../META-INF/notes
+
+-removeheaders: Include-Resource
+
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/mall.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/mall.bnd 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/mall.bnd 2009-05-28 12:21:21 UTC (rev 89492)
@@ -9,6 +9,6 @@
Import-Package: \
org.osgi.framework, \
org.osgi.service.log, \
- org.jboss.osgi.common.log, \
+ org.jboss.osgi.common, \
org.jboss.test.osgi.trailblazer
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-creditcard.bnd 2009-05-28 12:21:21 UTC (rev 89492)
@@ -8,5 +8,5 @@
Import-Package: \
org.osgi.framework, \
org.osgi.service.log, \
- org.jboss.osgi.common.log, \
+ org.jboss.osgi.common, \
org.jboss.test.osgi.trailblazer
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/pay-paypal.bnd 2009-05-28 12:21:21 UTC (rev 89492)
@@ -8,5 +8,5 @@
Import-Package: \
org.osgi.framework, \
org.osgi.service.log, \
- org.jboss.osgi.common.log, \
+ org.jboss.osgi.common, \
org.jboss.test.osgi.trailblazer
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-pets.bnd 2009-05-28 12:21:21 UTC (rev 89492)
@@ -8,5 +8,5 @@
Import-Package: \
org.osgi.framework, \
org.osgi.service.log, \
- org.jboss.osgi.common.log, \
+ org.jboss.osgi.common, \
org.jboss.test.osgi.trailblazer
Modified: projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd 2009-05-28 11:32:08 UTC (rev 89491)
+++ projects/jboss-osgi/trunk/testsuite/trailblazer/src/test/resources/trailblazer/shop-sports.bnd 2009-05-28 12:21:21 UTC (rev 89492)
@@ -10,5 +10,5 @@
org.osgi.framework, \
org.osgi.service.log, \
org.jboss.osgi.jndi, \
- org.jboss.osgi.common.log, \
+ org.jboss.osgi.common, \
org.jboss.test.osgi.trailblazer
17 years, 1 month
JBoss-OSGI SVN: r89477 - in projects/jboss-osgi/trunk: bundles/hotdeploy and 6 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-27 16:44:18 -0400 (Wed, 27 May 2009)
New Revision: 89477
Added:
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java
Removed:
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerHelper.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/HotDeployActivator.java
Modified:
projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScanner.java
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
projects/jboss-osgi/trunk/distribution/pom.xml
projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/pom.xml
Log:
Add DeploymentScanner to Runtime
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml 2009-05-27 17:24:28 UTC (rev 89476)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/pom.xml 2009-05-27 20:44:18 UTC (rev 89477)
@@ -49,7 +49,7 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.service.hotdeploy.internal.HotDeployActivator</Bundle-Activator>
+ <Bundle-Activator>org.jboss.osgi.service.hotdeploy.internal.DeploymentScannerActivator</Bundle-Activator>
<Private-Package>org.jboss.osgi.service.hotdeploy.internal</Private-Package>
<Export-Package>
org.jboss.osgi.service.hotdeploy;version=${version}
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScanner.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScanner.java 2009-05-27 17:24:28 UTC (rev 89476)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/DeploymentScanner.java 2009-05-27 20:44:18 UTC (rev 89477)
@@ -34,9 +34,9 @@
public interface DeploymentScanner
{
/**
- * The property that names the scan location: org.jboss.osgi.hotdeploy.scan
+ * The property that names the scan location: org.jboss.osgi.hotdeploy.scandir
*/
- String PROPERTY_SCAN_LOCATION = "org.jboss.osgi.hotdeploy.scan";
+ String PROPERTY_SCAN_LOCATION = "org.jboss.osgi.hotdeploy.scandir";
/**
* The property to defines the scan interval: org.jboss.osgi.hotdeploy.interval
Copied: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java (from rev 89471, projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/HotDeployActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerActivator.java 2009-05-27 20:44:18 UTC (rev 89477)
@@ -0,0 +1,56 @@
+/*
+ * 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.service.hotdeploy.internal;
+
+//$Id$
+
+import org.jboss.osgi.service.hotdeploy.DeploymentScanner;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The {@link DeploymentScanner} service activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-May-2009
+ */
+public class DeploymentScannerActivator implements BundleActivator
+{
+ private DeploymentScannerImpl service;
+
+ public void start(BundleContext context)
+ {
+ service = new DeploymentScannerImpl(context);
+ context.registerService(DeploymentScanner.class.getName(), service, null);
+
+ service.start();
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (service != null)
+ {
+ service.stop();
+ service = null;
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerHelper.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerHelper.java 2009-05-27 17:24:28 UTC (rev 89476)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerHelper.java 2009-05-27 20:44:18 UTC (rev 89477)
@@ -1,161 +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.service.hotdeploy.internal;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.service.hotdeploy.BundleInfo;
-import org.jboss.osgi.service.hotdeploy.DeploymentScanner;
-import org.jboss.osgi.service.hotdeploy.BundleInfo.State;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.service.log.LogService;
-
-/**
- * A DeploymentScanner helper
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class DeploymentScannerHelper
-{
- private LogServiceTracker log;
- private BundleContext context;
- private DeploymentScanner scanner;
- private List<BundleInfo> lastScan;
-
- public DeploymentScannerHelper(BundleContext context, DeploymentScanner scanner)
- {
- this.log = new LogServiceTracker(context);
- this.context = context;
- this.scanner = scanner;
-
- this.lastScan = Arrays.asList(scanner.getBundles());
- }
-
- public void scan()
- {
- List<BundleInfo> currScan = Arrays.asList(scanner.getBundles());
-
- processOldDeployments(currScan);
-
- processNewDeployments(currScan);
-
- lastScan = currScan;
- }
-
- private void processOldDeployments(List<BundleInfo> currScan)
- {
- List<BundleInfo> diff = new ArrayList<BundleInfo>();
-
- // Detect OLD bundles that are not in the current scan
- for (BundleInfo info : lastScan)
- {
- if (currScan.contains(info) == false)
- diff.add(info);
- }
-
- for (BundleInfo info : diff)
- {
- Bundle bundle = getInstalledBundle(context, info.getSymbolicName());
- if (bundle != null)
- {
- if (info.getState() == State.INSTALLED || info.getState() == State.ACTIVE)
- {
- try
- {
- log.log(LogService.LOG_INFO, "Uninstall: " + info.getSymbolicName());
- bundle.uninstall();
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot uninstall bundle", ex);
- }
- }
- }
- }
- }
-
- private void processNewDeployments(List<BundleInfo> currScan)
- {
- List<BundleInfo> diff = new ArrayList<BundleInfo>();
-
- // Detect NEW bundles that are not in the last scan
- for (BundleInfo info : currScan)
- {
- if (lastScan.contains(info) == false)
- diff.add(info);
- }
-
- for (BundleInfo info : diff)
- {
- if (info.getState() == BundleInfo.State.NEW)
- {
- Bundle bundle = null;
- try
- {
- log.log(LogService.LOG_INFO, "Install: " + info.getSymbolicName());
- bundle = context.installBundle(info.getLocation().toExternalForm());
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot install bundle", ex);
- }
-
- if (bundle != null)
- {
- try
- {
- log.log(LogService.LOG_INFO, "Start: " + info.getSymbolicName());
- bundle.start();
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot start bundle", ex);
- }
- }
- }
- }
- }
-
- static Bundle getInstalledBundle(BundleContext context, String symbolicName)
- {
- Bundle bundle = null;
-
- for (Bundle aux : context.getBundles())
- {
- if (aux.getSymbolicName().equals(symbolicName))
- {
- bundle = aux;
- break;
- }
- }
-
- return bundle;
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-05-27 17:24:28 UTC (rev 89476)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerImpl.java 2009-05-27 20:44:18 UTC (rev 89477)
@@ -30,15 +30,20 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.service.hotdeploy.BundleInfo;
import org.jboss.osgi.service.hotdeploy.DeploymentScanner;
+import org.jboss.osgi.service.hotdeploy.BundleInfo.State;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.service.log.LogService;
/**
* The DeploymentScanner service
@@ -48,6 +53,7 @@
*/
public class DeploymentScannerImpl implements DeploymentScanner
{
+ private LogServiceTracker log;
private BundleContext context;
private long scanInterval;
@@ -55,10 +61,11 @@
private long scanCount;
private ScannerThread scannerThread;
- private DeploymentScannerHelper scanHelper;
+ private List<BundleInfo> lastScan = new ArrayList<BundleInfo>();
public DeploymentScannerImpl(BundleContext context)
{
+ this.log = new LogServiceTracker(context);
this.context = context;
initScanner(context);
@@ -66,7 +73,7 @@
public void start()
{
- scanHelper = new DeploymentScannerHelper(context, this);
+ log.log(LogService.LOG_INFO, "Start DeploymentScanner: [scandir=" + scanLocation + ",interval=" + scanInterval + "ms]");
scannerThread = new ScannerThread(context, this);
scannerThread.start();
}
@@ -75,6 +82,7 @@
{
if (scannerThread != null)
{
+ log.log(LogService.LOG_INFO, "Stop DeploymentScanner");
scannerThread.stopScan();
scannerThread = null;
}
@@ -82,17 +90,116 @@
public void scan()
{
- scanHelper.scan();
+ List<BundleInfo> currScan = Arrays.asList(getBundles());
+
+ processOldDeployments(currScan);
+
+ processNewDeployments(currScan);
+
+ lastScan = currScan;
scanCount++;
}
+ private void processOldDeployments(List<BundleInfo> currScan)
+ {
+ List<BundleInfo> diff = new ArrayList<BundleInfo>();
+
+ // Detect OLD bundles that are not in the current scan
+ for (BundleInfo info : lastScan)
+ {
+ if (currScan.contains(info) == false)
+ diff.add(info);
+ }
+
+ for (BundleInfo info : diff)
+ {
+ Bundle bundle = getInstalledBundle(info.getSymbolicName());
+ if (bundle != null)
+ {
+ if (info.getState() == State.INSTALLED || info.getState() == State.ACTIVE)
+ {
+ try
+ {
+ log.log(LogService.LOG_DEBUG, "Uninstall: " + info.getSymbolicName());
+ bundle.uninstall();
+ }
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot uninstall bundle", ex);
+ }
+ }
+ }
+ }
+ }
+
+ private void processNewDeployments(List<BundleInfo> currScan)
+ {
+ List<BundleInfo> diff = new ArrayList<BundleInfo>();
+
+ // Detect NEW bundles that are not in the last scan
+ for (BundleInfo info : currScan)
+ {
+ if (lastScan.contains(info) == false)
+ diff.add(info);
+ }
+
+ // Install the NEW bundles
+ List<Bundle> bundles = new ArrayList<Bundle>();
+ for (BundleInfo info : diff)
+ {
+ if (info.getState() == BundleInfo.State.NEW)
+ {
+ try
+ {
+ log.log(LogService.LOG_DEBUG, "Install: " + info.getSymbolicName());
+ Bundle bundle = context.installBundle(info.getLocation().toExternalForm());
+ bundles.add(bundle);
+ }
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot install bundle: " + info.getSymbolicName(), ex);
+ }
+ }
+ }
+
+ // Start the installed bundles
+ for (Bundle bundle : bundles)
+ {
+ try
+ {
+ log.log(LogService.LOG_DEBUG, "Start: " + bundle.getSymbolicName());
+ bundle.start();
+ }
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot start bundle: " + bundle.getSymbolicName(), ex);
+ }
+ }
+ }
+
+ private Bundle getInstalledBundle(String symbolicName)
+ {
+ Bundle bundle = null;
+
+ for (Bundle aux : context.getBundles())
+ {
+ if (aux.getSymbolicName().equals(symbolicName))
+ {
+ bundle = aux;
+ break;
+ }
+ }
+
+ return bundle;
+ }
+
public BundleInfo[] getBundles()
{
List<BundleInfo> bundles = new ArrayList<BundleInfo>();
for (File file : scanLocation.listFiles())
{
String symbolicName = getSymbolicName(file);
- Bundle bundle = DeploymentScannerHelper.getInstalledBundle(context, symbolicName);
+ Bundle bundle = getInstalledBundle(symbolicName);
BundleInfo bundleInfo = new BundleInfo(toURL(file), symbolicName, bundle);
bundles.add(bundleInfo);
}
@@ -118,11 +225,11 @@
private void initScanner(BundleContext context)
{
scanInterval = 2000;
-
+
String interval = context.getProperty(PROPERTY_SCAN_INTERVAL);
if (interval != null)
scanInterval = new Long(interval);
-
+
String scanLoc = context.getProperty(PROPERTY_SCAN_LOCATION);
if (scanLoc == null)
throw new IllegalStateException("Cannot obtain value for property: '" + PROPERTY_SCAN_LOCATION + "'");
Deleted: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/HotDeployActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/HotDeployActivator.java 2009-05-27 17:24:28 UTC (rev 89476)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/HotDeployActivator.java 2009-05-27 20:44:18 UTC (rev 89477)
@@ -1,56 +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.service.hotdeploy.internal;
-
-//$Id$
-
-import org.jboss.osgi.service.hotdeploy.DeploymentScanner;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * The {@link DeploymentScanner} service activator
- *
- * @author thomas.diesler(a)jboss.com
- * @since 27-May-2009
- */
-public class HotDeployActivator implements BundleActivator
-{
- private DeploymentScannerImpl service;
-
- public void start(BundleContext context)
- {
- service = new DeploymentScannerImpl(context);
- context.registerService(DeploymentScanner.class.getName(), service, null);
-
- service.start();
- }
-
- public void stop(BundleContext context)
- {
- if (service != null)
- {
- service.stop();
- service = null;
- }
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-27 17:24:28 UTC (rev 89476)
+++ projects/jboss-osgi/trunk/bundles/microcontainer/src/main/java/org/jboss/osgi/microcontainer/internal/MicrocontainerServiceImpl.java 2009-05-27 20:44:18 UTC (rev 89477)
@@ -56,6 +56,7 @@
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
/**
* An OSGi Service the gives access to the Kernel.
@@ -150,22 +151,63 @@
void start()
{
- // Get the required MBeanServer
- MBeanServer mbeanServer = getMBeanServer();
+ final MicrocontainerService mcService = this;
+
+ final Kernel kernel = getKernel();
+ final KernelController controller = kernel.getController();
+
+ // Preregister some beans
+ installBean(controller, BEAN_SYSTEM_BUNDLE_CONTEXT, context);
+ installBean(controller, BEAN_KERNEL, kernel);
+ installBean(controller, BEAN_KERNEL_CONTROLLER, controller);
+
+ // Register the MicrocontainerServiceMBean
+ ServiceTracker tracker = new ServiceTracker(context, MBeanServer.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ // Install the MBeanServer
+ MBeanServer mbeanServer = (MBeanServer)super.addingService(reference);
+ installBean(controller, BEAN_MBEAN_SERVER, mbeanServer);
+
+ // Deploy the deployer beans
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+ URL deployersURL = context.getBundle().getResource("META-INF/base-deployers-beans.xml");
+ deployer.deploy(deployersURL);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
- // Preregister some beans
+ // Register the MicrocontainerService
+ log.log(LogService.LOG_DEBUG, "Register MicrocontainerService");
+ context.registerService(MicrocontainerService.class.getName(), mcService, null);
+
+ // Register the MicrocontainerServiceMBean
+ registerMicrocontainerServiceMBean(mbeanServer);
+
+ return mbeanServer;
+ }
+ };
+ tracker.open();
+ }
+
+ void stop()
+ {
+ unregisterMicrocontainerServiceMBean();
+ }
+
+ private void installBean(KernelController controller, String beanName, Object beanImpl)
+ {
try
{
- Kernel kernel = getKernel();
- KernelController controller = kernel.getController();
ControllerContextActions actions = new AbstractControllerContextActions(new HashMap<ControllerState, ControllerContextAction>());
- controller.install(new PreInstalledControllerContext(BEAN_SYSTEM_BUNDLE_CONTEXT, actions, context));
- controller.install(new PreInstalledControllerContext(BEAN_KERNEL, actions, kernel));
- controller.install(new PreInstalledControllerContext(BEAN_KERNEL_CONTROLLER, actions, controller));
- controller.install(new PreInstalledControllerContext(BEAN_MBEAN_SERVER, actions, mbeanServer));
-
- URL deployersURL = context.getBundle().getResource("META-INF/base-deployers-beans.xml");
- deployer.deploy(deployersURL);
+ controller.install(new PreInstalledControllerContext(beanName, actions, beanImpl));
}
catch (RuntimeException rte)
{
@@ -173,39 +215,18 @@
}
catch (Throwable ex)
{
- throw new IllegalStateException("Cannot register MC bean", ex);
+ throw new IllegalStateException("Cannot register bean: " + beanName, ex);
}
-
- log.log(LogService.LOG_DEBUG, "Register MicrocontainerService");
- context.registerService(MicrocontainerService.class.getName(), this, null);
-
- // Register the MicrocontainerServiceMBean
- registerMicrocontainerServiceMBean(mbeanServer);
}
-
- void stop()
+
+ private void registerMicrocontainerServiceMBean(MBeanServer mbeanServer)
{
- unregisterMicrocontainerServiceMBean(getMBeanServer());
- }
-
- private MBeanServer getMBeanServer()
- {
- ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
- if (sref == null)
- throw new IllegalStateException("No MBeanServer registered");
-
- MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
- return mbeanServer;
- }
-
- private void registerMicrocontainerServiceMBean(MBeanServer server)
- {
// Register the MicrocontainerServiceMBean
try
{
log.log(LogService.LOG_DEBUG, "Register MicrocontainerServiceMBean");
StandardMBean mbean = new StandardMBean(this, MicrocontainerServiceMBean.class);
- server.registerMBean(mbean, MBEAN_MICROCONTAINER_SERVICE);
+ mbeanServer.registerMBean(mbean, MBEAN_MICROCONTAINER_SERVICE);
}
catch (Exception ex)
{
@@ -213,19 +234,24 @@
}
}
- private void unregisterMicrocontainerServiceMBean(MBeanServer server)
+ private void unregisterMicrocontainerServiceMBean()
{
- if (server.isRegistered(MBEAN_MICROCONTAINER_SERVICE))
+ ServiceReference sref = context.getServiceReference(MBeanServer.class.getName());
+ if (sref != null)
{
- try
+ MBeanServer mbeanServer = (MBeanServer)context.getService(sref);
+ if (mbeanServer.isRegistered(MBEAN_MICROCONTAINER_SERVICE))
{
- log.log(LogService.LOG_DEBUG, "Unregister MicrocontainerServiceMBean");
- server.unregisterMBean(MBEAN_MICROCONTAINER_SERVICE);
+ try
+ {
+ log.log(LogService.LOG_DEBUG, "Unregister MicrocontainerServiceMBean");
+ mbeanServer.unregisterMBean(MBEAN_MICROCONTAINER_SERVICE);
+ }
+ catch (Exception ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot unregister MicrocontainerServiceMBean", ex);
+ }
}
- catch (Exception ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot unregister MicrocontainerServiceMBean", ex);
- }
}
}
Modified: projects/jboss-osgi/trunk/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/pom.xml 2009-05-27 17:24:28 UTC (rev 89476)
+++ projects/jboss-osgi/trunk/distribution/pom.xml 2009-05-27 20:44:18 UTC (rev 89477)
@@ -76,7 +76,7 @@
<version>${version}</version>
<type>jdocbook</type>
</dependency>
-
+
<!-- Bundles -->
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
@@ -88,6 +88,10 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-hotdeploy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-jaxb</artifactId>
</dependency>
<dependency>
@@ -144,7 +148,7 @@
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</dependency>
-
+
<!-- Felix Dependencies -->
<dependency>
<groupId>org.jboss.osgi</groupId>
@@ -186,7 +190,7 @@
<artifactId>org.apache.felix.metatype</artifactId>
<scope>provided</scope>
</dependency>
-
+
<!-- Knopflerfish Dependencies -->
<dependency>
<groupId>org.jboss.osgi</groupId>
@@ -208,7 +212,7 @@
<groupId>org.knopflerfish</groupId>
<artifactId>org.knopflerfish.framework</artifactId>
</dependency>
-
+
<!-- izpack -->
<dependency>
<groupId>org.codehaus.izpack</groupId>
Modified: projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-27 17:24:28 UTC (rev 89476)
+++ projects/jboss-osgi/trunk/distribution/runtime/conf/jboss-osgi-felix.properties 2009-05-27 20:44:18 UTC (rev 89477)
@@ -11,6 +11,9 @@
org.osgi.framework.storage=${osgi.home}/data/osgi-store
org.osgi.framework.storage.clean=onFirstInit
+# Hot Deployement
+org.jboss.osgi.hotdeploy.scandir=${osgi.home}/bundles
+
# HTTP Service Port
org.osgi.service.http.port=8090
@@ -68,16 +71,6 @@
# Bundles that need to be started automatically
org.jboss.osgi.spi.framework.autoStart=\
file://${osgi.home}/bundles/org.apache.felix.log.jar \
- file://${osgi.home}/bundles/jboss-osgi-apache-xerces.jar \
- file://${osgi.home}/bundles/jboss-osgi-common-core.jar \
- file://${osgi.home}/bundles/jboss-osgi-jaxb.jar \
- file://${osgi.home}/bundles/jboss-osgi-xml-binding.jar \
file://${osgi.home}/bundles/jboss-osgi-common.jar \
file://${osgi.home}/bundles/jboss-osgi-logging.jar \
- file://${osgi.home}/bundles/jboss-osgi-jndi.jar \
- file://${osgi.home}/bundles/jboss-osgi-jmx.jar \
- file://${osgi.home}/bundles/jboss-osgi-microcontainer.jar \
- file://${osgi.home}/bundles/org.apache.felix.metatype.jar \
- file://${osgi.home}/bundles/org.apache.felix.configadmin.jar \
- file://${osgi.home}/bundles/org.apache.felix.http.jetty.jar \
- file://${osgi.home}/bundles/jboss-osgi-webconsole.jar
+ file://${osgi.home}/bundles/jboss-osgi-hotdeploy.jar
Modified: projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-27 17:24:28 UTC (rev 89476)
+++ projects/jboss-osgi/trunk/distribution/src/main/resources/installer/install-definition.xml 2009-05-27 20:44:18 UTC (rev 89477)
@@ -174,14 +174,15 @@
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/bundles" override="true">
<include name="jboss-osgi-apache-xerces.jar" />
<include name="jboss-osgi-jaxb.jar" />
- <include name="jboss-osgi-xml-binding.jar" />
<include name="jboss-osgi-common-core.jar" />
<include name="jboss-osgi-common.jar" />
<include name="jboss-osgi-logging.jar" />
+ <include name="jboss-osgi-hotdeploy.jar" />
<include name="jboss-osgi-jndi.jar" />
<include name="jboss-osgi-jmx.jar" />
<include name="jboss-osgi-microcontainer.jar" />
<include name="jboss-osgi-webconsole.jar" />
+ <include name="jboss-osgi-xml-binding.jar" />
<include name="org.apache.felix.configadmin.jar" />
<include name="org.apache.felix.http.jetty.jar" />
<include name="org.apache.felix.log.jar" />
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-05-27 17:24:28 UTC (rev 89476)
+++ projects/jboss-osgi/trunk/pom.xml 2009-05-27 20:44:18 UTC (rev 89477)
@@ -52,6 +52,7 @@
<version.jboss.osgi.common>1.0.0.Beta2</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.11</version.jboss.osgi.common.core>
<version.jboss.osgi.deployers>1.0.0.Beta2</version.jboss.osgi.deployers>
+ <version.jboss.osgi.hotdeploy>1.0.0</version.jboss.osgi.hotdeploy>
<version.jboss.osgi.husky>1.0.0</version.jboss.osgi.husky>
<version.jboss.osgi.integration.jbossas>1.0.0.Beta2</version.jboss.osgi.integration.jbossas>
<version.jboss.osgi.jaxb>2.1.10</version.jboss.osgi.jaxb>
@@ -111,6 +112,11 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-hotdeploy</artifactId>
+ <version>${version.jboss.osgi.hotdeploy}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-jmx</artifactId>
<version>${version.jboss.osgi.jmx}</version>
</dependency>
17 years, 1 month
JBoss-OSGI SVN: r89473 - projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-05-27 11:40:19 -0400 (Wed, 27 May 2009)
New Revision: 89473
Modified:
projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerHelper.java
Log:
Only uninstall when in state INSTALLED || ACTIVE
Modified: projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerHelper.java
===================================================================
--- projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerHelper.java 2009-05-27 15:33:29 UTC (rev 89472)
+++ projects/jboss-osgi/trunk/bundles/hotdeploy/src/main/java/org/jboss/osgi/service/hotdeploy/internal/DeploymentScannerHelper.java 2009-05-27 15:40:19 UTC (rev 89473)
@@ -30,6 +30,7 @@
import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.service.hotdeploy.BundleInfo;
import org.jboss.osgi.service.hotdeploy.DeploymentScanner;
+import org.jboss.osgi.service.hotdeploy.BundleInfo.State;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -68,6 +69,38 @@
lastScan = currScan;
}
+ private void processOldDeployments(List<BundleInfo> currScan)
+ {
+ List<BundleInfo> diff = new ArrayList<BundleInfo>();
+
+ // Detect OLD bundles that are not in the current scan
+ for (BundleInfo info : lastScan)
+ {
+ if (currScan.contains(info) == false)
+ diff.add(info);
+ }
+
+ for (BundleInfo info : diff)
+ {
+ Bundle bundle = getInstalledBundle(context, info.getSymbolicName());
+ if (bundle != null)
+ {
+ if (info.getState() == State.INSTALLED || info.getState() == State.ACTIVE)
+ {
+ try
+ {
+ log.log(LogService.LOG_INFO, "Uninstall: " + info.getSymbolicName());
+ bundle.uninstall();
+ }
+ catch (BundleException ex)
+ {
+ log.log(LogService.LOG_ERROR, "Cannot uninstall bundle", ex);
+ }
+ }
+ }
+ }
+ }
+
private void processNewDeployments(List<BundleInfo> currScan)
{
List<BundleInfo> diff = new ArrayList<BundleInfo>();
@@ -110,32 +143,6 @@
}
}
- private void processOldDeployments(List<BundleInfo> currScan)
- {
- List<BundleInfo> diff = new ArrayList<BundleInfo>();
-
- // Detect OLD bundles that are not in the current scan
- for (BundleInfo info : lastScan)
- {
- if (currScan.contains(info) == false)
- diff.add(info);
- }
-
- for (BundleInfo info : diff)
- {
- Bundle bundle = getInstalledBundle(context, info.getSymbolicName());
- try
- {
- log.log(LogService.LOG_INFO, "Uninstall: " + info.getSymbolicName());
- bundle.uninstall();
- }
- catch (BundleException ex)
- {
- log.log(LogService.LOG_ERROR, "Cannot uninstall bundle", ex);
- }
- }
- }
-
static Bundle getInstalledBundle(BundleContext context, String symbolicName)
{
Bundle bundle = null;
17 years, 1 month