Package org.impalaframework.module.spi

Examples of org.impalaframework.module.spi.ModuleLoader


    this.moduleLoaderRegistry = moduleLoaderRegistry;
  }

  public void process(Application application, RootModuleDefinition newRootDefinition, ModuleDefinition moduleDefinition) {

    final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(newRootDefinition));
    final SpringModuleLoader moduleLoader = ObjectUtils.cast(loader, SpringModuleLoader.class);
   
    ConfigurableApplicationContext parentContext = SpringModuleUtils.getRootSpringContext(moduleStateHolder);
    ClassLoader classLoader = parentContext.getClassLoader();
View Full Code Here


        Assert.notNull(moduleLoaderRegistry, ModuleLoaderRegistry.class.getName() + " cannot be null");
        Assert.notNull(delegatingContextLoaderRegistry, DelegatingContextLoaderRegistry.class.getName() + " cannot be null");
        ConfigurableApplicationContext context = null;
       
        final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(definition), false);
        final SpringModuleLoader moduleLoader = ObjectUtils.cast(loader, SpringModuleLoader.class);
       
        final DelegatingContextLoader delegatingLoader = delegatingContextLoaderRegistry.getDelegatingLoader(definition.getType());

        try {
View Full Code Here

     * is called.
     */
    public void closeContext(String applicationId, ModuleDefinition moduleDefinition, ApplicationContext applicationContext) {
       
        Assert.notNull(moduleLoaderRegistry, ModuleLoaderRegistry.class.getName() + " cannot be null");       
        final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(moduleDefinition), false);
       
        if (loader instanceof SpringModuleLoader) {
            SpringModuleLoader springModuleLoader = (SpringModuleLoader) loader;
            springModuleLoader.beforeClose(applicationId, applicationContext, moduleDefinition);
        }
View Full Code Here

    void findAndStartBundle(ModuleDefinition currentDefinition) {
        Assert.notNull(currentDefinition, "moduleDefinition cannot be null");
               
        //install if not present
        final ModuleLoader moduleLoader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(currentDefinition));
        final Resource[] bundleLocations = moduleLoader.getClassLocations(currentDefinition);      

        //find bundle with name
        Bundle bundle = findBundle(currentDefinition);

        if (bundleLocations == null || bundleLocations.length == 0) {
            throw new InvalidStateException("Module loader '" + moduleLoader.getClass().getName()
                    + "' returned " + (bundleLocations != null ? "empty": "null") +
                    " bundle class locations. Cannot install bundle for module '"
                    + currentDefinition.getName() + "'");
        }
View Full Code Here

        Assert.notNull(moduleLoaderRegistry, ModuleLoaderRegistry.class.getName() + " cannot be null");
        Assert.notNull(delegatingContextLoaderRegistry, DelegatingContextLoaderRegistry.class.getName() + " cannot be null");
        ConfigurableApplicationContext context = null;
       
        final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(definition), false);
        final SpringModuleLoader moduleLoader = ObjectUtils.cast(loader, SpringModuleLoader.class);
       
        final DelegatingContextLoader delegatingLoader = delegatingContextLoaderRegistry.getDelegatingLoader(definition.getType());

        try {
View Full Code Here

     * is called.
     */
    public void closeContext(String applicationId, ModuleDefinition moduleDefinition, ApplicationContext applicationContext) {
       
        Assert.notNull(moduleLoaderRegistry, ModuleLoaderRegistry.class.getName() + " cannot be null");       
        final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(moduleDefinition), false);
       
        if (loader instanceof SpringModuleLoader) {
            SpringModuleLoader springModuleLoader = (SpringModuleLoader) loader;
            springModuleLoader.beforeClose(applicationId, applicationContext, moduleDefinition);
        }
View Full Code Here

        Assert.notNull(moduleLoaderRegistry, ModuleLoaderRegistry.class.getName() + " cannot be null");
        Assert.notNull(delegatingContextLoaderRegistry, DelegatingContextLoaderRegistry.class.getName() + " cannot be null");
        ConfigurableApplicationContext context = null;
       
        final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(definition), false);
        final SpringModuleLoader moduleLoader = ObjectUtils.cast(loader, SpringModuleLoader.class);
       
        final DelegatingContextLoader delegatingLoader = delegatingContextLoaderRegistry.getDelegatingLoader(definition.getType());

        try {
View Full Code Here

   */
  protected void afterModuleLoaded(ModuleDefinition definition) {
    if (moduleChangeMonitor != null) {
     
      Assert.notNull(moduleLoaderRegistry, "ModuleChangeMonitor required if ModuleLoaderRegistry is wired in.");
      final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(definition), false);
     
      if (loader != null) {
        Resource[] toMonitor = loader.getClassLocations(definition);
     
        if (logger.isDebugEnabled()) logger.debug("Monitoring resources " + Arrays.toString(toMonitor) + " using ModuleChangeMonitor " + moduleChangeMonitor);
        moduleChangeMonitor.setResourcesToMonitor(definition.getName(), toMonitor);
      }
    }
View Full Code Here

  void findAndStartBundle(ModuleDefinition currentDefinition) {
    Assert.notNull(currentDefinition, "moduleDefinition cannot be null");
       
    //install if not present
    final ModuleLoader moduleLoader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(currentDefinition));
    final Resource[] bundleLocations = moduleLoader.getClassLocations(currentDefinition);   

    //find bundle with name
    Bundle bundle = findBundle(currentDefinition);

    if (bundleLocations == null || bundleLocations.length == 0) {
      throw new InvalidStateException("Module loader '" + moduleLoader.getClass().getName()
          + "' returned " + (bundleLocations != null ? "empty": "null") +
          " bundle class locations. Cannot install bundle for module '"
          + currentDefinition.getName() + "'");
    }
View Full Code Here

    Assert.notNull(moduleLoaderRegistry, ModuleLoaderRegistry.class.getName() + " cannot be null");
    Assert.notNull(delegatingContextLoaderRegistry, DelegatingContextLoaderRegistry.class.getName() + " cannot be null");
    ConfigurableApplicationContext context = null;
   
    final ModuleLoader loader = moduleLoaderRegistry.getModuleLoader(ModuleRuntimeUtils.getModuleLoaderKey(definition), false);
    final SpringModuleLoader moduleLoader = ObjectUtils.cast(loader, SpringModuleLoader.class);
   
    final DelegatingContextLoader delegatingLoader = delegatingContextLoaderRegistry.getDelegatingLoader(definition.getType());

    try {
View Full Code Here

TOP

Related Classes of org.impalaframework.module.spi.ModuleLoader

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.