bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StartBundleCommand.java [41:81]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Reference
    private EventProducer eventProducer;

    @Override
    protected Object doExecute() throws Exception {
        // check if the group exists
        Group group = groupManager.findGroupByName(groupName);
        if (group == null) {
            System.err.println("Cluster group " + groupName + " doesn't exist");
            return null;
        }

        // check if the producer is ON
        if (eventProducer.getSwitch().getStatus().equals(SwitchStatus.OFF)) {
            System.err.println("Cluster event producer is OFF");
            return null;
        }

        // update the bundle in the cluster group
        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());

        try {
            Map<String, BundleState> clusterBundles = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);

            List<String> bundles = selector(gatherBundles(true));

            for (String bundle : bundles) {
                BundleState state = clusterBundles.get(bundle);
                if (state == null) {
                    System.err.println("Bundle " + bundle + " not found in cluster group " + groupName);
                }
                String location = state.getLocation();

                // check if the bundle is allowed
                CellarSupport support = new CellarSupport();
                support.setClusterManager(this.clusterManager);
                support.setGroupManager(this.groupManager);
                support.setConfigurationAdmin(this.configurationAdmin);
                if (!support.isAllowed(group, Constants.CATEGORY, location, EventType.OUTBOUND)) {
                    System.err.println("Bundle location " + location + " is blocked outbound for cluster group " + groupName);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



bundle/src/main/java/org/apache/karaf/cellar/bundle/shell/StopBundleCommand.java [37:77]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    @Reference
    private EventProducer eventProducer;

    @Override
    protected Object doExecute() throws Exception {
        // check if the group exists
        Group group = groupManager.findGroupByName(groupName);
        if (group == null) {
            System.err.println("Cluster group " + groupName + " doesn't exist");
            return null;
        }

        // check if the producer is ON
        if (eventProducer.getSwitch().getStatus().equals(SwitchStatus.OFF)) {
            System.err.println("Cluster event producer is OFF");
            return null;
        }

        // update the bundle in the cluster group
        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());

        try {
            Map<String, BundleState> clusterBundles = clusterManager.getMap(Constants.BUNDLE_MAP + Configurations.SEPARATOR + groupName);

            List<String> bundles = selector(gatherBundles(true));

            for (String bundle : bundles) {
                BundleState state = clusterBundles.get(bundle);
                if (state == null) {
                    System.err.println("Bundle " + bundle + " not found in cluster group " + groupName);
                }
                String location = state.getLocation();

                // check if the bundle is allowed
                CellarSupport support = new CellarSupport();
                support.setClusterManager(this.clusterManager);
                support.setGroupManager(this.groupManager);
                support.setConfigurationAdmin(this.configurationAdmin);
                if (!support.isAllowed(group, Constants.CATEGORY, location, EventType.OUTBOUND)) {
                    System.err.println("Bundle location " + location + " is blocked outbound for cluster group " + groupName);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



