|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.service.data.store.DataStoreProfileProducer
public class DataStoreProfileProducer
Implements a DataStore that reports profiling information about data
store operations under the name
"com.sun.sgs.impl.service.data.store.DataStore", implementing DataStore operations and transaction participant methods by delegating them
to another data store.
| Constructor Summary | |
|---|---|
DataStoreProfileProducer(DataStore dataStore,
ProfileCollector collector)
Creates an instance that delegates all DataStore and TransactionParticipant methods to dataStore. |
|
| Method Summary | |
|---|---|
void |
abort(Transaction txn)
Tells the participant to abort its involvement with the given transaction. |
void |
commit(Transaction txn)
Tells the participant to commit its state associated with the given transaction. |
long |
createObject(Transaction txn)
Reserves an object ID for a new object. |
long |
getBinding(Transaction txn,
String name)
Obtains the object ID bound to a name. |
int |
getClassId(Transaction txn,
byte[] classInfo)
Returns the class ID to represent classes with the specified class information. |
byte[] |
getClassInfo(Transaction txn,
int classId)
Returns the class information associated with the specified class ID. |
DataStore |
getDataStore()
Returns the DataStore that this instance delegates to. |
long |
getLocalNodeId()
Returns the node ID for the local node. |
byte[] |
getObject(Transaction txn,
long oid,
boolean forUpdate)
Obtains the data associated with an object ID. |
String |
getTypeName()
Returns the fully qualified type name of the participant. |
void |
markForUpdate(Transaction txn,
long oid)
Notifies the DataStore that an object is going to be
modified. |
String |
nextBoundName(Transaction txn,
String name)
Returns the next name after the specified name that has a binding, or null if there are no more bound names. |
long |
nextObjectId(Transaction txn,
long oid)
Returns the object ID for the next object after the object with the specified ID, or -1 if there are no more objects. |
boolean |
prepare(Transaction txn)
Tells the participant to prepare for commiting its state associated with the given transaction. |
void |
prepareAndCommit(Transaction txn)
Tells the participant to both prepare and commit its state associated with the given transaction. |
void |
ready()
Notifies the data store that services associated with the application have been successfully created. |
void |
removeBinding(Transaction txn,
String name)
Removes the binding for a name. |
void |
removeObject(Transaction txn,
long oid)
Removes the object with the specified object ID. |
void |
setBinding(Transaction txn,
String name,
long oid)
Binds an object ID to a name. |
void |
setBindingDescription(Transaction txn,
String name,
Object description)
Associates a description with a bound name, for use in describing name accesses. |
void |
setObject(Transaction txn,
long oid,
byte[] data)
Specifies data to associate with an object ID. |
void |
setObjectDescription(Transaction txn,
long oid,
Object description)
Associates a description with an object ID, for use in describing object accesses. |
void |
setObjects(Transaction txn,
long[] oids,
byte[][] dataArray)
Specifies data to associate with a series of object IDs. |
void |
shutdown()
Shuts down this data store. |
String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DataStoreProfileProducer(DataStore dataStore,
ProfileCollector collector)
DataStore and TransactionParticipant methods to dataStore.
dataStore - the object for delegating operationscollector - the object for collecting profile data
IllegalArgumentException - if dataStore does not
implement TransactionParticipant| Method Detail |
|---|
public void ready()
throws Exception
ready in interface DataStoreException - if an error occurspublic long getLocalNodeId()
getLocalNodeId in interface DataStorepublic long createObject(Transaction txn)
setObject or setObjects is
called. Aborting a transaction is also not required to unassign the ID
so long as other operations treat it as a non-existent object.
createObject in interface DataStoretxn - the transaction under which the operation should take place
public void markForUpdate(Transaction txn,
long oid)
DataStore that an object is going to be
modified. The implementation can use this information to obtain an
exclusive lock on the object in order to avoid contention when the
object is modified. This method does nothing if the object does not
exist.
markForUpdate in interface DataStoretxn - the transaction under which the operation should take placeoid - the object ID
public byte[] getObject(Transaction txn,
long oid,
boolean forUpdate)
forUpdate parameter is true, the caller is
stating its intention to modify the object. The implementation can use
that information to obtain an exclusive lock on the object in order
avoid contention when the object is modified.
getObject in interface DataStoretxn - the transaction under which the operation should take placeoid - the object IDforUpdate - whether the caller intends to modify the object
public void setObject(Transaction txn,
long oid,
byte[] data)
setObject in interface DataStoretxn - the transaction under which the operation should take placeoid - the object IDdata - the data
public void setObjects(Transaction txn,
long[] oids,
byte[][] dataArray)
setObjects in interface DataStoretxn - the transaction under which the operation should take placeoids - the object IDsdataArray - the associated data values
public void removeObject(Transaction txn,
long oid)
ObjectNotFoundException, although this behavior is
not guaranteed. The implementation is not required to check that the
object is an externally visible object rather than one used internally
by the implementation.
removeObject in interface DataStoretxn - the transaction under which the operation should take placeoid - the object ID
public long getBinding(Transaction txn,
String name)
getBinding in interface DataStoretxn - the transaction under which the operation should take placename - the name
public void setBinding(Transaction txn,
String name,
long oid)
setBinding in interface DataStoretxn - the transaction under which the operation should take placename - the nameoid - the object ID
public void removeBinding(Transaction txn,
String name)
removeBinding in interface DataStoretxn - the transaction under which the operation should take placename - the name
public String nextBoundName(Transaction txn,
String name)
null if there are no more bound names. If
name is null, then the search starts at the
beginning.
nextBoundName in interface DataStoretxn - the transaction under which the operation should take placename - the name to search after, or null to start
at the beginning
name, or
null if there are no more bound namespublic void shutdown()
shutdown in interface DataStore
public int getClassId(Transaction txn,
byte[] classInfo)
0. The
class information is the serialized form of the ObjectStreamClass instance that serialization uses to represent the
class.
getClassId in interface DataStoretxn - the transaction under which the operation should take placeclassInfo - the class information
public byte[] getClassInfo(Transaction txn,
int classId)
throws ClassInfoNotFoundException
ObjectStreamClass instance that serialization uses to represent the
class.
getClassInfo in interface DataStoretxn - the transaction under which the operation should take placeclassId - the class ID
ClassInfoNotFoundException - if the ID is not found
public long nextObjectId(Transaction txn,
long oid)
-1 if there are no more objects. If objectId is -1, then returns the ID of the first object. The
IDs returned by this method will not include ones for objects that have
already been removed, and may not include identifiers for objects
created after an iteration has begun. It is not an error for the object
associated with the specified identifier to have already been
removed. Applications should not assume that objects associated with the IDs returned by this method, but which cannot be reached by traversing object field references starting with an object associated with a name binding, will continue to be retained by the data store.
nextObjectId in interface DataStoretxn - the transaction under which the operation should take placeoid - the identifier of the object to search after, or
-1 to request the first object
oid, or -1 if there are no more
objects
public void setBindingDescription(Transaction txn,
String name,
Object description)
description should provide a meaningful toString method.
setBindingDescription in interface DataStoretxn - the transaction under which the operation should take placename - the namedescription - the descriptionAccessReporter.setObjectDescription
public void setObjectDescription(Transaction txn,
long oid,
Object description)
description should provide a meaningful toString method.
setObjectDescription in interface DataStoretxn - the transaction under which the operation should take placeoid - the object IDdescription - the descriptionAccessReporter.setObjectDescription
public boolean prepare(Transaction txn)
throws Exception
boolean
flag stating whether the prepared state is read-only, meaning that no
external state is modified by this participant. If this method
returns true, then neither commit nor abort
will be called.
If this method throws an exception, then the preparation failed, and the transaction will be aborted. If this method completes successfully, then the participant is required to be able to commit the transaction without failure.
prepare in interface TransactionParticipanttxn - the Transaction object
Exception - if there are any failures in preparing
IllegalStateException - if this participant has already been
prepared, committed, or aborted, or
if this participant is not participating
in the given transactionpublic void commit(Transaction txn)
commit in interface TransactionParticipanttxn - the Transaction object
public void prepareAndCommit(Transaction txn)
throws Exception
prepareAndCommit in interface TransactionParticipanttxn - the Transaction object
Exception - if there are any failures in preparing
IllegalStateException - if this participant has already been
prepared, committed, or aborted, or
if this participant is not participating
in the given transactionpublic void abort(Transaction txn)
abort in interface TransactionParticipanttxn - the Transaction objectpublic String getTypeName()
Service, this
will typically be the Service's type name.
getTypeName in interface TransactionParticipantpublic String toString()
toString in class Objectpublic DataStore getDataStore()
DataStore that this instance delegates to.
DataStore that this instance delegates to
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||