Package org.fusesource.ide.launcher.debug.model.variables

Examples of org.fusesource.ide.launcher.debug.model.variables.BaseCamelVariable


 
  /**
   * Initializes this frame based on its data
   */
  private void initVariables() throws DebugException {
    BaseCamelVariable var = null;
    BaseCamelValue val = null;
   
    // DEBUGGER - CAMEL
    var = new CamelDebuggerVariable(this.debugTarget, VARIABLE_NAME_DEBUGGER, String.class);
    val = new CamelDebuggerValue(this.fTarget, this, var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // CURRENT ENDPOINT
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_ENDPOINT, String.class);
    val = new BaseCamelValue(this.fTarget, getEndpointId(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // PROCESSOR
    var = new CamelProcessorVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR, String.class);
    val = new CamelProcessorValue(this.fTarget, this , getEndpointId(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
       
    // EXCHANGE
    var = new CamelExchangeVariable(this.debugTarget, VARIABLE_NAME_EXCHANGE, String.class);
    val = new CamelExchangeValue(this.fTarget, this.backlogTracerEventMessage, var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // MESSAGE
    var = new CamelMessageVariable(this.debugTarget, VARIABLE_NAME_MESSAGE, Message.class);
    val = new CamelMessageValue(this.fTarget, this.backlogTracerEventMessage.getMessage(), var.getReferenceType(), (CamelMessageVariable)var);
    var.setValue(val);
    this.fVariables.add(var);
  }
View Full Code Here


   * @param newVariables
   * @throws DebugException
   */
  private void updateChangedFields(IVariable[] oldVariables, IVariable[] newVariables ) throws DebugException {
    for (IVariable nV : newVariables) {
      BaseCamelVariable newVar = (BaseCamelVariable)nV;
      for (IVariable oldVar : oldVariables) {
        if (newVar.getName().equals(oldVar.getName())) {
          IValue oldValue = oldVar.getValue();
          IValue newValue = newVar.getValue();
          // first check only values
          if (!oldValue.getValueString().equals(newValue.getValueString())) {
            newVar.markChanged();
          }
          // also check for changed nested variables
          if (newValue.hasVariables() && oldValue.hasVariables()) {
            updateChangedFields(oldValue.getVariables(), newValue.getVariables());
          }
View Full Code Here

 
  /**
   * initialize variables
   */
  private void initExchange() throws DebugException {
    BaseCamelVariable var = null;
    BaseCamelValue val = null;

    // EXCHANGE ID
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_EXCHANGEID, String.class);
    val = new BaseCamelValue(this.fTarget, this.exchange.getExchangeId(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // NODE ID
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_NODEID, String.class);
    val = new BaseCamelValue(this.fTarget, this.exchange.getToNode(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // ROUTE ID
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_ROUTEID, String.class);
    val = new BaseCamelValue(this.fTarget, this.exchange.getRouteId(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // TIMESTAMP
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_TIMESTAMP, Date.class);
    val = new BaseCamelValue(this.fTarget, this.exchange.getTimestamp(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);

    // UID
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_UID, String.class);
    val = new BaseCamelValue(this.fTarget, this.exchange.getUid(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
  }
View Full Code Here

 
  /**
   * initialize variables
   */
  private void initMessage() throws DebugException {
    BaseCamelVariable var = null;
    BaseCamelValue val = null;
   
    // BODY
    var = new CamelBodyVariable(this.debugTarget, VARIABLE_NAME_MESSAGEBODY, String.class, parent);
    val = new BaseCamelValue(this.fTarget, this.message.getBody(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // HEADERS
    var = new CamelHeadersVariable(this.debugTarget, VARIABLE_NAME_MESSAGEHEADERS, ArrayList.class);
    val = new CamelHeadersValue(this.fTarget, this.message.getHeaders(), var.getReferenceType(), (CamelHeadersVariable)var);
    var.setValue(val);
    this.fVariables.add(var);
   
    // MESSAGE ID
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_MESSAGEID, String.class);
    val = new BaseCamelValue(this.fTarget, this.message.getExchangeId(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
  }
View Full Code Here

 
  /**
   * initialize variables
   */
  private void init() throws DebugException {
    BaseCamelVariable var = null;
    BaseCamelValue val = null;
   
    // PROCESSOR ID
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_ID, String.class);
    val = new BaseCamelValue(this.fTarget, getValueString(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // ROUTE ID
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_ROUTE_ID, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getRouteId(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // CAMEL ID
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_CAMEL_ID, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getCamelId(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);

    // EXCHANGES COMPLETED
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_EXCHANGES_COMPLETED, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getExchangesCompleted(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // EXCHANGES FAILED
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_EXCHANGES_FAILED, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getExchangesFailed(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // TOTAL EXCHANGES
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_EXCHANGES_TOTAL, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getTotalExchanges(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);

    // REDELIVERIES
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_REDELIVERIES, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getRedeliveries(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // EXTERNAL REDELIVERIES
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_EXTERNAL_REDELIVERIES, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getExternalRedeliveries(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // FAILURES HANDLED
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_FAILURES_HANDLED, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getFailuresHandled(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // LAST PROCESSING TIME
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_LAST_PROCESSING_TIME, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getLastProcessingTime(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);

    // MIN PROCESSING TIME
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_MIN_PROCESSING_TIME, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getMinProcessingTime(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // MEAN PROCESSING TIME
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_AVG_PROCESSING_TIME, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getMeanProcessingTime(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // MAX PROCESSING TIME
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_MAX_PROCESSING_TIME, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getMaxProcessingTime(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // TOTAL PROCESSING TIME
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_PROCESSOR_TOTAL_PROCESSING_TIME, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getTotalProcessingTime(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
  }
View Full Code Here

 
  /**
   * initialize variables
   */
  private void init() throws DebugException {
    BaseCamelVariable var = null;
    BaseCamelValue val = null;
   
    // BODY MAX CHARS
    var = new CamelBodyMaxCharsVariable(this.debugTarget, VARIABLE_NAME_BODYMAXCHARS, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getBodyMaxChars(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);

    // BODY INCLUDE FILES
    var = new CamelBodyIncludeFilesVariable(this.debugTarget, VARIABLE_NAME_BODYINCLUDEFILES, String.class);
    val = new BaseCamelValue(this.fTarget, "" + isBodyIncludeFiles(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // BODY INCLUDE STREAMS
    var = new CamelBodyIncludeStreamsVariable(this.debugTarget, VARIABLE_NAME_BODYINCLUDESTREAMS, String.class);
    val = new BaseCamelValue(this.fTarget, "" + isBodyIncludeStreams(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);

    // DEBUG COUNTER
    var = new BaseCamelVariable(this.debugTarget, VARIABLE_NAME_DEBUGCOUNTER, String.class);
    val = new BaseCamelValue(this.fTarget, "" + getDebugCounter(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
   
    // LOG LEVEL
    var = new CamelLogLevelVariable(this.debugTarget, VARIABLE_NAME_LOGLEVEL, String.class);
    val = new BaseCamelValue(this.fTarget, getLogLevel(), var.getReferenceType());
    var.setValue(val);
    this.fVariables.add(var);
  }
View Full Code Here

 
  /**
   * initialize variables
   */
  private void initHeaders() throws DebugException {
    BaseCamelVariable var = null;
    BaseCamelValue val = null;

    for (Header h : this.headers) {
      var = new CamelHeaderVariable(this.debugTarget, h.getKey(), String.class, parent);
      val = new CamelHeaderValue(this.fTarget, h, var.getReferenceType());
      var.setValue(val);
      this.fVariables.add(var);
    }
  }
View Full Code Here

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    ISelection sel = HandlerUtil.getCurrentSelection(event);
    Object o = Selections.getFirstSelection(sel);
    if (o instanceof BaseCamelVariable) {
      BaseCamelVariable var = (BaseCamelVariable)o;
      CamelDebugTarget cdt = (CamelDebugTarget)var.getDebugTarget();
      if (MessageDialog.openQuestion(HandlerUtil.getActiveShell(event), "Reset Debug Counter", "Do you really want to reset the debug counter?")) {
        cdt.getDebugger().resetDebugCounter()
      }     
    }
    return null;
View Full Code Here

TOP

Related Classes of org.fusesource.ide.launcher.debug.model.variables.BaseCamelVariable

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.