Package org.impalaframework.module.definition

Examples of org.impalaframework.module.definition.RootModuleDefinition


  static List<String> getRootProjectList() {
    String rootProjectsString = System.getProperty(LocationConstants.ROOT_PROJECTS_PROPERTY);
   
    if (rootProjectsString == null) {
      RootModuleDefinition md;
      try {
        md = Impala.getRootModuleDefinition();
        return md.getRootProjectNames();
      } catch (NoServiceException e) {
        CommandPropertyValue property = GlobalCommandState.getInstance().getProperty(CommandStateConstants.DEBUG_MODE);
        if (property != null && "true".equalsIgnoreCase(property.getValue())) {
          e.printStackTrace();
        }
View Full Code Here


    String moduleToReload = moduleOperationInput.getModuleName();
    Assert.notNull(moduleToReload, "moduleName is required as it specifies the name of the module to reload in "
        + this.getClass().getName());

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

    ModificationExtractorRegistry modificationExtractor = getModificationExtractorRegistry();
    ModificationExtractor calculator = modificationExtractor
        .getModificationExtractor(ModificationExtractorType.STRICT);

    ModuleDefinition childDefinition = newRootDefinition.findChildDefinition(moduleToReload, true);

    if (childDefinition != null) {
      childDefinition.setState(ModuleState.STALE);

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

   
    ModuleStateHolder moduleStateHolder = getModuleStateHolder();
    ModificationExtractorRegistry modificationExtractorRegistry = getModificationExtractorRegistry();
    ModificationExtractor calculator = modificationExtractorRegistry
        .getModificationExtractor(ModificationExtractorType.STRICT);
    RootModuleDefinition rootModuleDefinition = moduleStateHolder.getRootModuleDefinition();
   
    if (rootModuleDefinition != null) {
      logger.info("Shutting down application context");
      TransitionSet transitions = calculator.getTransitions(rootModuleDefinition, null);
      moduleStateHolder.processTransitions(transitions);
View Full Code Here

  public RootModuleDefinition getRootModuleDefinition() {
    return rootModuleDefinition;
  }

  public RootModuleDefinition cloneRootModuleDefinition() {
    RootModuleDefinition newDefinition = ModuleDefinitionUtils.cloneAndUnfreeze(rootModuleDefinition);
    return newDefinition;
  }
View Full Code Here

    Assert.notNull(moduleToReload,
        "moduleName is required as it specifies the name used to match the module to reload in "
            + this.getClass().getName());
   
    ModuleStateHolder moduleStateHolder = getModuleStateHolder();
    RootModuleDefinition newDefinition = moduleStateHolder.cloneRootModuleDefinition();

    ModuleDefinition found = newDefinition.findChildDefinition(moduleToReload, false);

    if (found != null) {

      String foundModuleName = found.getName();
     
View Full Code Here

   
    //note that the module definition source is externally supplied
    ModuleDefinitionSource newModuleDefinitionSource = moduleOperationInput.getModuleDefinitionSource();
    Assert.notNull(newModuleDefinitionSource, "moduleDefinitionSource is required as it specifies the new module definition to apply in " + this.getClass().getName());
   
    RootModuleDefinition newModuleDefinition = newModuleDefinitionSource.getModuleDefinition();
    RootModuleDefinition oldModuleDefinition = getExistingModuleDefinitionSource();
   
    ModificationExtractorType modificationExtractorType = getModificationExtractorType();
   
    // figure out the modules to reload
    ModificationExtractor calculator = getModificationExtractorRegistry()
View Full Code Here

  }
 
  protected void addModule(ModuleStateHolder moduleStateHolder, ModificationExtractor calculator,
      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);
        }
      }
View Full Code Here

  }
 
  protected boolean removeModule(ModuleStateHolder moduleStateHolder, ModificationExtractor calculator,
      String moduleToRemove) {
   
    RootModuleDefinition oldRootDefinition = moduleStateHolder.getRootModuleDefinition();
   
    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);
View Full Code Here

    ModuleLoader moduleLoader = moduleLoaderRegistry.getModuleLoader(newRootDefinition.getType());
    ConfigurableApplicationContext parentContext = moduleStateHolder.getRootModuleContext();

    ClassLoader classLoader = parentContext.getClassLoader();

    RootModuleDefinition existingModuleDefinition = moduleStateHolder.getRootModuleDefinition();
    Resource[] existingResources = moduleLoader.getSpringConfigResources(existingModuleDefinition, classLoader);
    Resource[] newResources = moduleLoader.getSpringConfigResources(newRootDefinition, classLoader);

    // compare difference
    List<Resource> existingResourceList = newResourceList(existingResources);
View Full Code Here

  }
 
  protected void postProcessBundleContext(BundleContext context) throws Exception {
   
    Impala.init();
    RootModuleDefinition definition = getModuleDefinition();
   
    ServiceReference serviceReference = context.getServiceReference(ModuleDefinitionSource.class.getName());
   
    Object service = context.getService(serviceReference);
   
View Full Code Here

TOP

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

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.