Package org.impalaframework.module.definition

Examples of org.impalaframework.module.definition.ModuleDefinition


    Collection<ModuleDefinition> loadable = new LinkedHashSet<ModuleDefinition>();
   
    //collect unloaded first
    for (ModuleStateChange moduleStateChange : transitions) {
      if (moduleStateChange.getTransition().equals(Transition.UNLOADED_TO_LOADED)) {
        final ModuleDefinition moduleDefinition = moduleStateChange.getModuleDefinition();
       
        //are we likely to get duplicates
        loadable.add(moduleDefinition);
      }
    }
View Full Code Here


  }

  public ModuleOperationResult doExecute(ModuleOperationInput moduleOperationInput) {
   
    Assert.notNull(moduleOperationInput, "moduleOperationInput cannot be null");
    ModuleDefinition moduleToAdd = moduleOperationInput.getModuleDefinition();
    Assert.notNull(moduleToAdd, "moduleName is required as it specifies the name of the module to add in " + this.getClass().getName());
   
    ModuleStateHolder moduleStateHolder = getModuleStateHolder();
    ModificationExtractor calculator = getModificationExtractorRegistry().getModificationExtractor(ModificationExtractorType.STICKY);
   
View Full Code Here

    Collection<ModuleDefinition> unloadable = new LinkedHashSet<ModuleDefinition>();
   
    //collect unloaded first
    for (ModuleStateChange moduleStateChange : transitions) {
      if (moduleStateChange.getTransition().equals(Transition.LOADED_TO_UNLOADED)) {
        final ModuleDefinition moduleDefinition = moduleStateChange.getModuleDefinition();
       
        //are we likely to get duplicates
        unloadable.add(moduleDefinition);
      }
    }
View Full Code Here

      ModuleDefinition moduleDefinition) {

    RootModuleDefinition oldRootDefinition = moduleStateHolder.cloneRootModuleDefinition();
    RootModuleDefinition newRootDefinition = moduleStateHolder.cloneRootModuleDefinition();

    ModuleDefinition parent = moduleDefinition.getParentDefinition();
   
    if (moduleDefinition instanceof RootModuleDefinition) {
      newRootDefinition = (RootModuleDefinition) moduleDefinition;
    }
    else {

      ModuleDefinition newParent = null;

      if (parent == null) {
        newParent = newRootDefinition;
      }
      else {
        String parentName = parent.getName();
        newParent = newRootDefinition.findChildDefinition(parentName, true);

        if (newParent == null) {
          throw new InvalidStateException("Unable to find parent module '" + parentName + "' in " + newRootDefinition);
        }
      }

      newParent.add(moduleDefinition);
     
      moduleDefinition.setParentDefinition(newParent);
    }

    TransitionSet transitions = calculator.getTransitions(oldRootDefinition, newRootDefinition);
View Full Code Here

     
      String name = getName(definitionElement);
      String type = getType(definitionElement);
     
      TypeReader typeReader = typeReaderRegistry.getTypeReader(type);
      ModuleDefinition childDefinition = typeReader.readModuleDefinition(parentDefinition, name, definitionElement);
     
      if (parentDefinition == null) {
        //no parent definition is null, this must be the case where the siblings
        rootModuleDefinition.addSibling(childDefinition);
      }
View Full Code Here

    if (oldRootDefinition == null) {
      return false;
    }
   
    RootModuleDefinition newRootDefinition = moduleStateHolder.cloneRootModuleDefinition();
    ModuleDefinition definitionToRemove = newRootDefinition.findChildDefinition(moduleToRemove, true);

    if (definitionToRemove != null) {
      if (definitionToRemove instanceof RootModuleDefinition) {
        //we're removing the rootModuleDefinition
        TransitionSet transitions = calculator.getTransitions(oldRootDefinition, null);
        moduleStateHolder.processTransitions(transitions);
        return true;
      }
      else {
        ModuleDefinition parent = definitionToRemove.getParentDefinition();
        if (parent != null) {
          parent.remove(moduleToRemove);
         
          definitionToRemove.setParentDefinition(null);

          TransitionSet transitions = calculator.getTransitions(oldRootDefinition, newRootDefinition);
          moduleStateHolder.processTransitions(transitions);
View Full Code Here

    if (existingDefinition.findChildDefinition(moduleName, true) != null) {
      return existingDefinition;
    }
   
    buildMaps();
    ModuleDefinition parent = null;
   
    String childModule = moduleName;
   
    //start with parent module
    String parentModule = null;
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

   
    logger.info("With parent '" + parent + "', adding module: " + moduleDefinition);
   
    final Vertex parentVertex = getRequiredVertex(parent);
   
    ModuleDefinition parentDefinition = parentVertex.getModuleDefinition();
    parentDefinition.add(moduleDefinition);
    moduleDefinition.setParentDefinition(parentDefinition);
   
    //now recursively add definitions
    List<Vertex> addedVertices = new ArrayList<Vertex>();
    populateDefinition(addedVertices, moduleDefinition);
View Full Code Here

   */
  private void populateVertexDependencies(Vertex vertex) {
   
    Assert.notNull(vertex, "vertex cannot be null");
   
    final ModuleDefinition moduleDefinition = vertex.getModuleDefinition();
   
    final List<String> dependentModuleNames = moduleDefinition.getDependentModuleNames();
    for (String dependent : dependentModuleNames) {
     
      final Vertex dependentVertex = vertexMap.get(dependent);
     
      if (dependentVertex == null) {
        throw new InvalidStateException("Unable to dependency named named '" + dependent
            + "' for module definition '" + moduleDefinition.getName() + "'");
       
      } else {
        //register the vertex dependency
        populateVertexDependency(vertex, dependentVertex);
      }
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.