Package org.impalaframework.module

Examples of org.impalaframework.module.ModuleDefinition


     */
    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


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

       
        logger.info("With parent '" + parent + "', adding module: " + moduleDefinition);
       
        final Vertex parentVertex = getRequiredVertex(parent);
       
        ModuleDefinition parentDefinition = parentVertex.getModuleDefinition();
        parentDefinition.addChildModuleDefinition(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

    protected RuntimeModule doLoadModule(ModuleDefinition definition) {
        Assert.notNull(definition);
        Assert.notNull(classLoaderFactory);
       
        ClassLoader parentClassLoader = null;
        final ModuleDefinition parentDefinition = definition.getParentDefinition();

        if (parentDefinition != null) {
            parentClassLoader = getClassLoaderRegistry().getClassLoader(parentDefinition.getName());
        }
        final ClassLoader classLoader = classLoaderFactory.newClassLoader(parentClassLoader, definition);
        return new SimpleRuntimeModule(classLoader, 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

  }

  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

      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.addChildModuleDefinition(moduleDefinition);
     
      moduleDefinition.setParentDefinition(newParent);
    }

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

TOP

Related Classes of org.impalaframework.module.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.