public void installBundles() throws BundleException { BundleUtils bundleUtils = new BundleUtils(bundleContext); Bundle bundleFabricCommands = bundleUtils.findBundle("io.fabric8.fabric-commands"); if (bundleFabricCommands == null) { bundleFabricCommands = bundleUtils.installBundle("mvn:io.fabric8/fabric-commands/" + FabricConstants.FABRIC_VERSION); } bundleFabricCommands.start(); Bundle bundleFabricAgent = bundleUtils.findBundle("io.fabric8.fabric-agent"); if (nonManaged && bundleFabricAgent == null) { //do nothing } else if (nonManaged && bundleFabricAgent != null) { bundleFabricAgent.stop(); } else if (bundleFabricAgent == null) { bundleFabricAgent = bundleUtils.installBundle("mvn:io.fabric8/fabric-agent/" + FabricConstants.FABRIC_VERSION); bundleFabricAgent.start(); } else { bundleFabricAgent.start(); } }
private void stopBundles() throws BundleException { BundleUtils bundleUtils = new BundleUtils(bundleContext); bundleUtils.findAndStopBundle("io.fabric8.fabric-agent"); // bundleUtils.findAndStopBundle("org.ops4j.pax.web.pax-web-jetty"); }
private void startBundles(CreateEnsembleOptions options) throws BundleException { BundleUtils bundleUtils = new BundleUtils(bundleContext); Bundle agentBundle = bundleUtils.findBundle("io.fabric8.fabric-agent"); if (agentBundle != null && options.isAgentEnabled()) { agentBundle.start(); } // Bundle webBundle = bundleUtils.findBundle("org.ops4j.pax.web.pax-web-jetty"); // if (webBundle != null) { // webBundle.start(); // } }
public Bundle findAndStopBundle(String bsn) throws BundleException { Bundle bundle = findBundle(bsn); if (bundle != null) { bundle.stop(); } return bundle; } }
@Activate void activate(BundleContext bundleContext) throws Exception { this.bundleContext = bundleContext; bundleUtils = new BundleUtils(bundleContext); Objects.notNull(metaTypeService, "metaTypeService"); Objects.notNull(bundleContext, "bundleContext"); if (mbeanServer != null) { StandardMBean mbean = new StandardMBean(this, MetaTypeFacadeMXBean.class); JMXUtils.registerMBean(mbean, mbeanServer, OBJECT_NAME); } }
Bundle fileinstall = new BundleUtils(bundleContext).findBundle("org.apache.felix.fileinstall"); if (fileinstall != null) { fileinstall.stop(Bundle.STOP_TRANSIENT);
@Override public MetaTypeInformationDTO getMetaTypeInformation(String bundleSymbolicName) { try { Bundle bundle = bundleUtils.findBundle(bundleSymbolicName); return getMetaTypeInformationDTO(bundle); } catch (BundleException e) { LOG.info("Could not find bundle '" + bundleSymbolicName + "'"); return null; } }
public void installBundles() throws BundleException { BundleUtils bundleUtils = new BundleUtils(bundleContext); Bundle bundleFabricCommands = bundleUtils.findBundle("io.fabric8.fabric-commands"); if (bundleFabricCommands == null) { bundleFabricCommands = bundleUtils.installBundle("mvn:io.fabric8/fabric-commands/" + FabricConstants.FABRIC_VERSION); } bundleFabricCommands.start(); Bundle bundleFabricAgent = bundleUtils.findBundle("io.fabric8.fabric-agent"); if (nonManaged && bundleFabricAgent == null) { //do nothing } else if (nonManaged && bundleFabricAgent != null) { bundleFabricAgent.stop(); } else if (bundleFabricAgent == null) { bundleFabricAgent = bundleUtils.installBundle("mvn:io.fabric8/fabric-agent/" + FabricConstants.FABRIC_VERSION); bundleFabricAgent.start(); } else { bundleFabricAgent.start(); } }