Package org.impalaframework.module.definition

Examples of org.impalaframework.module.definition.ModuleDefinition


  void checkOriginal(ModuleDefinition originalDefinition, ModuleDefinition newDefinition, List<ModuleStateChange> transitions) {
    Collection<ModuleDefinition> oldDefinitions = originalDefinition.getChildDefinitions();
   
    for (ModuleDefinition oldDefinition : oldDefinitions) {
      ModuleDefinition newDef = newDefinition.getModule(oldDefinition.getName());

      if (newDef == null) {
        unloadDefinitions(oldDefinition, transitions);
      }
    }
View Full Code Here


  @Override
  void checkOriginal(ModuleDefinition originalDefinition, ModuleDefinition newDefinition, List<ModuleStateChange> transitions) {
    Collection<ModuleDefinition> oldModules = originalDefinition.getChildDefinitions();

    for (ModuleDefinition oldDefinition : oldModules) {
      ModuleDefinition newDef = newDefinition.getModule(oldDefinition.getName());

      if (newDef == null) {
        newDefinition.add(oldDefinition);
        oldDefinition.setParentDefinition(newDefinition);
      }
View Full Code Here

    boolean success = true;

    if (moduleStateHolder.getModule(currentDefinition.getName()) == null) {

      ConfigurableApplicationContext parentContext = null;
      ModuleDefinition parentDefinition = currentDefinition.getParentDefinition();
      if (parentDefinition != null) {
        parentContext = moduleStateHolder.getModule(parentDefinition.getName());
      }

      try {
        ConfigurableApplicationContext loadContext = contextLoader.loadContext(currentDefinition, parentContext);
        moduleStateHolder.putModule(currentDefinition.getName(), loadContext);
View Full Code Here

  protected ModuleDefinition buildModuleDefinition(
      ModuleDefinition parentDefinition, String moduleName) {
    Properties properties = moduleProperties.get(moduleName);
    String type = getType(properties);
    TypeReader reader = TypeReaderUtils.getTypeReader(typeReaders, type);
    ModuleDefinition definition = reader.readModuleDefinition(parentDefinition, moduleName, properties);
    definition.setParentDefinition(parentDefinition);
    return definition;
  }
View Full Code Here

   * implementation. If no parent definition is available, the built {@link ModuleDefinition} instance
   * is added as a sibling to the {@link RootModuleDefinition}.
   */
  public RootModuleDefinition getModuleDefinition() {
   
    ModuleDefinition currentParentDefinition = parentDefinition;
    for (String moduleName : modulesToLoad) {
      ModuleDefinition definition = buildModuleDefinition(currentParentDefinition, moduleName);
     
      if (currentParentDefinition == null) {
        Assert.isTrue(!definition.getName().equals(rootModuleDefinition.getName()), "Module definition with no parent cannot be the root module definition");
        rootModuleDefinition.addSibling(definition);
      }
     
      currentParentDefinition = definition;
    }
View Full Code Here

   
    //recursively build child definitions
    buildChildDefinitions(rootModuleDefinition, rootModuleName);
   
    for (String sibling : siblings) {
      ModuleDefinition siblingDefinition = buildModuleDefinition(null, sibling);
      buildChildDefinitions(siblingDefinition, siblingDefinition.getName());
      rootModuleDefinition.addSibling(siblingDefinition);
    }
    return rootModuleDefinition;
  }
View Full Code Here

 
  protected void buildChildDefinitions(ModuleDefinition parentDefinition, String parentModuleName) {
    Set<String> moduleChildren = children.get(parentModuleName);
    if (moduleChildren != null) {
      for (String moduleName : moduleChildren) {
        ModuleDefinition definition = buildModuleDefinition(parentDefinition, moduleName);
        buildChildDefinitions(definition, moduleName);
      }
    }
  }
View Full Code Here

    }
  }
 
  private RootModuleDefinition readRootModuleDefinition(Properties rootModuleProperties,
      TypeReader typeReader) {
    ModuleDefinition moduleDefinition = typeReader.readModuleDefinition(null, rootModuleName, rootModuleProperties);
    if (!(moduleDefinition instanceof RootModuleDefinition)) {
      throw new IllegalStateException("Type reader " + typeReader + " produced " + ModuleDefinition.class.getSimpleName() + " which is not an instance of " + RootModuleDefinition.class.getName());
    }
    RootModuleDefinition rootDefinition = (RootModuleDefinition) moduleDefinition;
    return rootDefinition;
View Full Code Here

TOP

Related Classes of org.impalaframework.module.definition.ModuleDefinition

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.