Package org.impalaframework.module.definition

Examples of org.impalaframework.module.definition.ModuleDefinition


public class DefaultModuleStateChangeNotifier implements ModuleStateChangeNotifier {

  private List<ModuleStateChangeListener> listeners = new LinkedList<ModuleStateChangeListener>();

  public void notify(ModuleStateHolder moduleStateHolder, ModuleStateChange change) {
    ModuleDefinition moduleDefinition = change.getModuleDefinition();

    for (ModuleStateChangeListener moduleStateChangeListener : listeners) {
      String moduleName = moduleStateChangeListener.getModuleName();

      boolean notify = true;

      if (moduleName != null) {
        if (!moduleName.equals(moduleDefinition.getName())) {
          notify = false;
        }
      }

      if (notify) {
View Full Code Here


    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);
      moduleStateHolder.processTransitions(transitions);

      boolean result = !transitions.getModuleTransitions().isEmpty();
View Full Code Here

      Collection<ModuleDefinition> oldChildren,
      Collection<ModuleDefinition> newChildren,
      List<ModuleStateChange> transitions) {
   
    for (ModuleDefinition newChild : newChildren) {
      ModuleDefinition oldChild = ModuleDefinitionUtils.getModuleFromCollection(oldChildren, newChild.getName());

      //if new module has definition not present in old, then load this with children
      if (oldChild == null) {
        loadDefinitions(newChild, transitions);       
      }
View Full Code Here

      Collection<ModuleDefinition> oldChildren,
      Collection<ModuleDefinition> newChildren,
      List<ModuleStateChange> transitions) {
 
    for (ModuleDefinition oldChild : oldChildren) {
      ModuleDefinition newChild = ModuleDefinitionUtils.getModuleFromCollection(newChildren, oldChild.getName());

      //if old module has definition which is no longer present, then unload this
      if (newChild == null) {
        unloadDefinitions(oldChild, transitions);
      }
View Full Code Here

      Collection<ModuleDefinition> oldChildren,
      Collection<ModuleDefinition> newChildren,
      List<ModuleStateChange> transitions) {
 
    for (ModuleDefinition oldChild : oldChildren) {
      ModuleDefinition newChild = ModuleDefinitionUtils.getModuleFromCollection(newChildren, oldChild.getName());

      if (newChild == null) {
        newParent.add(oldChild);
        oldChild.setParentDefinition(newParent);
      }
View Full Code Here

      Collection<? extends ModuleStateChange> changes = transitions.getModuleTransitions();

      for (ModuleStateChange change : changes) {
        Transition transition = change.getTransition();
        ModuleDefinition currentModuleDefinition = change.getModuleDefinition();

        TransitionProcessor transitionProcessor = transitionProcessorRegistry.getTransitionProcessor(transition);
        transitionProcessor.process(this, transitions.getNewRootModuleDefinition(), currentModuleDefinition);
     
        if (moduleStateChangeNotifier != null) {
View Full Code Here

            + this.getClass().getName());
   
    ModuleStateHolder moduleStateHolder = getModuleStateHolder();
    RootModuleDefinition newDefinition = moduleStateHolder.cloneRootModuleDefinition();

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

    if (found != null) {

      String foundModuleName = found.getName();
     
      Assert.notNull(moduleOperationRegistry, "moduleOperationRegistry cannot be null");
     
      ModuleOperation operation = moduleOperationRegistry.getOperation(
          ModuleOperationConstants.ReloadNamedModuleOperation);
View Full Code Here

      Collection<ModuleDefinition> oldChildren,
      Collection<ModuleDefinition> newChildren,
      List<ModuleStateChange> transitions) {
 
    for (ModuleDefinition oldChild : oldChildren) {
      ModuleDefinition newChild = ModuleDefinitionUtils.getModuleFromCollection(newChildren, oldChild.getName());

      if (newChild == null) {
        newParent.add(oldChild);
        oldChild.setParentDefinition(newParent);
      }
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

        }
      }
     
      for (ModuleDefinition newSibling : newSiblings) {
        if (originalDefinition.hasSibling(newSibling.getName())) {
          final ModuleDefinition siblingModule = originalDefinition.getSiblingModule(newSibling.getName());
          compare(siblingModule, newSibling, transitions);
        }
      }
    }
  }
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.