org.schmant.arg
Class MultiplexingNewWritableFileProxy

java.lang.Object
  extended by org.schmant.arg.AbstractMultiplexingWritableFileProxy
      extended by org.schmant.arg.MultiplexingNewWritableFileProxy
All Implemented Interfaces:
Lockable, WriteLockable, WritableFile, NewWritableFile

public class MultiplexingNewWritableFileProxy
extends AbstractMultiplexingWritableFileProxy
implements NewWritableFile

This writable file proxy writes its output to one or more other writable files. The target files are created the first time that they are requested.

The proxy uses an OverwriteStrategy to decide what to do if it finds an already existing entity where it wants to create a file. If it fails creating a file, it fails altogether.

The proxied objects are interpreted using InterpretAsNewWritableFileStrategy.

Since:
0.8
Author:
Karl Gustafsson
See Also:
MultiplexingExistingWritableFileProxy

Constructor Summary
MultiplexingNewWritableFileProxy(OverwriteStrategy overwriteStrategy, Object... proxied)
          Create a new multiplexing writable file proxy.
 
Method Summary
protected  WritableFile getFileFromArgumentInterpreter(Object f)
           
 
Methods inherited from class org.schmant.arg.AbstractMultiplexingWritableFileProxy
getFiles, getWriteLock, isWriteLockedByCurrentThread, lockForWriting, openChannelForAppend, openChannelForWrite, openForAppend, openForWrite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.entityfs.WritableFile
openChannelForAppend, openChannelForWrite, openForAppend, openForWrite
 
Methods inherited from interface org.entityfs.lock.WriteLockable
getWriteLock, isWriteLockedByCurrentThread, lockForWriting
 

Constructor Detail

MultiplexingNewWritableFileProxy

public MultiplexingNewWritableFileProxy(OverwriteStrategy overwriteStrategy,
                                        Object... proxied)
Create a new multiplexing writable file proxy.

Parameters:
overwriteStrategy - The overwrite strategy that decides how to deal with entities that exist in locations where this object will want to create files.
proxied - The proxied files. If one or more of the arguments are Collection objects, all objects are extracted from the collections.
Method Detail

getFileFromArgumentInterpreter

protected WritableFile getFileFromArgumentInterpreter(Object f)
Specified by:
getFileFromArgumentInterpreter in class AbstractMultiplexingWritableFileProxy