|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.entityfs.util.CompoundEntityHolder
public class CompoundEntityHolder
This EntityHolder combines several other EntityHolder:s. It
can be used to make several directories look as one, at least if they are to
be used as EntityHolder:s.
| Constructor Summary | |
|---|---|
CompoundEntityHolder(EntityHolder... entityHolders)
Create a new CompoundEntityHolder from some EntityHolder
:s |
|
CompoundEntityHolder(List<? extends EntityHolder> l)
Create a new CompoundEntityHolder from a list of
EntityHolder:s. |
|
| Method Summary | |
|---|---|
boolean |
containsEntity(EntityView ent)
Does this entity holder contain the supplied entity? If this is called on a symbolic link, it is checked if the link target is a directory and that directory contains the entity. |
boolean |
containsEntity(String name)
Can an entity with the given name be retrieved from this object? If this is called on a symbolic link, it is checked if the link target is a directory and that directory contains an entity with the given name. |
EntityView |
getEntityOrNull(String name)
Return the first entity with the supplied name found in the list of EntityHolder:s. |
EntityLock |
getReadLock()
Get the read lock without locking it. |
boolean |
isReadLockedByCurrentThread()
Does the calling thread hold a read lock for this object? A write lock also qualifies as a read lock. |
EntityLock |
lockForReading()
Lock object for reading and return the lock. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompoundEntityHolder(List<? extends EntityHolder> l)
CompoundEntityHolder from a list of
EntityHolder:s.
l - A list of entity holders. This method makes a copy of this list.public CompoundEntityHolder(EntityHolder... entityHolders)
CompoundEntityHolder from some EntityHolder
:s
entityHolders - The EntityHolder:s.| Method Detail |
|---|
public EntityLock lockForReading()
ReadLockableEntityLockAdapterFactory and
LockAcquiringStrategy used. If this is called on an object that
somehow is connected to an entity object, that entity's file system's
entity lock adapter factory and lock acquiring strategy is used.
A read lock cannot be upgraded to a write lock (just like how Java's
ReadWriteLock works).
For more discussions on locks and locking, see Entity and
FileSystem.
This method always returns a lock, even if the object's file system is not locking or if the object is read only.
lockForReading in interface ReadLockablepublic EntityLock getReadLock()
ReadLockableThis method always returns a lock, even if the object's file system is not locking or if the object is read only.
getReadLock in interface ReadLockable
public boolean containsEntity(String name)
throws IllegalStateException,
NotADirectoryException,
CircularReferenceException
EntityHolder
containsEntity in interface EntityHoldername - The name of the entity.
true if there is an entity with the given name referenced
by this holder.
IllegalStateException - If this is called on a disconnected view.
NotADirectoryException - If an entity in a symbolic link target
path is not a directory or cannot be dereferenced to a directory.
CircularReferenceException - If symbolic link references are
circular. For instance l1 -> l2, l2 -> l1.
public boolean containsEntity(EntityView ent)
throws IllegalStateException,
NotADirectoryException,
CircularReferenceException
EntityHolder
containsEntity in interface EntityHolderent - The entity (or a view of it).
true If the entity holder contains the supplied entity.
IllegalStateException - If this is called on a disconnected view.
NotADirectoryException - If an entity in a symbolic link target
path is not a directory or cannot be dereferenced to a directory.
CircularReferenceException - If symbolic link references are
circular. For instance l1 -> l2, l2 -> l1.
public EntityView getEntityOrNull(String name)
throws IllegalStateException,
NotADirectoryException,
CircularReferenceException
EntityHolder:s.
getEntityOrNull in interface EntityHoldername - The name of the entity.
EntityView or null. If this method is called
on a DirectoryView and the returned entity is ViewCapable
, the returned object inherits the view settings of the parent. If the
returned entity is a file, the returned object can be cast to an
EFile, if it is a directory, it can be cast to a
DirectoryView (or a Directory if this method is called on
a Directory rather than a DirectoryView). The type of the
returned object can be determined by calling its
EntityView.getType() method or by using instanceof.
IllegalStateException - If the view is disconnected.
NotADirectoryException - If an entity in the symbolic link target
path is not a directory or cannot be dereferenced to a directory.
CircularReferenceException - If the symbolic link references are
circular. For instance l1 -> l2, l2 -> l1.
public boolean isReadLockedByCurrentThread()
throws IllegalStateException
ReadLockable
isReadLockedByCurrentThread in interface ReadLockabletrue if the lockable object is read or write locked by
the current thread.
IllegalStateException - If this is called on a disconnected entity
view.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||