- public static void main(String[] args) {
- if (args.length == 0)
- throw new IllegalArgumentException("Usage: <path to A2 base>");
- Map<String, String> configuration = new HashMap<>();
- configuration.put("osgi.console", "2323");
- configuration.put("org.osgi.framework.bootdelegation",
- "com.sun.jndi.ldap,com.sun.jndi.ldap.sasl,com.sun.security.jgss,com.sun.jndi.dns,com.sun.nio.file,com.sun.nio.sctp,sun.nio.cs");
- Framework framework = OsgiBootUtils.launch(configuration);
- try {
- ProvisioningManager pm = new ProvisioningManager(framework.getBundleContext());
- Map<String, String> xOr = new HashMap<>();
- xOr.put("osgi", "equinox");
- xOr.put("swt", "rap");
- FsA2Source context = new FsA2Source(Paths.get(args[0]), xOr);
- context.load();
- pm.addSource(context);
- if (framework.getBundleContext().getBundles().length == 1) {// initial
- pm.install(null);
- } else {
- pm.update();
- }
-
- Thread.sleep(2000);
-
- Bundle[] bundles = framework.getBundleContext().getBundles();
- Arrays.sort(bundles, (b1, b2) -> b1.getSymbolicName().compareTo(b2.getSymbolicName()));
- for (Bundle b : bundles)
- if (b.getState() == Bundle.RESOLVED || b.getState() == Bundle.STARTING || b.getState() == Bundle.ACTIVE)
- System.out.println(b.getSymbolicName() + " " + b.getVersion());
- else
- System.err.println(b.getSymbolicName() + " " + b.getVersion() + " (" + b.getState() + ")");
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- try {
- framework.stop();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
+// public static void main(String[] args) {
+// if (args.length == 0)
+// throw new IllegalArgumentException("Usage: <path to A2 base>");
+// Map<String, String> configuration = new HashMap<>();
+// configuration.put("osgi.console", "2323");
+// configuration.put("org.osgi.framework.bootdelegation",
+// "com.sun.jndi.ldap,com.sun.jndi.ldap.sasl,com.sun.security.jgss,com.sun.jndi.dns,com.sun.nio.file,com.sun.nio.sctp,sun.nio.cs");
+// Framework framework = OsgiBootUtils.launch(configuration);
+// try {
+// ProvisioningManager pm = new ProvisioningManager(framework.getBundleContext());
+// Map<String, String> xOr = new HashMap<>();
+// xOr.put("osgi", "equinox");
+// xOr.put("swt", "rap");
+// FsA2Source context = new FsA2Source(Paths.get(args[0]), xOr);
+// context.load();
+// pm.addSource(context);
+// if (framework.getBundleContext().getBundles().length == 1) {// initial
+// pm.install(null);
+// } else {
+// pm.update();
+// }
+//
+// Thread.sleep(2000);
+//
+// Bundle[] bundles = framework.getBundleContext().getBundles();
+// Arrays.sort(bundles, (b1, b2) -> b1.getSymbolicName().compareTo(b2.getSymbolicName()));
+// for (Bundle b : bundles)
+// if (b.getState() == Bundle.RESOLVED || b.getState() == Bundle.STARTING || b.getState() == Bundle.ACTIVE)
+// System.out.println(b.getSymbolicName() + " " + b.getVersion());
+// else
+// System.err.println(b.getSymbolicName() + " " + b.getVersion() + " (" + b.getState() + ")");
+// } catch (Exception e) {
+// e.printStackTrace();
+// } finally {
+// try {
+// framework.stop();
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+// }
+// }