com.dyuproject.protostuff
Class Pipe

java.lang.Object
  extended by com.dyuproject.protostuff.Pipe

public abstract class Pipe
extends java.lang.Object

Transfers data from an Input to an Output. It is recommended to use pipe only to stream data coming from server-side services (e.g from your datastore/etc). Incoming data from the interwebs should not be piped due to validation/security purposes.

Author:
David Yu
Date created:
Oct 6, 2010

Nested Class Summary
static class Pipe.Schema<T>
          Schema for transferring data from a source (Input) to a different sink (Output).
 
Field Summary
protected  Input input
           
protected  Output output
           
 
Constructor Summary
Pipe()
           
 
Method Summary
protected abstract  Input begin(Pipe.Schema<?> pipeSchema)
          Begin preliminary input processing.
protected abstract  void end(Pipe.Schema<?> pipeSchema, Input input, boolean cleanupOnly)
          End input processing.
protected  Pipe reset()
          Resets this pipe for re-use.
static
<T> void
transferDirect(Pipe.Schema<T> pipeSchema, Pipe pipe, Input input, Output output)
          This should not be called directly by applications.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

protected Input input

output

protected Output output
Constructor Detail

Pipe

public Pipe()
Method Detail

reset

protected Pipe reset()
Resets this pipe for re-use.


begin

protected abstract Input begin(Pipe.Schema<?> pipeSchema)
                        throws java.io.IOException
Begin preliminary input processing.

Throws:
java.io.IOException

end

protected abstract void end(Pipe.Schema<?> pipeSchema,
                            Input input,
                            boolean cleanupOnly)
                     throws java.io.IOException
End input processing. If cleanupOnly is true, the io processing ended prematurely hence the underlying pipe should cleanup/close all resources that need to be.

Throws:
java.io.IOException

transferDirect

public static <T> void transferDirect(Pipe.Schema<T> pipeSchema,
                                      Pipe pipe,
                                      Input input,
                                      Output output)
                           throws java.io.IOException
This should not be called directly by applications.

Throws:
java.io.IOException


Copyright © 2009-2014. All Rights Reserved.