org.mule.module.pgp
Class AbstractTransformPolicy

java.lang.Object
  extended by org.mule.module.pgp.AbstractTransformPolicy
All Implemented Interfaces:
TransformPolicy
Direct Known Subclasses:
TransformContinuouslyPolicy, TransformPerRequestInChunksPolicy, TransformPerRequestPolicy

public abstract class AbstractTransformPolicy
extends Object
implements TransformPolicy

An abstract implementation of TransformPolicy. Subclasses must define the behavior of the copying Thread


Nested Class Summary
protected  class AbstractTransformPolicy.TransformerWork
           
 
Field Summary
protected  boolean isClosed
           
protected static Log logger
           
 
Constructor Summary
AbstractTransformPolicy()
           
 
Method Summary
protected  AtomicLong getBytesRequested()
           
protected abstract  Thread getCopyingThread()
           
protected  LazyTransformedInputStream getInputStream()
           
protected  StreamTransformer getTransformer()
           
 void initialize(LazyTransformedInputStream lazyTransformedInputStream)
          Initialize this policy with the corresponding lazyTransformedInputStream
 void readRequest(long length)
          Notifies this policy that the object has requested nroOfBytes
 void release()
          Releases all the resources of this policy
protected  void startCopyingThread()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Log logger

isClosed

protected volatile boolean isClosed
Constructor Detail

AbstractTransformPolicy

public AbstractTransformPolicy()
Method Detail

initialize

public void initialize(LazyTransformedInputStream lazyTransformedInputStream)
Initialize this policy with the corresponding lazyTransformedInputStream

Specified by:
initialize in interface TransformPolicy

readRequest

public void readRequest(long length)
Notifies this policy that the object has requested nroOfBytes

Specified by:
readRequest in interface TransformPolicy
Parameters:
length - the nro of bytes requested by the object

startCopyingThread

protected void startCopyingThread()

release

public void release()
Releases all the resources of this policy

Specified by:
release in interface TransformPolicy

getCopyingThread

protected abstract Thread getCopyingThread()
Returns:
an instance of the copying Thread

getTransformer

protected StreamTransformer getTransformer()

getInputStream

protected LazyTransformedInputStream getInputStream()

getBytesRequested

protected AtomicLong getBytesRequested()


Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.