/** * Will hook up this instance with the OSGi runtime. * This is to actually update SPI provider lookup and class loading mechanisms in Jersey * to utilize OSGi features. */ void hookUp() { setOSGiServiceFinderIteratorProvider(); bundleContext.addBundleListener(this); registerExistingBundles(); }
/** * Will hook up this instance with the OSGi runtime. * This is to actually update SPI provider lookup and class loading mechanisms in Jersey * to utilize OSGi features. */ void hookUp() { setOSGiServiceFinderIteratorProvider(); bundleContext.addBundleListener(this); registerExistingBundles(); }
@Override public void start(final BundleContext bundleContext) throws Exception { ProviderUtil.STARTUP_LOCK.lock(); lockingProviderUtil = true; final BundleWiring self = bundleContext.getBundle().adapt(BundleWiring.class); final List<BundleWire> required = self.getRequiredWires(LoggerContextFactory.class.getName()); for (final BundleWire wire : required) { loadProvider(bundleContext, wire.getProviderWiring()); } bundleContext.addBundleListener(this); final Bundle[] bundles = bundleContext.getBundles(); for (final Bundle bundle : bundles) { loadProvider(bundle); } unlockIfReady(); }
context.addBundleListener(t); Bundle[] bundles = context.getBundles(); if (bundles != null) {
@Override public synchronized void start(BundleContext bundleContext) throws Exception { // This is how we replace the default FactoryFinder strategy // with one that is more compatible in an OSGi env. FactoryFinder.setObjectFactory(this); debug("activating"); this.bundleContext = bundleContext; cachePackageCapabilities(Service.class, Transport.class, DiscoveryAgent.class, PersistenceAdapter.class); debug("checking existing bundles"); bundleContext.addBundleListener(this); for (Bundle bundle : bundleContext.getBundles()) { if (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.STARTING || bundle.getState() == Bundle.ACTIVE || bundle.getState() == Bundle.STOPPING) { register(bundle); } } debug("activated"); }
@Override public void start(BundleContext context) throws Exception { context.addBundleListener(this); }
context.addBundleListener(t); Bundle[] bundles = context.getBundles(); if (bundles != null) {
/** * Adds a bundle listener. * @param listener the listener to add * @see org.osgi.framework.BundleContext#addBundleListener(org.osgi.framework.BundleListener) */ public void addBundleListener(BundleListener listener) { m_bundleContext.addBundleListener(listener); }
/** * Add a bundle listener. * Delegate on the global bundle context. * @param arg0 : bundle listener to add * @see org.osgi.framework.BundleContext#addBundleListener(org.osgi.framework.BundleListener) */ public void addBundleListener(BundleListener arg0) { m_global.addBundleListener(arg0); }
/** * Creates a new object and adds self as a bundle listener * * @param bundleContext the bundle context of the Web Console. */ public ResourceBundleManager(final BundleContext bundleContext) { this.bundleContext = bundleContext; this.resourceBundleCaches = new HashMap(); bundleContext.addBundleListener(this); }
/** * Starts this CommandProvider. * * Registers this object as a CommandProvider with the highest ranking possible. * Adds this object as a SynchronousBundleListener. */ void start() { Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE)); providerReg = context.registerService(CommandProvider.class.getName(), this, props); context.addBundleListener(this); }
/** * Creates a new object and adds self as a bundle listener * * @param bundleContext the bundle context of the Web Console. */ public ResourceBundleManager( final BundleContext bundleContext ) { this.bundleContext = bundleContext; this.consoleResourceBundleCache = new ResourceBundleCache( bundleContext.getBundle() ); this.resourceBundleCaches = new HashMap(); bundleContext.addBundleListener( this ); }
protected void activate(ComponentContext context) throws IOException, URISyntaxException { for (Bundle bundle : context.getBundleContext().getBundles()) { registerStaticFiles(bundle); } context.getBundleContext().addBundleListener(this); extraPath = context.getBundleContext().getProperty("org.apache.clerezza.web.fileserver.static.extra"); updateFileServer(); }
public void start(BundleContext context) { systemBundleLog.setBundle(context.getBundle()); context.addBundleListener(this); context.addServiceListener(this); context.addFrameworkListener(this); context.addBundleListener(logServiceFactory); logReaderServiceRegistration = context.registerService(LOGREADERSERVICE_CLASSES, logReaderServiceFactory, null); logServiceRegistration = context.registerService(LOGSERVICE_CLASSES, logServiceFactory, null); eventAdminAdapter = new EventAdminAdapter(context, logReaderServiceFactory); eventAdminAdapter.start(); }
@Override public void start(BundleContext context) throws Exception { this.context = context; this.context.addBundleListener(this); this.tracker = new BundleTracker<>(this.context, Bundle.ACTIVE | Bundle.STARTING, this); doStart(); }
public RunnableJobTracker(BundleContext context) { super(context, createFilter(), null); open(); context.addBundleListener(this); }
/** * Will hook up this instance with the OSGi runtime. * This is to actually update SPI provider lookup and class loading mechanisms in Jersey * to utilize OSGi features. */ void hookUp() { setOSGiServiceFinderIteratorProvider(); bundleContext.addBundleListener(this); registerExistingBundles(); }
private static boolean refreshPackages(Bundle[] bundles) throws InterruptedException { FrameworkWiring frameworkWiring = context.getBundle().adapt(FrameworkWiring.class); if (frameworkWiring == null) return false; Semaphore semaphore = new Semaphore(0); StartupEventListener listener = new StartupEventListener(semaphore, FrameworkEvent.PACKAGES_REFRESHED); context.addBundleListener(listener); frameworkWiring.refreshBundles(Arrays.asList(bundles), listener); updateSplash(semaphore, listener); return isForcedRestart(); }
private static boolean refreshPackages(Bundle[] bundles) throws InterruptedException { FrameworkWiring frameworkWiring = context.getBundle().adapt(FrameworkWiring.class); if (frameworkWiring == null) return false; Semaphore semaphore = new Semaphore(0); StartupEventListener listener = new StartupEventListener(semaphore, FrameworkEvent.PACKAGES_REFRESHED); context.addBundleListener(listener); frameworkWiring.refreshBundles(Arrays.asList(bundles), listener); updateSplash(semaphore, listener); return isForcedRestart(); }
protected void init(){ registerBundleMBeans(); registerServiceMBeans(); registerPackageMBeans(); ac.getBundleContext().addFrameworkListener(fl); ac.getBundleContext().addBundleListener(bl); ac.getBundleContext().addServiceListener(sl); } protected void dispose() {