org.entityfs.impl.impl
Class AbstractEntityAcceptingEntityImpl<T extends EntityAcceptingEntityView<?>>

java.lang.Object
  extended by org.entityfs.lock.AbstractLockable
      extended by org.entityfs.impl.impl.AbstractEntityImpl
          extended by org.entityfs.impl.impl.AbstractEntityAcceptingEntityImpl<T>
All Implemented Interfaces:
Comparable<EntityView>, Deletable, Entity, EntityAcceptingEntity<T>, EntityAcceptingEntityView<T>, EntityHolder, EntityView, Observable, EntityAcceptingEntityImplementation<T>, EntityAcceptingEntityViewImplementation<T>, EntityImplementation, EntityViewImplementation, Lockable, ReadLockable, ReadWriteLockable, WriteLockable, Named, ViewCapable<T>
Direct Known Subclasses:
DirectoryImpl, SymbolicLinkImpl

public abstract class AbstractEntityAcceptingEntityImpl<T extends EntityAcceptingEntityView<?>>
extends AbstractEntityImpl
implements EntityAcceptingEntityImplementation<T>


Constructor Summary
protected AbstractEntityAcceptingEntityImpl(FileSystemImplementation fs, DirectoryImplementation parent, EntityDelegate delegate, Object[] lockIdentifiers)
           
 
Method Summary
protected  ViewCapable<?> copyViewSettings(ViewCapable<?> vc, EntityView ev)
          Copy the view settings from the entity ev to the view capable entity ev.
 EntityImplementation dereferenceOrNull()
          Get the entity referenced by this entity.
 Filter<? super EntityView> getFilter()
          Get the filter that is used to create this view.
 boolean hasFilters()
          Does this view have any filters?
 
Methods inherited from class org.entityfs.impl.impl.AbstractEntityImpl
addObserver, assertCanBeDeleted, assertNotReadOnly, assertOk, assertParentIsReadLocked, assertParentIsWriteLocked, assertThisOrParentIsReadLocked, canRead, canWrite, compareTo, copy, copyAttributes, countObservers, createLock, createLockInternal, delete, deleteInternal, deleteObserver, deleteObservers, disconnect, doDelete, equals, fireEvent, getAbsoluteLocationNoLocking, getCapability, getDelegate, getDelegateOfType, getDelegateOfTypeOrNull, getEntityAdapter, getFileSystem, getFileSystemImplementation, getLastModified, getLogAdapter, getName, getNameNoLocking, getObserverList, getParent, getParentInternal, getViewed, getViewedEntity, handleDisappeared, hasExecuteAccess, hashCode, hasReadAccess, hasWriteAccess, init, isConnected, isDeleted, isRootDirectory, isValid, rename, setLastModified, supportsCapability, toString, touch, verifyHasExecuteAccess, verifyHasExecuteAccessToParent, verifyHasReadAccess, verifyHasReadAccessToParent, verifyHasWriteAccess, verifyHasWriteAccessToParent
 
Methods inherited from class org.entityfs.lock.AbstractLockable
assertIsReadLocked, assertIsWriteLocked, getLockAcquiringStrategy, getLockAdapter, getLocked, getReadLock, getWriteLock, isReadLockedByCurrentThread, isWriteLockedByCurrentThread, lock, lockForReading, lockForWriting, logLockStack
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.entityfs.EntityAcceptingEntityView
canBeDereferenced
 
Methods inherited from interface org.entityfs.ViewCapable
newView
 
Methods inherited from interface org.entityfs.EntityHolder
containsEntity, containsEntity, getEntityOrNull
 
Methods inherited from interface org.entityfs.impl.EntityImplementation
assertIsReadLocked, assertIsWriteLocked, assertNotReadOnly, assertOk, assertParentIsReadLocked, assertParentIsWriteLocked, createLockInternal, fireEvent, getDelegate, getDelegateOfType, getDelegateOfTypeOrNull, getEntityAdapter, init, verifyHasExecuteAccess, verifyHasExecuteAccessToParent, verifyHasReadAccess, verifyHasReadAccessToParent, verifyHasWriteAccess, verifyHasWriteAccessToParent
 
Methods inherited from interface org.entityfs.impl.EntityViewImplementation
getAbsoluteLocationNoLocking, getFileSystemImplementation, getNameNoLocking, getObserverList
 
Methods inherited from interface org.entityfs.Entity
hasExecuteAccess, hasReadAccess, hasWriteAccess
 
Methods inherited from interface org.entityfs.EntityView
canRead, canWrite, copy, copy, copyAttributes, createLock, disconnect, getCapability, getFileSystem, getLastModified, getParent, getType, getViewed, getViewedEntity, isConnected, isRootDirectory, isValid, lock, rename, setLastModified, supportsCapability, touch
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.entityfs.event.Observable
addObserver, countObservers, deleteObserver, deleteObservers
 
Methods inherited from interface org.entityfs.Named
getName
 
Methods inherited from interface org.entityfs.lock.ReadLockable
getReadLock, isReadLockedByCurrentThread, lockForReading
 
Methods inherited from interface org.entityfs.Deletable
delete, isDeleted
 
Methods inherited from interface org.entityfs.lock.WriteLockable
getWriteLock, isWriteLockedByCurrentThread, lockForWriting
 

Constructor Detail

AbstractEntityAcceptingEntityImpl

protected AbstractEntityAcceptingEntityImpl(FileSystemImplementation fs,
                                            DirectoryImplementation parent,
                                            EntityDelegate delegate,
                                            Object[] lockIdentifiers)
Method Detail

hasFilters

public boolean hasFilters()
Description copied from interface: ViewCapable
Does this view have any filters?

Specified by:
hasFilters in interface ViewCapable<T extends EntityAcceptingEntityView<?>>
Returns:
false, always.

getFilter

public Filter<? super EntityView> getFilter()
Description copied from interface: ViewCapable
Get the filter that is used to create this view. If this is called on an entity, this method returns null.

Specified by:
getFilter in interface ViewCapable<T extends EntityAcceptingEntityView<?>>
Returns:
null, always.

dereferenceOrNull

public EntityImplementation dereferenceOrNull()
Description copied from interface: EntityAcceptingEntityView
Get the entity referenced by this entity. For a directory (view), this returns the directory (view). For a symbolic link (view), this returns (the same view of) the link target.

This method handles symbolic links in the symbolic link target correctly. For instance, if the symbolic link l1 has the target /d1/l2/f1 and the symbolic link l2 has the target ../d2, l1 will be dereferenced to the entity with the location /d2/f1 (given that d1 and d2 are directories).

Specified by:
dereferenceOrNull in interface EntityAcceptingEntityView<T extends EntityAcceptingEntityView<?>>
Returns:
The entity referenced by this entity

copyViewSettings

protected ViewCapable<?> copyViewSettings(ViewCapable<?> vc,
                                          EntityView ev)
Copy the view settings from the entity ev to the view capable entity ev.

Parameters:
vc - The view capable entity to create (possibly nested) views for
ev - The entity view whose view filters should be used.
Returns:
A view of vc with the same set of filters as ev.