FileDocCategorySizeDatePackage
FMFileLimited.javaAPI DocAzureus 3.0.3.44146Tue Dec 05 22:48:40 GMT 2006com.aelitis.azureus.core.diskmanager.file.impl

FMFileLimited

public class FMFileLimited extends FMFileImpl
author
parg

Fields Summary
Constructors Summary
protected FMFileLimited(FMFileOwner _owner, FMFileManagerImpl _manager, File _file, int _type)

		super( _owner, _manager, _file, _type );
	
Methods Summary
public voidclose()

		try{
			this_mon.enter();		

			close(true);
			
		}finally{
			
			this_mon.exit();
		}
	
protected voidclose(boolean explicit)

	
		try{
			this_mon.enter();
		
			boolean	was_open = isOpen();
		
			try{
				closeSupport( explicit );
				
			}finally{
	
				if ( was_open ){
					
					releaseSlot();
				}
			}
		}finally{
			
			this_mon.exit();
		}
	
public voidensureOpen(java.lang.String reason)

		try{
			this_mon.enter();
		
			if ( isOpen()){
			
				usedSlot();
			
			}else{
			
				getSlot();
			
				try{
	
				  super.ensureOpen( reason );
					
				}finally{
					
					if ( !isOpen()){
						
						releaseSlot();
					}
				}
			}
		}finally{
			
			this_mon.exit();
		}
	
public longgetLength()

		try{
			this_mon.enter();
		
			ensureOpen( "FMFileLimited:getLength" );
		
			return( getLengthSupport());
			
		}finally{
			
			this_mon.exit();
		}
	
protected voidgetSlot()

		getManager().getSlot(this);
	
public voidread(org.gudy.azureus2.core3.util.DirectByteBuffer buffer, long offset)

		try{
			this_mon.enter();
		
			ensureOpen( "FMFileLimited:read" );
			
			readSupport( buffer, offset );
			
		}finally{
			
			this_mon.exit();
		}
	
public voidread(org.gudy.azureus2.core3.util.DirectByteBuffer[] buffers, long offset)

		try{
			this_mon.enter();
		
			ensureOpen( "FMFileLimited:read" );
			
			readSupport( buffers, offset );
			
		}finally{
			
			this_mon.exit();
		}
	
protected voidreleaseSlot()

		getManager().releaseSlot(this);
	
public voidsetAccessMode(int mode)

		try{
			this_mon.enter();
		
			if ( mode != getAccessMode()){
		
				close(false);
			}
		
			setAccessModeSupport( mode );
			
		}finally{
			
			this_mon.exit();
		}
	
public voidsetLength(long length)

		try{
			this_mon.enter();
		
			ensureOpen( "FMFileLimited:setLength" );
			
			setLengthSupport( length );
			
		}finally{
			
			this_mon.exit();
		}
	
protected voidusedSlot()

	
		getManager().usedSlot(this);
	
public voidwrite(org.gudy.azureus2.core3.util.DirectByteBuffer buffer, long position)

		try{
			this_mon.enter();
		
			ensureOpen( "FMFileLimited:write" );
			
			writeSupport( buffer, position );
			
		}finally{
			
			this_mon.exit();
		}
	
public voidwrite(org.gudy.azureus2.core3.util.DirectByteBuffer[] buffers, long position)

		try{
			this_mon.enter();
		
			ensureOpen( "FMFileLimited:write" );
			
			writeSupport( buffers, position );
			
		}finally{
			
			this_mon.exit();
		}