|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.impl.AbstractFileSystemBuilder<T>
org.entityfs.impl.impl.AbstractFileSystemBuilderImpl<T>
public abstract class AbstractFileSystemBuilderImpl<T extends AbstractFileSystemBuilderImpl<T>>
Abstract base class for file system builder classes. This class implements properties shared between all file system implementations.
Implementation note: This class implements the create()
method that creates the file system. Subclasses implement a number of
callback methods that create
calls. See the documentation of the
individual methods below.
Field Summary |
---|
Fields inherited from interface org.entityfs.FileSystemBuilder |
---|
DEFAULT_BUFFER_SIZE |
Constructor Summary | |
---|---|
protected |
AbstractFileSystemBuilderImpl(LogAdapter la,
EntityValidityControlStrategy evcs)
|
Method Summary | |
---|---|
FileSystem |
create()
Create the file system using the builder's settings. |
protected abstract AdapterFactory |
createAdapterFactory()
Subclasses implement this to create the right AdapterFactory
implementation. |
protected ChildEntityManagerFactory<EntityImplementation> |
createDefaultChildEntityManagerFactory(FileSystemAdapter fsa,
LogAdapterHolder lah)
Create a default ChildEntityManagerFactory if none is set. |
protected abstract FileSystemImplementation |
createFileSystem(SupportObjects fso,
FileSystemDelegate fsd)
Subclasses implement this to return a new file system instance. |
protected abstract FileSystemDelegate |
createFileSystemDelegate(FileSystemAdapter fsa)
This method is implemented by a subclass to create the file system delegate to use. |
T |
enableEvents()
Enable events for this file system. |
ChildEntityManagerFactory<EntityImplementation> |
getChildEntityManagerFactory()
Get the file system's child entity manager factory. |
EventManager |
getEventManager()
Get the file system's event manager. |
protected boolean |
isFileSystemSupportedByAllCapabilities(boolean readonly)
Verify that all capability providers are either read only or read/write. |
protected abstract boolean |
isReadOnly()
Subclasses implement this method to tell if the file system they are about to create is read only. |
T |
setChildEntityManagerFactory(ChildEntityManagerFactory<EntityImplementation> cemf)
Set an alternative child entity manager factory implementation. |
T |
setEventManager(EventManager em)
Set the file system's event manager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.entityfs.FileSystemBuilder |
---|
isLockingSupported |
Constructor Detail |
---|
protected AbstractFileSystemBuilderImpl(LogAdapter la, EntityValidityControlStrategy evcs)
Method Detail |
---|
public T setEventManager(EventManager em)
em
- The event manager.
this
enableEvents()
public EventManager getEventManager()
public T enableEvents()
setEventManager(EventManager)
with the default event
manager EventManagerImpl
.
this
setEventManager(EventManager)
public T setChildEntityManagerFactory(ChildEntityManagerFactory<EntityImplementation> cemf)
cemf
- A child entity manager factory implementation.
this
.public ChildEntityManagerFactory<EntityImplementation> getChildEntityManagerFactory()
protected boolean isFileSystemSupportedByAllCapabilities(boolean readonly)
readonly
- Is the file system to create read only?
true
if the file system is supported by all capabilities.protected abstract AdapterFactory createAdapterFactory()
AdapterFactory
implementation.
This method is called from create()
.
AdapterFactory
implementation.protected ChildEntityManagerFactory<EntityImplementation> createDefaultChildEntityManagerFactory(FileSystemAdapter fsa, LogAdapterHolder lah)
ChildEntityManagerFactory
if none is set.
The default implementation creates a
ChildEntityManagerFactoryImpl
. That implementation can let entity
objects be garbage collected, which is fine for file systems that are
backed by another file system, such as the FS file system or the Zip file
system. For file systems where the entities themselves contain all file
data, such as the RAM file system, another implementation must be used.
This method is called from create()
.
fsa
- The file system adapterlah
- The log adapter holder.
ChildEntityManagerFactory
.protected abstract FileSystemDelegate createFileSystemDelegate(FileSystemAdapter fsa)
This method is called from create()
.
fsa
- The file system adapter.
protected abstract boolean isReadOnly()
This method is called from create()
.
true
if the file system that is being created is read
only, false
if not.protected abstract FileSystemImplementation createFileSystem(SupportObjects fso, FileSystemDelegate fsd)
This method is called from create()
.
fso
- A collection of support objects.fsd
- The file system delegate.
public FileSystem create() throws FileSystemConfigurationException
This method uses getter methods to access properties, so if a getter is overridden by a subclass, that method is guaranteed to be called.
FileSystemConfigurationException
- On configuration errors.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |