Esempio n. 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();
  }
Esempio n. 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();
    }
  }
Esempio n. 3
0
  @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);
    }
  }
Esempio n. 4
0
 @Override
 public void prepare(FlowProcess flowProcess, OperationCall<Matcher> operationCall) {
   operationCall.setContext(getPattern().matcher(""));
 }
Esempio n. 5
0
  @Override
  public void prepare(FlowProcess flowProcess, OperationCall<Random> operationCall) {
    super.prepare(flowProcess, operationCall);

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