net.sf.mmm.util.io.base
Class AbstractDetectorStreamProvider

java.lang.Object
  extended by net.sf.mmm.util.component.base.AbstractComponent
      extended by net.sf.mmm.util.component.base.AbstractLoggableComponent
          extended by net.sf.mmm.util.io.base.AbstractDetectorStreamProvider
All Implemented Interfaces:
DetectorStreamProvider
Direct Known Subclasses:
DetectorStreamProviderImpl

public abstract class AbstractDetectorStreamProvider
extends AbstractLoggableComponent
implements DetectorStreamProvider

This is the abstract base implementation of the DetectorStreamProvider.

Since:
1.1.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  ByteArrayPool byteArrayPool
           
private  List<DetectorStreamProcessorFactory> processorFactoryList
           
 
Constructor Summary
AbstractDetectorStreamProvider()
          The constructor.
 
Method Summary
 void addProcessorFactory(DetectorStreamProcessorFactory processorFactory)
          This method registers a DetectorStreamProcessorFactory to this DetectorStreamProvider.
protected  void doInitialize()
          This method performs the actual initialization.
 ByteArrayPool getByteArrayPool()
          This method gets the ByteArrayPool used to borrow byte-arrays.
 List<DetectorStreamProcessorFactory> getProcessorFactoryList()
          This method gets the List of registered DetectorStreamProcessorFactory-instances.
 void setByteArrayPool(ByteArrayPool byteArrayPool)
          This method sets the ByteArrayPool to use.
 void setProcessorFactoryList(List<DetectorStreamProcessorFactory> processorFactoryList)
          This method sets the complete List of DetectorStreamProcessorFactory-instances.
 DetectorInputStream wrapInputStream(InputStream stream)
          This method gets a DetectorInputStream that wrapps the given stream.
 DetectorOutputStream wrapOutputStream(OutputStream stream)
          This method gets a DetectorOutputStream that wraps the given stream.
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent
getLogger, setLogger
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractComponent
doInitialized, getInitializationState, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.mmm.util.io.api.DetectorStreamProvider
wrapInputStream, wrapOutputStream
 

Field Detail

processorFactoryList

private List<DetectorStreamProcessorFactory> processorFactoryList
See Also:
getProcessorFactoryList()

byteArrayPool

private ByteArrayPool byteArrayPool
See Also:
getByteArrayPool()
Constructor Detail

AbstractDetectorStreamProvider

public AbstractDetectorStreamProvider()
The constructor.

Method Detail

getProcessorFactoryList

public List<DetectorStreamProcessorFactory> getProcessorFactoryList()
This method gets the List of registered DetectorStreamProcessorFactory-instances.

Returns:
the processorFactoryList

addProcessorFactory

public void addProcessorFactory(DetectorStreamProcessorFactory processorFactory)
This method registers a DetectorStreamProcessorFactory to this DetectorStreamProvider.

Parameters:
processorFactory - is the DetectorStreamProcessorFactory to add.
See Also:
setProcessorFactoryList(List)

setProcessorFactoryList

public void setProcessorFactoryList(List<DetectorStreamProcessorFactory> processorFactoryList)
This method sets the complete List of DetectorStreamProcessorFactory-instances. Do NOT call this method after addProcessorFactory(DetectorStreamProcessorFactory) has been called.

Parameters:
processorFactoryList - is the complete List of DetectorStreamProcessorFactory-instances to set.

setByteArrayPool

@Inject
public void setByteArrayPool(ByteArrayPool byteArrayPool)
This method sets the ByteArrayPool to use.

Parameters:
byteArrayPool - is the ByteArrayPool to set.

getByteArrayPool

public ByteArrayPool getByteArrayPool()
This method gets the ByteArrayPool used to borrow byte-arrays.

Returns:
the ByteArrayPool.

doInitialize

protected void doInitialize()
This method performs the actual initialization. It is called when AbstractComponent.initialize() is invoked for the first time.
ATTENTION:
When you override this method from a sub-class you need to do a super.AbstractComponent.doInitialize().

Overrides:
doInitialize in class AbstractLoggableComponent

wrapInputStream

public DetectorInputStream wrapInputStream(InputStream stream)
This method gets a DetectorInputStream that wrapps the given stream.

Specified by:
wrapInputStream in interface DetectorStreamProvider
Parameters:
stream - is the stream to wrap. This stream must be a fresh stream that is untouched since it was opened.
Returns:
the wrapped input stream.

wrapOutputStream

public DetectorOutputStream wrapOutputStream(OutputStream stream)
This method gets a DetectorOutputStream that wraps the given stream.

Specified by:
wrapOutputStream in interface DetectorStreamProvider
Parameters:
stream - is the stream to wrap. This stream must be a fresh stream that is untouched since it was opened.
Returns:
the wrapped output stream.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.