Пример #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();
  }
Пример #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();
    }
  }
Пример #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);
    }
  }
Пример #4
0
 @Override
 public void prepare(FlowProcess flowProcess, OperationCall<Matcher> operationCall) {
   operationCall.setContext(getPattern().matcher(""));
 }
Пример #5
0
  @Override
  public void prepare(FlowProcess flowProcess, OperationCall<Random> operationCall) {
    super.prepare(flowProcess, operationCall);

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