+ Long bundleId = null;
+ try {
+ bundleId = Long.parseLong(firstArg);
+ } catch (NumberFormatException e) {
+ // silent
+ }
+
+ Bundle bundle = null;
+ if (bundleId != null) {
+ bundle = bundleContext.getBundle(bundleId);
+ } else {
+ for (Bundle b : bundleContext.getBundles()) {
+ if (b.getSymbolicName().contains(firstArg)) {
+ bundle = b;
+ break;
+ }
+ }
+ }
+
+ if (bundle != null) {
+ moduleName = bundle.getSymbolicName();
+// try {
+// bundle.stop();
+// bundle.update();
+// bundle.start();
+//
+// // FIXME: potential infinite loop
+// while (bundle.getState() == Bundle.STARTING) {
+// try {
+// Thread.sleep(500);
+// } catch (InterruptedException e) {
+// // silent
+// }
+// }
+// } catch (BundleException e) {
+// throw new SlcException(
+// "Could not update the bundle for module " + moduleName,
+// e);
+// }
+ }
+
+ // Find module