[jboss-cvs] JBossAS SVN: r93026 - in projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi: service and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Aug 31 09:11:30 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-08-31 09:11:29 -0400 (Mon, 31 Aug 2009)
New Revision: 93026

Added:
   projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/MicrocontainerCapability.java
   projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java
Log:
Add support for MicrocontainerService to MCFramework

Copied: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/MicrocontainerCapability.java (from rev 93017, projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerCapability.java)
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/MicrocontainerCapability.java	                        (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/capability/MicrocontainerCapability.java	2009-08-31 13:11:29 UTC (rev 93026)
@@ -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.capability;
+
+//$Id$
+
+import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+
+/**
+ * Adds the Microcontainer capability to the {@link OSGiRuntime}
+ * under test. 
+ * 
+ * It is ignored if the {@link MicrocontainerService} is already registered.
+ * 
+ * Installed bundles: jboss-osgi-microcontainer.jar
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public class MicrocontainerCapability extends Capability
+{
+   public MicrocontainerCapability()
+   {
+      super(MicrocontainerService.class.getName());
+      
+      addBundle("bundles/jboss-osgi-microcontainer.jar");
+   }
+}
\ No newline at end of file

Copied: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java (from rev 93017, projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/MicrocontainerService.java)
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java	                        (rev 0)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/service/MicrocontainerService.java	2009-08-31 13:11:29 UTC (rev 93026)
@@ -0,0 +1,72 @@
+/*
+ * 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.service;
+
+//$Id$
+
+import java.util.List;
+
+/**
+ * An OSGi Service the gives access to the Kernel and MBeanServer.
+ * 
+ * @author thomas.diesler at 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);
+
+   /*
+    * Get a registered bean from the Kernel.
+    * @return null if there is no bean registered under this name
+    */
+   <T> T getRegisteredBean(Class<T> clazz, String beanName);
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list