|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Storage
Provides access to a persistent storage area.
Method Summary | ||
---|---|---|
void |
allowOpen() Allows the storage to be opened again. |
|
void |
close() Close the storage. |
|
void |
deleteNameSpace(java.lang.String name) Delete a namespace from this storage. |
|
NameSpace |
getNameSpace(java.lang.String name) Get a namespace from this storage. |
|
NameSpace |
getNameSpace(java.lang.String name, int type) Get a namespace from this storage. |
|
NameSpace |
getNameSpace(java.lang.String name, SecondaryKeyProvider provider) Get a namespace from this storage. |
|
java.lang.String |
getRelativePath(java.net.URL url) Get a path relative to this storage. |
|
java.net.URL |
getURL(java.lang.String relativePath) Get the URL for a relative path in the storage. |
|
boolean |
isOpen() Determine whether this storage is open. |
|
void |
lockClosed() Locks this storage closed. |
|
void |
open() Open the storage. |
|
|
runWhileClosed(java.util.concurrent.Callable<T> c) Run a task while the storage is closed. |
|
void |
runWhileClosed(java.lang.Runnable r) Run a task while the storage is closed. |
|
|
runWhileOpen(java.util.concurrent.Callable<T> c) Runs a task while the storage is open. |
|
void |
runWhileOpen(java.lang.Runnable r) Runs a task while the storage is open. |
Method Detail |
---|
java.lang.String getRelativePath(@NotNull
java.net.URL url)
url
- the URL to make relativejava.lang.IllegalStateException
- if the storage is not opengetURL(String)
java.net.URL getURL(@NotNull
java.lang.String relativePath)
relativePath
- the relative pathjava.lang.IllegalStateException
- if the storage is not opengetRelativePath(URL)
NameSpace getNameSpace(@NotNull
java.lang.String name)
name
- the name of the namespacejava.lang.IllegalStateException
- if the storage is not open
NameSpace getNameSpace(@NotNull
java.lang.String name,
int type)
name
- the name of the namespacetype
- the type of namespace, either NameSpace.NSTYPE_NORMAL
or NameSpace.NSTYPE_PACKED
java.lang.IllegalStateException
- if the storage is not openNameSpace getNameSpace(@NotNull java.lang.String name, @NotNull SecondaryKeyProvider provider)
name
- the name of the namespaceprovider
- the secondary key provider for the namespacejava.lang.IllegalStateException
- if the storage is not open
void deleteNameSpace(@NotNull
java.lang.String name)
name
- the name of the namespacejava.lang.IllegalStateException
- if the storage is not openboolean isOpen()
true
if the storage is open, false
otherwisevoid open()
close()
. It is strongly recommended that runWhileOpen(Runnable)
or runWhileOpen(Callable)
be used instead of this method.close()
, runWhileOpen(Runnable)
, runWhileOpen(Callable)
void close()
open()
. It is strongly recommended that runWhileOpen(Runnable)
or runWhileOpen(Callable)
be used instead of this method.open()
, runWhileOpen(Runnable)
, runWhileOpen(Callable)
void runWhileOpen(@NotNull
java.lang.Runnable r)
r
- the task to run
<T> T runWhileOpen(@NotNull
java.util.concurrent.Callable<T> c)
throws java.lang.Exception
T
- the type of value returned by the taskc
- the task to runjava.lang.Exception
- if the task throws an exceptionvoid lockClosed()
allowOpen()
is called. Great care must be taken when calling this method to avoid deadlock. This method should never be called while holding onto any other locks, such as Node locks. Doing so would cause deadlock with other threads that use the storage.
The calling thread must not call anything that requires the storage in between the calls to lockClosed
and allowOpen
. Doing so would cause deadlock.
The caller must ensure that for every call to this method, there is a corresponding call to allowOpen()
. Failure to do so would result in the storage being locked permanently, blocking all future operations that need to use it. Typically, a caller should use a try/finally
block to make sure that allowOpen()
is always called.
This method is useful for situations where the storage file must be deleted or replaced while JDeveloper is running.
It is strongly recommended that runWhileClosed(Runnable)
or runWhileClosed(Callable)
be used instead of this method.
allowOpen()
, runWhileClosed(Runnable)
, runWhileClosed(Callable)
void allowOpen()
lockClosed()
.
It is strongly recommended that runWhileClosed(Runnable)
or runWhileClosed(Callable)
be used instead of this method.
lockClosed()
, runWhileClosed(Runnable)
, runWhileClosed(Callable)
void runWhileClosed(@NotNull
java.lang.Runnable r)
r
- the task to run
<T> T runWhileClosed(@NotNull
java.util.concurrent.Callable<T> c)
throws java.lang.Exception
T
- the type of value returned by the taskc
- the task to runjava.lang.Exception
- if the task throws an exception
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |