You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2012/05/07 19:27:09 UTC

svn commit: r1335141 - in /karaf/cellar/trunk: ./ bundle/src/main/java/org/apache/karaf/cellar/bundle/ bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/ management/ management/src/main/java/org/apache/karaf/cellar/management/ management/src/ma...

Author: jbonofre
Date: Mon May  7 17:27:08 2012
New Revision: 1335141

URL: http://svn.apache.org/viewvc?rev=1335141&view=rev
Log:
[KARAF-1435] Fix TCCL in bundle module
[KARAF-1423] Add the CellarBundleMBean

Added:
    karaf/cellar/trunk/management/src/main/java/org/apache/karaf/cellar/management/CellarBundleMBean.java
    karaf/cellar/trunk/management/src/main/java/org/apache/karaf/cellar/management/internal/CellarBundleMBeanImpl.java
Modified:
    karaf/cellar/trunk/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java
    karaf/cellar/trunk/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/InstallBundleCommand.java
    karaf/cellar/trunk/management/pom.xml
    karaf/cellar/trunk/management/src/main/resources/OSGI-INF/blueprint/blueprint.xml
    karaf/cellar/trunk/pom.xml

Modified: karaf/cellar/trunk/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java?rev=1335141&r1=1335140&r2=1335141&view=diff
==============================================================================
--- karaf/cellar/trunk/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java (original)
+++ karaf/cellar/trunk/bundle/src/main/java/org/apache/karaf/cellar/bundle/BundleSynchronizer.java Mon May  7 17:27:08 2012
@@ -70,32 +70,36 @@ public class BundleSynchronizer extends 
             String groupName = group.getName();
             Map<String, BundleState> bundleDistributedMap = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
 
-            for (Map.Entry<String, BundleState> entry : bundleDistributedMap.entrySet()) {
-                String id = entry.getKey();
-                BundleState state = entry.getValue();
-
-                //Check if the pid is marked as local.
-                String[] tokens = id.split("/");
-                String symbolicName = tokens[0];
-                String version = tokens[1];
-                if (tokens != null && tokens.length > 2) {
-                    if (state != null) {
-                        String bundleLocation = state.getLocation();
-                        if (isAllowed(group, Constants.CATEGORY, bundleLocation, EventType.INBOUND)) {
-                            try {
-                                if (state.getStatus() == BundleEvent.INSTALLED) {
-                                    installBundleFromLocation(state.getLocation());
-                                } else if (state.getStatus() == BundleEvent.STARTED) {
-                                    installBundleFromLocation(state.getLocation());
-                                    startBundle(symbolicName, version);
+            ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
+            try {
+                Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+                for (Map.Entry<String, BundleState> entry : bundleDistributedMap.entrySet()) {
+                    String id = entry.getKey();
+                    BundleState state = entry.getValue();
+
+                    String[] tokens = id.split("/");
+                    String symbolicName = tokens[0];
+                    String version = tokens[1];
+                    if (tokens != null && tokens.length == 2) {
+                        if (state != null) {
+                            String bundleLocation = state.getLocation();
+                            if (isAllowed(group, Constants.CATEGORY, bundleLocation, EventType.INBOUND)) {
+                                try {
+                                    if (state.getStatus() == BundleEvent.INSTALLED) {
+                                        installBundleFromLocation(state.getLocation());
+                                    } else if (state.getStatus() == BundleEvent.STARTED) {
+                                        installBundleFromLocation(state.getLocation());
+                                        startBundle(symbolicName, version);
+                                    }
+                                } catch (BundleException e) {
+                                    LOGGER.error("CELLAR BUNDLE: failed to pull bundle {}", id, e);
                                 }
-                            } catch (BundleException e) {
-                                LOGGER.error("CELLAR BUNDLE: error while pulling bundle", e);
-                            }
+                            } else LOGGER.warn("CELLAR BUNDLE: bundle {} is marked as BLOCKED INBOUND", bundleLocation);
                         }
-                        LOGGER.warn("CELLAR BUNDLE: bundle {} is marked as BLOCKED INBOUND", bundleLocation);
                     }
                 }
+            } finally {
+                Thread.currentThread().setContextClassLoader(originalClassLoader);
             }
         }
     }
@@ -114,35 +118,43 @@ public class BundleSynchronizer extends 
         if (group != null) {
             String groupName = group.getName();
             Map<String, BundleState> bundleTable = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
-            Bundle[] bundles;
-            BundleContext bundleContext = ((BundleReference) getClass().getClassLoader()).getBundle().getBundleContext();
 
-            bundles = bundleContext.getBundles();
-            for (Bundle bundle : bundles) {
-                String symbolicName = bundle.getSymbolicName();
-                String version = bundle.getVersion().toString();
-                String bundleLocation = bundle.getLocation();
-                int status = bundle.getState();
-                String id = symbolicName + "/" + version;
-
-                //Check if the pid is marked as local.
-                if (isAllowed(group, Constants.CATEGORY, bundleLocation, EventType.OUTBOUND)) {
-
-                    BundleState bundleState = new BundleState();
-                    bundleState.setLocation(bundleLocation);
-                    bundleState.setStatus(status);
-
-                    BundleState existingState = bundleTable.get(id);
-                    RemoteBundleEvent event = null;
-                    if (existingState == null) {
-                        // update the distributed map
-                        event = new RemoteBundleEvent(symbolicName, version, bundleLocation, status);
-                        bundleTable.put(id, bundleState);
-                    }
+            ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
+            try {
+                Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+                Bundle[] bundles;
+                BundleContext bundleContext = ((BundleReference) getClass().getClassLoader()).getBundle().getBundleContext();
+
+                bundles = bundleContext.getBundles();
+                for (Bundle bundle : bundles) {
+                    String symbolicName = bundle.getSymbolicName();
+                    String version = bundle.getVersion().toString();
+                    String bundleLocation = bundle.getLocation();
+                    int status = bundle.getState();
+                    String id = symbolicName + "/" + version;
+
+                    //Check if the pid is marked as local.
+                    if (isAllowed(group, Constants.CATEGORY, bundleLocation, EventType.OUTBOUND)) {
+
+                        BundleState bundleState = new BundleState();
+                        bundleState.setLocation(bundleLocation);
+                        bundleState.setStatus(status);
+
+                        BundleState existingState = bundleTable.get(id);
+                        RemoteBundleEvent event = null;
+
+                        if (existingState == null) {
+                            // update the distributed map
+                            event = new RemoteBundleEvent(symbolicName, version, bundleLocation, status);
+                            bundleTable.put(id, bundleState);
+                        }
 
-                    // broadcast the event
-                    eventProducer.produce(event);
-                } else LOGGER.warn("CELLAR BUNDLE: bundle {} is marked as BLOCKED OUTBOUND", bundleLocation);
+                        // broadcast the event
+                        eventProducer.produce(event);
+                    } else LOGGER.warn("CELLAR BUNDLE: bundle {} is marked as BLOCKED OUTBOUND", bundleLocation);
+                }
+            } finally {
+                Thread.currentThread().setContextClassLoader(originalClassLoader);
             }
         }
     }

Modified: karaf/cellar/trunk/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/InstallBundleCommand.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/InstallBundleCommand.java?rev=1335141&r1=1335140&r2=1335141&view=diff
==============================================================================
--- karaf/cellar/trunk/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/InstallBundleCommand.java (original)
+++ karaf/cellar/trunk/bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/InstallBundleCommand.java Mon May  7 17:27:08 2012
@@ -69,16 +69,22 @@ public class InstallBundleCommand extend
             String version = manifest.getMainAttributes().getValue("Bundle-Version");
             jarInputStream.close();
 
-            // populate the cluster map
-            Map<String, BundleState> bundles = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
-            BundleState state = new BundleState();
-            state.setLocation(url);
-            if (start) {
-                state.setStatus(BundleEvent.STARTED);
-            } else {
-                state.setStatus(BundleEvent.INSTALLED);
+            ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
+            try {
+                Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+                // populate the cluster map
+                Map<String, BundleState> bundles = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
+                BundleState state = new BundleState();
+                state.setLocation(url);
+                if (start) {
+                    state.setStatus(BundleEvent.STARTED);
+                } else {
+                    state.setStatus(BundleEvent.INSTALLED);
+                }
+                bundles.put(name + "/" + version, state);
+            } finally {
+                Thread.currentThread().setContextClassLoader(originalClassLoader);
             }
-            bundles.put(name + "/" + version, state);
 
             // broadcast the event
             RemoteBundleEvent event = new RemoteBundleEvent(name, version, url, BundleEvent.INSTALLED);

Modified: karaf/cellar/trunk/management/pom.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/management/pom.xml?rev=1335141&r1=1335140&r2=1335141&view=diff
==============================================================================
--- karaf/cellar/trunk/management/pom.xml (original)
+++ karaf/cellar/trunk/management/pom.xml Mon May  7 17:27:08 2012
@@ -67,6 +67,10 @@
         </dependency>
         <dependency>
             <groupId>org.apache.karaf.cellar</groupId>
+            <artifactId>org.apache.karaf.cellar.bundle</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.karaf.cellar</groupId>
             <artifactId>org.apache.karaf.cellar.hazelcast</artifactId>
         </dependency>
         <dependency>

Added: karaf/cellar/trunk/management/src/main/java/org/apache/karaf/cellar/management/CellarBundleMBean.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/management/src/main/java/org/apache/karaf/cellar/management/CellarBundleMBean.java?rev=1335141&view=auto
==============================================================================
--- karaf/cellar/trunk/management/src/main/java/org/apache/karaf/cellar/management/CellarBundleMBean.java (added)
+++ karaf/cellar/trunk/management/src/main/java/org/apache/karaf/cellar/management/CellarBundleMBean.java Mon May  7 17:27:08 2012
@@ -0,0 +1,30 @@
+/*
+ * 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.apache.karaf.cellar.management;
+
+import javax.management.openmbean.TabularData;
+
+/**
+ * MBean interface describing the operations and attributes on Cellar bundles.
+ */
+public interface CellarBundleMBean {
+
+    void install(String group, String location) throws Exception;
+    void uninstall(String group, String symbolicName, String version) throws Exception;
+    void start(String group, String symbolicName, String version) throws Exception;
+    void stop(String group, String symbolicName, String version) throws Exception;
+
+    TabularData getBundles(String group) throws Exception;
+
+}

Added: karaf/cellar/trunk/management/src/main/java/org/apache/karaf/cellar/management/internal/CellarBundleMBeanImpl.java
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/management/src/main/java/org/apache/karaf/cellar/management/internal/CellarBundleMBeanImpl.java?rev=1335141&view=auto
==============================================================================
--- karaf/cellar/trunk/management/src/main/java/org/apache/karaf/cellar/management/internal/CellarBundleMBeanImpl.java (added)
+++ karaf/cellar/trunk/management/src/main/java/org/apache/karaf/cellar/management/internal/CellarBundleMBeanImpl.java Mon May  7 17:27:08 2012
@@ -0,0 +1,236 @@
+/*
+ * 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.apache.karaf.cellar.management.internal;
+
+import org.apache.karaf.cellar.bundle.BundleState;
+import org.apache.karaf.cellar.bundle.Constants;
+import org.apache.karaf.cellar.bundle.RemoteBundleEvent;
+import org.apache.karaf.cellar.core.ClusterManager;
+import org.apache.karaf.cellar.core.Configurations;
+import org.apache.karaf.cellar.core.Group;
+import org.apache.karaf.cellar.core.GroupManager;
+import org.apache.karaf.cellar.core.control.SwitchStatus;
+import org.apache.karaf.cellar.core.event.EventProducer;
+import org.apache.karaf.cellar.core.event.EventTransportFactory;
+import org.apache.karaf.cellar.management.CellarBundleMBean;
+import org.osgi.framework.BundleEvent;
+
+import javax.management.NotCompliantMBeanException;
+import javax.management.StandardMBean;
+import javax.management.openmbean.*;
+import java.net.URL;
+import java.util.Map;
+import java.util.jar.JarInputStream;
+import java.util.jar.Manifest;
+
+/**
+ * Implementation of the Cellar bundle MBean.
+ */
+public class CellarBundleMBeanImpl extends StandardMBean implements CellarBundleMBean {
+
+    private ClusterManager clusterManager;
+    private GroupManager groupManager;
+    private EventProducer eventProducer;
+
+    public CellarBundleMBeanImpl() throws NotCompliantMBeanException {
+        super(CellarBundleMBean.class);
+    }
+
+    public ClusterManager getClusterManager() {
+        return this.clusterManager;
+    }
+
+    public void setClusterManager(ClusterManager clusterManager) {
+        this.clusterManager = clusterManager;
+    }
+
+    public GroupManager getGroupManager() {
+        return this.groupManager;
+    }
+
+    public void setGroupManager(GroupManager groupManager) {
+        this.groupManager = groupManager;
+    }
+
+    public EventProducer getEventProducer() {
+        return eventProducer;
+    }
+
+    public void setEventProducer(EventProducer eventProducer) {
+        this.eventProducer = eventProducer;
+    }
+
+    public void install(String groupName, String location) throws Exception {
+        // check if cluster group exists
+        Group group = groupManager.findGroupByName(groupName);
+        if (group == null) {
+            throw new IllegalArgumentException("Cluster group " + groupName + " doesn't exist");
+        }
+
+        // check if the producer is ON
+        if (eventProducer.getSwitch().getStatus().equals(SwitchStatus.OFF)) {
+            throw new IllegalStateException("Cluster event producer is OFF for this node");
+        }
+
+        // get the name and version in the location MANIFEST
+        JarInputStream jarInputStream = new JarInputStream(new URL(location).openStream());
+        Manifest manifest = jarInputStream.getManifest();
+        String name = manifest.getMainAttributes().getValue("Bundle-SymbolicName");
+        String version = manifest.getMainAttributes().getValue("Bundle-Version");
+        jarInputStream.close();
+
+        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
+        try {
+            Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+            // populate the cluster map
+            Map<String, BundleState> bundles = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
+            BundleState state = new BundleState();
+            state.setLocation(location);
+            state.setStatus(BundleEvent.INSTALLED);
+            bundles.put(name + "/" + version, state);
+        } finally {
+            Thread.currentThread().setContextClassLoader(originalClassLoader);
+        }
+
+        // broadcast the event
+        RemoteBundleEvent event = new RemoteBundleEvent(name, version, location, BundleEvent.INSTALLED);
+        event.setSourceGroup(group);
+        eventProducer.produce(event);
+    }
+
+    public void uninstall(String groupName, String symbolicName, String version) throws Exception {
+        // check if the cluster group exists
+        Group group = groupManager.findGroupByName(groupName);
+        if (group == null) {
+            throw new IllegalArgumentException("Cluster group " + groupName + " doesn't exist");
+        }
+
+        // check if the producer is ON
+        if (eventProducer.getSwitch().getStatus().equals(SwitchStatus.OFF)) {
+            throw new IllegalStateException("Cluster event producer is OFF for this node");
+        }
+
+        // update the cluster map
+        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
+        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+        try {
+            Map<String, BundleState> bundles = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
+            bundles.remove(symbolicName + "/" + version);
+        } finally {
+            Thread.currentThread().setContextClassLoader(originalClassLoader);
+        }
+
+        // broadcast the event
+        RemoteBundleEvent event = new RemoteBundleEvent(symbolicName, version, null, BundleEvent.UNINSTALLED);
+        event.setSourceGroup(group);
+        eventProducer.produce(event);
+    }
+
+    public void start(String groupName, String symbolicName, String version) throws Exception {
+        // check if the cluster group exists
+        Group group = groupManager.findGroupByName(groupName);
+        if (group == null) {
+            throw new IllegalArgumentException("Cluster group " + groupName + " doesn't exist");
+        }
+
+        // check if the producer is ON
+        if (eventProducer.getSwitch().getStatus().equals(SwitchStatus.OFF)) {
+            throw new IllegalStateException("Cluster event producer is OFF for this node");
+        }
+
+        // update the cluster map
+        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
+        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+        try {
+            Map<String, BundleState> bundles = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
+            BundleState state = bundles.get(symbolicName + "/" + version);
+            if (state == null) {
+                throw new IllegalStateException("Bundle " + symbolicName + "/" + version + " not found in cluster group " + groupName);
+            }
+            state.setStatus(BundleEvent.STARTED);
+            bundles.put(symbolicName + "/" + version, state);
+        } finally {
+            Thread.currentThread().setContextClassLoader(originalClassLoader);
+        }
+
+        // broadcast the event
+        RemoteBundleEvent event = new RemoteBundleEvent(symbolicName, version, null, BundleEvent.STARTED);
+        event.setSourceGroup(group);
+        eventProducer.produce(event);
+    }
+
+    public void stop(String groupName, String symbolicName, String version) throws Exception {
+        // check if the cluster group exists
+        Group group = groupManager.findGroupByName(groupName);
+        if (group == null) {
+            throw new IllegalArgumentException("Cluster group " + groupName + " doesn't exist");
+        }
+
+        // check if the producer is ON
+        if (eventProducer.getSwitch().getStatus().equals(SwitchStatus.OFF)) {
+            throw new IllegalStateException("Cluster event producer is OFF for this node");
+        }
+
+        // update the cluster map
+        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
+        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+        try {
+            Map<String, BundleState> bundles = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
+            BundleState state = bundles.get(symbolicName + "/" + version);
+            if (state == null) {
+                throw new IllegalStateException("Bundle " + symbolicName + "/" + version + " not found in cluster group " + groupName);
+            }
+            state.setStatus(BundleEvent.STOPPED);
+            bundles.put(symbolicName + "/" + version, state);
+        } finally {
+            Thread.currentThread().setContextClassLoader(originalClassLoader);
+        }
+
+        // broadcast the event
+        RemoteBundleEvent event = new RemoteBundleEvent(symbolicName, version, null, BundleEvent.STOPPED);
+        event.setForce(true);
+        event.setSourceGroup(group);
+        eventProducer.produce(event);
+    }
+
+    public TabularData getBundles(String groupName) throws Exception {
+        CompositeType compositeType = new CompositeType("Bundle", "Karaf Cellar bundle",
+                new String[]{"name", "version", "status", "location"},
+                new String[]{"Name of the bundle", "Version of the bundle", "Current status of the bundle", "Location of the bundle"},
+                new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
+        TabularType tableType = new TabularType("Bundles", "Table of all KarafCellar bundles", compositeType,
+                new String[]{"name", "version"});
+        TabularData table = new TabularDataSupport(tableType);
+
+        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
+        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+        try {
+            Map<String, BundleState> bundles = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);
+            for (String bundle : bundles.keySet()) {
+                String[] tokens = bundle.split("/");
+                String name = tokens[0];
+                String version = tokens[1];
+                BundleState state = bundles.get(bundle);
+                CompositeData data = new CompositeDataSupport(compositeType,
+                        new String[]{"name", "version", "status", "location"},
+                        new Object[]{name, version, state.getStatus(), state.getLocation()});
+                table.put(data);
+            }
+        } finally {
+            Thread.currentThread().setContextClassLoader(originalClassLoader);
+        }
+        return table;
+    }
+
+}

Modified: karaf/cellar/trunk/management/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/management/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=1335141&r1=1335140&r2=1335141&view=diff
==============================================================================
--- karaf/cellar/trunk/management/src/main/resources/OSGI-INF/blueprint/blueprint.xml (original)
+++ karaf/cellar/trunk/management/src/main/resources/OSGI-INF/blueprint/blueprint.xml Mon May  7 17:27:08 2012
@@ -48,6 +48,12 @@
         <property name="groupManager" ref="groupManager"/>
     </bean>
 
+    <bean id="cellarBundleMBean" class="org.apache.karaf.cellar.management.internal.CellarBundleMBeanImpl">
+        <property name="clusterManager" ref="clusterManager"/>
+        <property name="groupManager" ref="groupManager"/>
+        <property name="eventProducer" ref="eventProducer"/>
+    </bean>
+
     <service ref="cellarMBean" auto-export="interfaces">
         <service-properties>
             <entry key="jmx.objectname" value="org.apache.karaf.cellar:type=core,name=${karaf.name}"/>
@@ -78,4 +84,10 @@
         </service-properties>
     </service>
 
+    <service ref="cellarBundleMBean" auto-export="interfaces">
+        <service-properties>
+            <entry key="jmx.objectname" value="org.apache.karaf.cellar:type=bundle,name=${karaf.name}"/>
+        </service-properties>
+    </service>
+
 </blueprint>
\ No newline at end of file

Modified: karaf/cellar/trunk/pom.xml
URL: http://svn.apache.org/viewvc/karaf/cellar/trunk/pom.xml?rev=1335141&r1=1335140&r2=1335141&view=diff
==============================================================================
--- karaf/cellar/trunk/pom.xml (original)
+++ karaf/cellar/trunk/pom.xml Mon May  7 17:27:08 2012
@@ -120,6 +120,11 @@
             <!-- Cellar -->
             <dependency>
                 <groupId>org.apache.karaf.cellar</groupId>
+                <artifactId>org.apache.karaf.cellar.bundle</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.karaf.cellar</groupId>
                 <artifactId>org.apache.karaf.cellar.config</artifactId>
                 <version>${project.version}</version>
             </dependency>