|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
public 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)public 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)public 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)public javax.jmi.reflect.RefPackage getExtent(String name)
name
- name of the package extent to be returned
public String[] getExtentNames()
public javax.jmi.reflect.RefBaseObject getByMofId(String mofId)
mofId
- the MOF ID of the object to be returned
null
if no such object is foundpublic void 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.public 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)
.
public 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.
public void shutdown()
MDRManager.shutdownAll()
method.
Implementation of this method should do all the necessary clean-up actions,
such as flushing storage caches, etc.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |