Logo Search packages:      
Sourcecode: uimaj version File versions  Download package

CpeConfigurationImpl.java

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.apache.uima.collection.impl.metadata.cpe;

import org.apache.uima.collection.metadata.CpeCheckpoint;
import org.apache.uima.collection.metadata.CpeConfiguration;
import org.apache.uima.collection.metadata.CpeDescriptorException;
import org.apache.uima.collection.metadata.CpeTimer;
import org.apache.uima.collection.metadata.OutputQueue;
import org.apache.uima.resource.metadata.impl.MetaDataObject_impl;
import org.apache.uima.resource.metadata.impl.PropertyXmlInfo;
import org.apache.uima.resource.metadata.impl.XmlizationInfo;

00031 public class CpeConfigurationImpl extends MetaDataObject_impl implements CpeConfiguration {
  private static final long serialVersionUID = 1153815602567127240L;

  private String startAt;

  private long num2Process;

  private CpeCheckpoint checkpoint;

  private String timerImpl;

  private String deployAs;

  private OutputQueue outputQueue;

  public CpeConfigurationImpl() {
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#setDeployment(java.lang.String)
   */
00054   public void setDeployment(String aDeploy) throws CpeDescriptorException {
    deployAs = aDeploy;
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#getDeployment()
   */
00063   public String getDeployment() {
    return deployAs;
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#setNumToProcess(int)
   */
00072   public void setNumToProcess(int aNumToProcess) throws CpeDescriptorException {
    num2Process = aNumToProcess;
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#getNumToProcess()
   */
00081   public int getNumToProcess() {
    return (int) num2Process;
  }

00085   public void setStartingEntityId(String aStartAt) {
    startAt = aStartAt;
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#getStartingEntityId()
   */
00094   public String getStartingEntityId() {
    return startAt;
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#setCheckpoint(org.apache.uima.collection.metadata.CpeCheckpoint)
   */
00103   public void setCheckpoint(CpeCheckpoint aCheckpoint) throws CpeDescriptorException {
    checkpoint = aCheckpoint;
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#getCheckpoint()
   */
00112   public CpeCheckpoint getCheckpoint() {
    return checkpoint;
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#removeCheckpoint()
   */
00121   public void removeCheckpoint() {
    checkpoint = null;
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#setCpeTimer(org.apache.uima.collection.metadata.CpeTimer)
   */
00130   public void setCpeTimer(CpeTimer aTimer) {
    timerImpl = aTimer.get();
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#getCpeTimer()
   */
00139   public CpeTimer getCpeTimer() {
    return new CpeTimerImpl(timerImpl);
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.apache.uima.collection.metadata.CpeConfiguration#removeCpeTimer()
   */
  public void removeCpeTimer() {
    timerImpl = "";
  }

  /** * */

  /**
   * @return
   */
00157   public String getDeployAs() {
    return deployAs;
  }

  /**
   * @return
   */
00164   public long getNum2Process() {
    return num2Process;
  }

  /**
   * @return
   */
00171   public String getStartAt() {
    return startAt;
  }

  /**
   * @return
   */
00178   public String getTimerImpl() {
    return timerImpl;
  }

  /**
   * @param string
   */
00185   public void setDeployAs(String string) {
    deployAs = string;
  }

  /**
   * @param l
   */
00192   public void setNumToProcess(long l) {
    num2Process = l;
  }

  /**
   * @param i
   */
00199   public void setStartAt(String aStartAt) {

    startAt = aStartAt;
  }

  /**
   * @param string
   */
00207   public void setTimerImpl(String string) {
    timerImpl = string;
  }

  /**
   * @return
   */
00214   public OutputQueue getOutputQueue() {
    return outputQueue;
  }

  public int getMaxTimeToWait() {
    if (getOutputQueue() == null) {
      return 0;
    }
    return getOutputQueue().getDequeueTimeout();
  }

  /**
   * @param queue
   */
00228   public void setOutputQueue(OutputQueue queue) {
    outputQueue = queue;
  }

00232   protected XmlizationInfo getXmlizationInfo() {
    return XMLIZATION_INFO;
  }

  static final private XmlizationInfo XMLIZATION_INFO = new XmlizationInfo("cpeConfig",
          new PropertyXmlInfo[] { new PropertyXmlInfo("numToProcess"),
              new PropertyXmlInfo("deployAs"), new PropertyXmlInfo("checkpoint", null),
              new PropertyXmlInfo("timerImpl"), new PropertyXmlInfo("outputQueue", null),
              new PropertyXmlInfo("startAt"), });

}

Generated by  Doxygen 1.6.0   Back to index