Examples of State


Examples of com.alibaba.jstorm.daemon.worker.State

      String workerid = entry.getKey().toString();

      WorkerHeartbeat whb = entry.getValue();

      State state = null;

      if (whb == null) {

        state = State.notStarted;
View Full Code Here

Examples of com.alipay.bluewhale.core.daemon.State

        String workerid = entry.getKey().toString();

        WorkerHeartbeat whb = entry.getValue();

        State state = null;

        if (whb == null) {

          state = State.notStarted;
View Full Code Here

Examples of com.almende.eve.state.State

   *         When rescheduled, events must be synchronized again with
   *         syncEvents.
   */
  private boolean scheduleActivity() {
    logger.info("scheduleActivity started"); // TODO: cleanup
    State state = getState();
    Activity activity = (Activity) state.get("activity");
    if (activity == null) {
      return false;
    }
   
    // read planned start and end from the activity
    DateTime activityStart = null;
    if (activity.withStatus().getStart() != null) {
      activityStart = new DateTime(activity.withStatus().getStart());
    }
    DateTime activityEnd = null;
    if (activity.withStatus().getEnd() != null) {
      activityEnd = new DateTime(activity.withStatus().getEnd());
    }
    Interval activityInterval = null;
    if (activityStart != null && activityEnd != null) {
      activityInterval = new Interval(activityStart, activityEnd);
    }

    // calculate solutions
    List<Weight> solutions = calculateSolutions();
    if (solutions.size() > 0) {
      // there are solutions. yippie!
      Weight solution = solutions.get(0);
      if (activityInterval == null ||
          !solution.getInterval().equals(activityInterval)) {
        // interval is changed, save new interval
        Status status = activity.withStatus();
        status.setStart(solution.getStart().toString());
        status.setEnd(solution.getEnd().toString());
        status.setActivityStatus(Status.ACTIVITY_STATUS.planned);
        status.setUpdated(DateTime.now().toString());
        state.put("activity", activity);
        logger.info("Activity replanned at " + solution.toString()); // TODO: cleanup logging
        try {
          // TODO: cleanup
          logger.info("Replanned activity: " + JOM.getInstance().writeValueAsString(activity));
        } catch (Exception e) {}
        return true;
      }
      else {
        // planning did not change. nothing to do.
      }
    }
    else {
      if (activityStart != null || activityEnd != null) {
        // no solution
        Issue issue = new Issue();
        issue.setCode(Issue.NO_PLANNING);
        issue.setType(Issue.TYPE.error);
        issue.setMessage("No free interval found for the meeting");
        issue.setTimestamp(DateTime.now().toString());
        // TODO: generate hints
        addIssue(issue);
 
        Status status = activity.withStatus();
        status.setStart(null);
        status.setEnd(null);
        status.setActivityStatus(Status.ACTIVITY_STATUS.error);
        status.setUpdated(DateTime.now().toString());
        state.put("activity", activity);
        logger.info(issue.getMessage()); // TODO: cleanup logging
        return true;
      }
      else {
        // planning did not change (no solution was already the case)
View Full Code Here

Examples of com.arjuna.webservices.wsat.State

     * Active -> Aborting (send aborted)
     * Preparing -> Aborting (send aborted)
     */
    private void rollbackDecision()
    {
        final State current ;
        synchronized(this)
        {
            current = state ;
            if ((current == State.STATE_PREPARING) || (current == State.STATE_ACTIVE))
            {
View Full Code Here

Examples of com.arjuna.webservices.wsba.State

     * Exiting -> Exiting (resend Exit)
     * Ended -> Ended (resend Cancelled)
     */
    public void cancel(final NotificationType cancel, final AddressingContext addressingContext, final ArjunaContext arjunaContext)
    {
        final State current ;
        synchronized(this)
        {
            current = state ;
            if (current == State.STATE_ACTIVE)
            {
View Full Code Here

Examples of com.arjuna.webservices11.wsat.State

    /**
     * @message com.arjuna.wst11.stub.ParticipantStub_2 [com.arjuna.wst11.stub.ParticipantStub_2] - Error restoring participant state
     */
    public boolean restoreState(final InputObjectState ios)
    {
        State state;
        try
        {
            final String id = ios.unpackString() ;
            final boolean durable = ios.unpackBoolean() ;
            final int stateTag = ios.unpackInt();
View Full Code Here

Examples of com.arjuna.webservices11.wsba.State

     * Exiting -> Exiting (resend Exit)
     * Ended -> Ended (resend Cancelled)
     */
    public void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
    {
        final State current ;
        synchronized(this)
        {                                     
            current = state ;
            if (current == State.STATE_ACTIVE)
            {
                changeState(State.STATE_CANCELING) ;
            }
        }

        if (current == State.STATE_ACTIVE)
        {
            executeCancel() ;
        }
        else if (current == State.STATE_COMPLETED)
        {
            sendCompleted() ;
        }
        else if ((current == State.STATE_FAILING_ACTIVE) || (current == State.STATE_FAILING_CANCELING))
        {
            sendFail(current.getValue()) ;
        }
        else if (current == State.STATE_NOT_COMPLETING)
        {
            sendCannotComplete() ;
        }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.transaction.TransactionMap.State

  /**
   * Return the current Transaction for this serverName and Thread.
   */
  public static SpiTransaction get(String serverName) {
    TransactionMap map = local.get();
    State state = map.getState(serverName);
    SpiTransaction t = (state == null) ? null : state.transaction;
    if (map.isEmpty()) {
      local.remove();
    }
    return t;
View Full Code Here

Examples of com.baidu.ueditor.define.State

   
    if ( this.configManager == null || !this.configManager.valid() ) {
      return new BaseState( false, AppInfo.CONFIG_ERROR ).toJSONString();
    }
   
    State state = null;
   
    int actionCode = ActionMap.getType( this.actionType );
   
    Map<String, Object> conf = null;
   
    switch ( actionCode ) {
   
      case ActionMap.CONFIG:
        return this.configManager.getAllConfig().toString();
       
      case ActionMap.UPLOAD_IMAGE:
      case ActionMap.UPLOAD_SCRAWL:
      case ActionMap.UPLOAD_VIDEO:
      case ActionMap.UPLOAD_FILE:
        conf = this.configManager.getConfig( actionCode );
        state = new Uploader( request, conf ).doExec();
        break;
       
      case ActionMap.CATCH_IMAGE:
        conf = configManager.getConfig( actionCode );
        String[] list = this.request.getParameterValues( (String)conf.get( "fieldName" ) );
        state = new ImageHunter( conf ).capture( list );
        break;
       
      case ActionMap.LIST_IMAGE:
      case ActionMap.LIST_FILE:
        conf = configManager.getConfig( actionCode );
        int start = this.getStartIndex();
        state = new FileManager( conf ).listFile( start );
        break;
       
    }
   
    return state.toJSONString();
   
  }
View Full Code Here

Examples of com.bbn.openmap.layer.util.stateMachine.State

     * @param graphics java.awt.Graphics.
     */
    public void render(java.awt.Graphics graphics) {
        Debug.message("eomg", "EditableOMPoly.render()");

        State state = getStateMachine().getState();

        if (poly != null && !(state instanceof PolyUndefinedState)) {
            poly.setVisible(true);
            poly.render(graphics);
            poly.setVisible(false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.