Exemple #1
0
  @Override
  public void cleanup(FlowProcess flowProcess, OperationCall<TupleEntryCollector> operationCall) {
    if (!flushCalled) throw new RuntimeException("flush never called");

    if (path == null) return;

    operationCall.getContext().close();
  }
Exemple #2
0
  @Override
  public void prepare(FlowProcess flowProcess, OperationCall<TupleEntryCollector> operationCall) {
    if (path == null) return;

    try {
      operationCall.setContext(flowProcess.openTapForWrite(path));
    } catch (IOException exception) {
      exception.printStackTrace();
    }
  }
  @Override
  public void prepare(FlowProcess flowProcess, OperationCall<DocumentBuilder> operationCall) {
    try {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

      factory.setNamespaceAware(true);

      operationCall.setContext(factory.newDocumentBuilder());
    } catch (ParserConfigurationException exception) {
      throw new OperationException("could not create document builder", exception);
    }
  }
Exemple #4
0
 @Override
 public void prepare(FlowProcess flowProcess, OperationCall<Matcher> operationCall) {
   operationCall.setContext(getPattern().matcher(""));
 }
Exemple #5
0
  @Override
  public void prepare(FlowProcess flowProcess, OperationCall<Random> operationCall) {
    super.prepare(flowProcess, operationCall);

    operationCall.setContext(new Random(seed));
  }