|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectautohit.universe.service.UniverseLocal
Universe server implimentation for a local filesystem. This does NOT implement caching! Every object is unique. The 'root' property should be a path to the root of the universe on the filesystem. It should begin with a '/', and should have no trailing slashes. This universe assumes that storable objects can be serialized completely. If you plan on moving data that isn't in objects or are not inherently able to seriously completely, then you should obtain streams for put and get, and handle the IO yourself.
EPG - New - 24Apr03
Constructor Summary | |
UniverseLocal()
|
Method Summary | |
void |
close()
This will always be called when the universe is destroyed |
void |
discard(java.lang.String name)
Discard an object. |
boolean |
exists(java.lang.String name)
Check to see if an object exists |
void |
flush(java.lang.String name)
Flush an object. |
void |
genesis(UniverseProperties props)
Impliment the genesis. |
java.lang.Object |
get(java.lang.String name)
Load an object from the universe. |
javax.activation.DataSource |
getDataSource(java.lang.String name)
Get a Data Source that can interact with this universe object |
javax.activation.FileDataSource |
getFileDataSource(java.lang.String name)
Get a FileDataSource that can interact with this universe object. |
java.io.InputStream |
getStream(java.lang.String name)
Get an InputStream that can read from a universe object dump. |
java.lang.Object |
getUnique(java.lang.String name)
Same as get, so just chain it. |
boolean |
isLocked(java.lang.String name)
Since objects can never be locked, this will always return false. |
void |
lock(java.lang.String name)
There is no locking. |
boolean |
lockIfNotLocked(java.lang.String name)
There is no locking, so return true, since the caller is always allowed to get an object. |
void |
put(java.lang.String name,
java.lang.Object o)
Save an object into the universe. |
java.io.OutputStream |
putStream(java.lang.String name)
Get an output stream to a universe object. |
void |
release(java.lang.String name)
Release a lock on an object. |
void |
remove(java.lang.String name)
Remove an object from the universe |
java.lang.String |
reserveUnique(java.lang.String base)
Reserve unique object universe. |
long |
size(java.lang.String name)
Report the size object from the universe |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UniverseLocal()
Method Detail |
public void genesis(UniverseProperties props) throws UniverseException
genesis
in interface Universe
props
- a universe properties set
UniverseException
UniverseProperties
public void close() throws UniverseException
close
in interface Universe
UniverseException
public java.lang.Object get(java.lang.String name) throws UniverseException
get
in interface Universe
name
- universe name
UniverseException
public java.lang.Object getUnique(java.lang.String name) throws UniverseException
getUnique
in interface Universe
name
- universe name
UniverseException
public java.lang.String reserveUnique(java.lang.String base) throws UniverseException
reserveUnique
in interface Universe
base
- base path for the object (including root object name)
UniverseException
- TODO make sure the object can actually be usedpublic java.io.InputStream getStream(java.lang.String name) throws UniverseException
getStream
in interface Universe
name
- universe name
UniverseException
public javax.activation.DataSource getDataSource(java.lang.String name) throws UniverseException
getDataSource
in interface Universe
name
- universe name
UniverseException
UniverseDataSource
public javax.activation.FileDataSource getFileDataSource(java.lang.String name) throws UniverseException
getFileDataSource
in interface Universe
name
- universe name
UniverseException
public void put(java.lang.String name, java.lang.Object o) throws UniverseException
put
in interface Universe
name
- universe nameo
- the object
UniverseException
public java.io.OutputStream putStream(java.lang.String name) throws UniverseException
putStream
in interface Universe
name
- universe name
UniverseException
public void lock(java.lang.String name) throws UniverseException
lock
in interface Universe
name
- universe name
UniverseException
public boolean lockIfNotLocked(java.lang.String name) throws UniverseException
lockIfNotLocked
in interface Universe
name
- universe name
UniverseException
public boolean isLocked(java.lang.String name) throws UniverseException
isLocked
in interface Universe
name
- universe name
UniverseException
public void release(java.lang.String name) throws UniverseException
release
in interface Universe
name
- universe name
UniverseException
public boolean exists(java.lang.String name) throws UniverseException
exists
in interface Universe
name
- universe name
UniverseException
public void flush(java.lang.String name) throws UniverseException
flush
in interface Universe
name
- universe name
UniverseException
public void discard(java.lang.String name) throws UniverseException
discard
in interface Universe
name
- universe name
UniverseException
public void remove(java.lang.String name) throws UniverseException
remove
in interface Universe
name
- universe name
UniverseException
public long size(java.lang.String name) throws UniverseException
size
in interface Universe
name
- universe name
UniverseException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |