Package com.dotcms.repackage.org.osgi.framework

Examples of com.dotcms.repackage.org.osgi.framework.BundleContext


                    Bundle[] bundles = context.getBundles();
                    for ( Bundle bundle : bundles ) {
                        if ( bundle.getSymbolicName().equals( OSGIUtil.BUNDLE_HTTP_BRIDGE_SYMBOLIC_NAME ) ) {
                            //If we are here is because we have an invalid bundle context, so we need to provide a new one
                            BundleContext httpBundle = bundle.getBundleContext();
                            OSGIProxyServlet.tracker = new DispatcherTracker( httpBundle, null, OSGIProxyServlet.servletConfig );
                            OSGIProxyServlet.tracker.open();
                            OSGIProxyServlet.bundleContext = httpBundle;
                        }
View Full Code Here


    public void stopFramework () {

        try {

            BundleContext bundleContext = HostActivator.instance().getBundleContext();

            //Closing tracker associated to the HttpServlet
            DispatcherTracker tracker = OSGIProxyServlet.tracker;
            if ( tracker != null ) {
                tracker.close();
                OSGIProxyServlet.tracker = null;
            }

            //Unregistering ToolBox services
            ServiceReference toolBoxService = getBundleContext().getServiceReference( PrimitiveToolboxManager.class.getName() );
            if ( toolBoxService != null ) {
                bundleContext.ungetService( toolBoxService );
            }

            //Unregistering Workflow services
            ServiceReference workflowService = getBundleContext().getServiceReference( WorkflowAPIOsgiService.class.getName() );
            if ( workflowService != null ) {
                bundleContext.ungetService( workflowService );
            }

            // Stop felix
            m_fwk.stop();
            // (11) Wait for framework to stop to exit the VM.
View Full Code Here

  }

  public void registerBundleService () {
    if(Config.getBooleanProperty("felix.osgi.enable", true)){
      // Register main service
      BundleContext context = HostActivator.instance().getBundleContext();
      Hashtable<String, String> props = new Hashtable<String, String>();
      context.registerService(WorkflowAPIOsgiService.class.getName(), this, props);
    }
  }
View Full Code Here

    // -------------------------------------------- Public Methods ------------

    public void registerService () {
      if(Config.getBooleanProperty("felix.osgi.enable", true)){
          // Register main service
          BundleContext context = HostActivator.instance().getBundleContext();
          Hashtable<String, String> props = new Hashtable<String, String>();
          context.registerService(PrimitiveToolboxManager.class.getName(), this, props);
      }
    }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.osgi.framework.BundleContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.