|
org.netbeans.api.mdr/1 1.4.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MDRepository
Interface for accessing content of a metadata repository.
Method Summary | |
---|---|
void |
beginTrans(boolean writeAccess)
Starts a new transaction. |
javax.jmi.reflect.RefPackage |
createExtent(String substName)
Instantiates MOF Model package. |
javax.jmi.reflect.RefPackage |
createExtent(String substName,
javax.jmi.reflect.RefObject metaPackage)
Instantiates given package. |
javax.jmi.reflect.RefPackage |
createExtent(String substName,
javax.jmi.reflect.RefObject metaPackage,
javax.jmi.reflect.RefPackage[] existingInstances)
Instantiates given package. |
void |
endTrans()
Ends transaction started by beginTrans call. |
void |
endTrans(boolean rollback)
Ends transaction started by beginTrans call. |
javax.jmi.reflect.RefBaseObject |
getByMofId(String mofId)
Returns the object with the given MOF ID. |
javax.jmi.reflect.RefPackage |
getExtent(String name)
Returns reference to a package extent of a given name. |
String[] |
getExtentNames()
Returns names for all named package extents in the repository. |
void |
shutdown()
Shuts down the repository. |
Methods inherited from interface org.netbeans.api.mdr.events.MDRChangeSource |
---|
addListener, addListener, removeListener, removeListener |
Method Detail |
---|
javax.jmi.reflect.RefPackage createExtent(String substName) throws CreationFailedException
substName
- name (unique within the repository) for the new MOF package extent
CreationFailedException
- instantiation of the package failed (e.g. if an extent with a given name already exists)javax.jmi.reflect.RefPackage createExtent(String substName, javax.jmi.reflect.RefObject metaPackage) throws CreationFailedException
substName
- name (unique within the repository) for the new package extentmetaPackage
- reference to the package that should be instantiated
CreationFailedException
- instantiation of the package failed (e.g. if an extent with a given name already exists)javax.jmi.reflect.RefPackage createExtent(String substName, javax.jmi.reflect.RefObject metaPackage, javax.jmi.reflect.RefPackage[] existingInstances) throws CreationFailedException
substName
- name (unique within the repository) for the new package extentmetaPackage
- reference to the package that should be instantiatedexistingInstances
- existing package extents that will be used instead of creating a new extent if a package is clustered
CreationFailedException
- instantiation of the package failed (e.g. if an extent with a given name already exists)javax.jmi.reflect.RefPackage getExtent(String name)
name
- name of the package extent to be returned
String[] getExtentNames()
javax.jmi.reflect.RefBaseObject getByMofId(String mofId)
mofId
- the MOF ID of the object to be returned
null
if no such object is foundvoid beginTrans(boolean writeAccess)
beginTrans
and endTrans
calls
to avoid autocommiting (which may be slow) after each JMI operation.
Transactions can be nested however real nested transaction commit/rollback
does not need to be implemented - implementation can commit/rollback whole transaction
after the outermost endTrans
call depending on whether any nested
transaction failed.
During each transaction it is guaranteed that no other thread can modify the metadata.
Important:This call locks the repository and the lock is held till the
transaction is ended by a call to endTrans
. To make sure there is
a corresponding endTrans
call to each beginTrans
call
use the try-finally
construct:
beginTrans(false);
try {
// set of JMI calls
} finally {
endTrans();
}
writeAccess
- true
indicates that the transaction will be
modifying the repository. false
means the transaction is
read-only (it will not be allowed to modify any data). Transactions with
write access cannot be nested into read-only transactions.void endTrans()
beginTrans
call. If the transaction
modified some data, this call will attemp to commit it.
This method has the same effect as calling endTrans(false)
.
void endTrans(boolean rollback)
beginTrans
call.
Result of this call depends on whether it is nested in another
beginTrans
- endTrans
pair or not.
If this call is nested and value of rollback
parameter is
false
, it will not affect the result of the endTrans
call corresponding to the outermost call to beginTrans
. However
if true
is passed, the whole transaction will be rolled back by
the last (i.e. outermost) endTrans
call (no matter what will be the
value of rollback
parameter for this last call).
If this call is not nested (i.e. it is outermost) the whole transaction is
commited if false
was passed to this call and all the nested
endTrans
calls. Otherwise (if true
was passed to this
call or any nested endTrans
call) the transaction is rolled back.
void shutdown()
MDRManager.shutdownAll()
method.
Implementation of this method should do all the necessary clean-up actions,
such as flushing storage caches, etc.
|
org.netbeans.api.mdr/1 1.4.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |