Author: jbonofre
Date: Tue Aug 7 00:02:33 2012
New Revision: 1370069
URL: http://svn.apache.org/viewvc?rev=1370069&view=rev
Log:
[KARAF-1699] Add noClean, noRefresh arguments in install operations of the
FeaturesMBean
Modified:
karaf/branches/karaf-2.2.x/features/management/src/main/java/org/apache/karaf/features/management/FeaturesServiceMBean.java
karaf/branches/karaf-2.2.x/features/management/src/main/java/org/apache/karaf/features/management/internal/FeaturesServiceMBeanImpl.java
Modified:
karaf/branches/karaf-2.2.x/features/management/src/main/java/org/apache/karaf/features/management/FeaturesServiceMBean.java
URL:
http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/features/management/src/main/java/org/apache/karaf/features/management/FeaturesServiceMBean.java?rev=1370069&r1=1370068&r2=1370069&view=diff
==============================================================================
---
karaf/branches/karaf-2.2.x/features/management/src/main/java/org/apache/karaf/features/management/FeaturesServiceMBean.java
(original)
+++
karaf/branches/karaf-2.2.x/features/management/src/main/java/org/apache/karaf/features/management/FeaturesServiceMBean.java
Tue Aug 7 00:02:33 2012
@@ -30,8 +30,12 @@ public interface FeaturesServiceMBean {
void installFeature(String name) throws Exception;
+ void installFeature(String name, boolean noClean, boolean noRefresh)
throws Exception;
+
void installFeature(String name, String version) throws Exception;
+ void installFeature(String name, String version, boolean noClean, boolean
noRefresh) throws Exception;
+
void uninstallFeature(String name) throws Exception;
void uninstallFeature(String name, String version) throws Exception;
Modified:
karaf/branches/karaf-2.2.x/features/management/src/main/java/org/apache/karaf/features/management/internal/FeaturesServiceMBeanImpl.java
URL:
http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/features/management/src/main/java/org/apache/karaf/features/management/internal/FeaturesServiceMBeanImpl.java?rev=1370069&r1=1370068&r2=1370069&view=diff
==============================================================================
---
karaf/branches/karaf-2.2.x/features/management/src/main/java/org/apache/karaf/features/management/internal/FeaturesServiceMBeanImpl.java
(original)
+++
karaf/branches/karaf-2.2.x/features/management/src/main/java/org/apache/karaf/features/management/internal/FeaturesServiceMBeanImpl.java
Tue Aug 7 00:02:33 2012
@@ -14,10 +14,7 @@
package org.apache.karaf.features.management.internal;
import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.List;
+import java.util.*;
import javax.management.MBeanNotificationInfo;
import javax.management.MBeanRegistration;
import javax.management.MBeanServer;
@@ -25,6 +22,7 @@ import javax.management.NotCompliantMBea
import javax.management.Notification;
import javax.management.ObjectName;
import javax.management.openmbean.TabularData;
+import javax.swing.text.html.Option;
import org.apache.karaf.features.Feature;
import org.apache.karaf.features.FeatureEvent;
@@ -148,10 +146,32 @@ public class FeaturesServiceMBeanImpl ex
featuresService.installFeature(name);
}
+ public void installFeature(String name, boolean noClean, boolean
noRefresh) throws Exception {
+ EnumSet<FeaturesService.Option> options =
EnumSet.noneOf(FeaturesService.Option.class);
+ if (noClean) {
+ options.add(FeaturesService.Option.NoCleanIfFailure);
+ }
+ if (noRefresh) {
+ options.add(FeaturesService.Option.NoAutoRefreshBundles);
+ }
+ featuresService.installFeature(name, "0.0.0", options);
+ }
+
public void installFeature(String name, String version) throws Exception {
featuresService.installFeature(name, version);
}
+ public void installFeature(String name, String version, boolean noClean,
boolean noRefresh) throws Exception {
+ EnumSet<FeaturesService.Option> options =
EnumSet.noneOf(FeaturesService.Option.class);
+ if (noClean) {
+ options.add(FeaturesService.Option.NoCleanIfFailure);
+ }
+ if (noRefresh) {
+ options.add(FeaturesService.Option.NoAutoRefreshBundles);
+ }
+ featuresService.installFeature(name, version, options);
+ }
+
public void uninstallFeature(String name) throws Exception {
featuresService.uninstallFeature(name);
}