use of javax.management.MBeanException in project karaf by apache.
the class ConfigMBeanImpl method update.
@Override
public void update(String pid, Map<String, String> properties) throws MBeanException {
try {
if (properties == null) {
properties = new HashMap<>();
}
Dictionary<String, Object> dictionary = toDictionary(properties);
configRepo.update(pid, dictionary);
} catch (Exception e) {
throw new MBeanException(null, e.toString());
}
}
use of javax.management.MBeanException in project karaf by apache.
the class ConfigMBeanImpl method setProperty.
@Override
public void setProperty(String pid, String key, String value) throws MBeanException {
try {
Dictionary<String, Object> dictionary = getConfigProperties(pid);
dictionary.put(key, value);
configRepo.update(pid, dictionary);
} catch (Exception e) {
throw new MBeanException(null, e.toString());
}
}
use of javax.management.MBeanException in project karaf by apache.
the class ConfigMBeanImpl method getProperty.
@Override
public String getProperty(String pid, String key) throws MBeanException {
try {
Dictionary<String, Object> dictionary = getConfigProperties(pid);
Object value = dictionary.get(key);
if (value != null) {
return value.toString();
}
return null;
} catch (Exception e) {
throw new MBeanException(null, e.toString());
}
}
use of javax.management.MBeanException in project karaf by apache.
the class BundlesMBeanImpl method update.
public void update(String bundleId, String location) throws MBeanException {
try {
List<Bundle> bundles = selectBundles(bundleId);
if (location == null) {
for (Bundle bundle : bundles) {
bundle.update();
}
return;
}
if (bundles.size() != 1) {
throw new IllegalArgumentException("Provided bundle Id doesn't return any bundle or more than one bundle selected");
}
InputStream is = new URL(location).openStream();
bundles.get(0).update(is);
} catch (Exception e) {
throw new MBeanException(null, e.toString());
}
}
use of javax.management.MBeanException in project karaf by apache.
the class BundlesMBeanImpl method resolve.
public void resolve(String bundleId) throws MBeanException {
try {
List<Bundle> bundles = selectBundles(bundleId);
getFrameworkWiring().resolveBundles(bundles);
} catch (Exception e) {
throw new MBeanException(null, e.toString());
}
}
Aggregations