Package net.sourceforge.javautil.lifecycle

Examples of net.sourceforge.javautil.lifecycle.LifecycleException


  public L getLifecycle() { return this.getLifecycleInternal(); }

  @Override public synchronized void bind(IContainer childContainer, boolean autoStartChild) {
    switch (this.getLifecycle().getCurrentPhase()) {
      case DESTROY:
        throw new LifecycleException("Cannot bind child container after destroy", childContainer.getLifecycle());
       
      default:
        if (this.bindings.containsKey(childContainer))
          throw new IllegalArgumentException("Child container already bound");
       
View Full Code Here


     
      this.current = PhaseType.CREATE;
     
      if (create == null) this.fireAfter(PhaseType.CREATE);
    } else {
      throw new LifecycleException("Not in correct phase for creation: " + this.current, this);
    }
   
    this.target = null;
  }
View Full Code Here

     
      this.current = PhaseType.START;
     
      if (start == null) this.fireAfter(PhaseType.START);
    } else {
      throw new LifecycleException("Not in correct phase for starting: " + this.current, this);
    }
   
    this.target = null;
  }
View Full Code Here

      if (stop == null) this.fireAfter(PhaseType.STOP);
     
      this.target = null;
    } else {
      throw new LifecycleException("Not in correct phase for stopping: " + this.current, this);
    }
  }
View Full Code Here

     
      if (destroy == null) this.fireAfter(PhaseType.DESTROY);
     
      this.target = null;
    } else {
      throw new LifecycleException("Not in correct phase for destroying: " + this.current, this);
    }
  }
View Full Code Here

        case CREATE: this.create(); break;
        case DESTROY: this.destroy(); break;
        case START: this.start(); break;
        case STOP: this.stop(); break;
        default:
          throw new LifecycleException("Could not continue lifecycle from failure", this);
      }
    }
  }
View Full Code Here

          case INITIALIZE: case CREATE: case STOP: case INSTANTIATED:
            parent.start();
            break;
           
          case DESTROY:
            throw new LifecycleException("Parent has been destroyed, child cannot start", event.getSource());
           
          default:
        }
       
      default:
View Full Code Here

          case INSTANTIATED: case CREATE: case INITIALIZE: case STOP:
            child.start();
            break;
           
          case START:
            throw new LifecycleException("Child already started before parent", child);
           
          default:
            throw new LifecycleException("Child could not be started, invalid state: " + child.getCurrentPhase(), child);
        }
        break;
   
      default:
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.lifecycle.LifecycleException

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.