Package org.springframework.osgi.context

Examples of org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext


        applicationContext.setClassLoader(classLoader);
        applicationContext.setConfigResources(springConfigResources);

        applicationContext.setDisplayName(ModuleLoaderUtils.getDisplayName(moduleDefinition, applicationContext));

        DelegatedExecutionOsgiBundleApplicationContext dc = ObjectUtils.cast(applicationContext, DelegatedExecutionOsgiBundleApplicationContext.class);
        dc.startRefresh();
       
        return applicationContext;
    }
View Full Code Here


    /**
     * Completes the second part of the refresh process by calling {@link DelegatedExecutionOsgiBundleApplicationContext#completeRefresh()}
     */
    public void handleRefresh(String applicationId, ConfigurableApplicationContext context, ModuleDefinition moduleDefinition) {
        DelegatedExecutionOsgiBundleApplicationContext dc = ObjectUtils.cast(context, DelegatedExecutionOsgiBundleApplicationContext.class);
        dc.completeRefresh();
    }
View Full Code Here

    if (debug)
      log.debug("Scanning bundle " + bundleString + " for configurations...");

    // initialize context
    final DelegatedExecutionOsgiBundleApplicationContext localApplicationContext;

    if (debug)
      log.debug("Creating an application context for bundle " + bundleString);

    try {
      localApplicationContext = contextCreator.createApplicationContext(localBundleContext);
    }
    catch (Exception ex) {
      log.error("Cannot create application context for bundle " + bundleString, ex);
      return;
    }

    if (localApplicationContext == null) {
      log.debug("No application context created for bundle " + bundleString);
      return;
    }

    // an application context has been created - do type filtering
    // filtering could be applied before creating the application context but then user might disable this by accident
    // so its best to do this inside the extender itself (this could change in the future)

    if (compatibilityChecker.checkCompatibility(bundle)) {
      log.debug("Bundle " + bundleString + " is Spring type compatible with Spring-DM");

    }
    else {
      log.debug("Ignoring bundle " + bundleString + " as it's Spring incompatible with Spring-DM...");
      return;
    }

    // create a dedicated hook for this application context
    BeanFactoryPostProcessor processingHook = new OsgiBeanFactoryPostProcessorAdapter(localBundleContext,
      postProcessors);

    // add in the post processors
    localApplicationContext.addBeanFactoryPostProcessor(processingHook);

    // add the context to the tracker
    managedContexts.put(bundleId, localApplicationContext);

    localApplicationContext.setDelegatedEventMulticaster(multicaster);

    // create refresh runnable
    Runnable contextRefresh = new Runnable() {

      public void run() {
        localApplicationContext.refresh();
      }
    };

    // executor used for creating the appCtx
    // chosen based on the sync/async configuration
View Full Code Here

    applicationContext.setClassLoader(newClassLoader);
    applicationContext.setConfigResources(springConfigResources);

    applicationContext.setDisplayName(ModuleLoaderUtils.getDisplayName(moduleDefinition, applicationContext));

    DelegatedExecutionOsgiBundleApplicationContext dc = ObjectUtils.cast(applicationContext, DelegatedExecutionOsgiBundleApplicationContext.class);
    dc.startRefresh();
   
    return applicationContext;
  }
View Full Code Here

  /**
   * Completes the second part of the refresh process by calling {@link DelegatedExecutionOsgiBundleApplicationContext#completeRefresh()}
   */
  public void handleRefresh(ConfigurableApplicationContext context) {
    DelegatedExecutionOsgiBundleApplicationContext dc = ObjectUtils.cast(context, DelegatedExecutionOsgiBundleApplicationContext.class);
    dc.completeRefresh();
  }
View Full Code Here

        applicationContext.setClassLoader(newClassLoader);
        applicationContext.setConfigResources(springConfigResources);

        applicationContext.setDisplayName(ModuleLoaderUtils.getDisplayName(moduleDefinition, applicationContext));

        DelegatedExecutionOsgiBundleApplicationContext dc = ObjectUtils.cast(applicationContext, DelegatedExecutionOsgiBundleApplicationContext.class);
        dc.startRefresh();
       
        return applicationContext;
    }
View Full Code Here

    /**
     * Completes the second part of the refresh process by calling {@link DelegatedExecutionOsgiBundleApplicationContext#completeRefresh()}
     */
    public void handleRefresh(ConfigurableApplicationContext context) {
        DelegatedExecutionOsgiBundleApplicationContext dc = ObjectUtils.cast(context, DelegatedExecutionOsgiBundleApplicationContext.class);
        dc.completeRefresh();
    }
View Full Code Here

        applicationContext.setClassLoader(classLoader);
        applicationContext.setConfigResources(springConfigResources);

        applicationContext.setDisplayName(ModuleLoaderUtils.getDisplayName(moduleDefinition, applicationContext));

        DelegatedExecutionOsgiBundleApplicationContext dc = ObjectUtils.cast(applicationContext, DelegatedExecutionOsgiBundleApplicationContext.class);
        dc.startRefresh();
       
        return applicationContext;
    }
View Full Code Here

    /**
     * Completes the second part of the refresh process by calling {@link DelegatedExecutionOsgiBundleApplicationContext#completeRefresh()}
     */
    public void handleRefresh(String applicationId, ConfigurableApplicationContext context, ModuleDefinition moduleDefinition) {
        DelegatedExecutionOsgiBundleApplicationContext dc = ObjectUtils.cast(context, DelegatedExecutionOsgiBundleApplicationContext.class);
        dc.completeRefresh();
    }
View Full Code Here

    final ClassLoader newClassLoader = newClassLoader(moduleDefinition, parent);
   
    applicationContext.setClassLoader(newClassLoader);
    applicationContext.setConfigResources(springConfigResources);

    DelegatedExecutionOsgiBundleApplicationContext dc = ObjectUtils.cast(applicationContext, DelegatedExecutionOsgiBundleApplicationContext.class);
    dc.startRefresh();
   
    return applicationContext;
  }
View Full Code Here

TOP

Related Classes of org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext

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.