|
||||||||||
| 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.net.DataStoreServerImpl
public class DataStoreServerImpl
Provides an implementation of DataStoreServer, using the DataStoreImpl class to support the same database format which that class
supports.
In addition to those supported by the DataStoreImpl class, the
constructor supports the following properties:
com.sun.sgs.impl.service.data.store.net.max.txn.timeout
600000
com.sun.sgs.impl.service.data.store.net.server.reap.delay
500
com.sun.sgs.impl.service.data.store.net.server.port
44530
0 and no greater than
65535. If the value specified is 0, then an anonymous
port will be chosen. The value chosen will be logged, and can also be
accessed with the getPort method.
In addition to any logging performed by the DataStoreImpl class,
this class uses the Logger named com.sun.sgs.impl.service.data.store.net.server to log
information at the following levels:
INFO - actual port if anonymous port was requested
CONFIG - server properties
FINE - allocation transaction IDs, problems
unexporting the server, reaping expired transactions, problems
the specified transaction ID
FINER - create transactions
| Field Summary | |
|---|---|
(package private) static LoggerWrapper |
logger
The logger for this class. |
(package private) com.sun.sgs.impl.service.data.store.net.DataStoreServerImpl.TxnTable<?> |
txnTable
Stores information about transactions. |
| Constructor Summary | |
|---|---|
DataStoreServerImpl(Properties properties,
ComponentRegistry systemRegistry,
TransactionProxy txnProxy)
Creates an instance of this class configured with the specified properties. |
|
| Method Summary | |
|---|---|
void |
abort(long tid)
Aborts the transaction. |
void |
commit(long tid)
Commits the transaction. |
long |
createObject(long tid)
Reserves an object ID for a new object. |
long |
createTransaction(long timeout)
Creates a new transaction, and returns the associated ID, which will not be negative. |
BindingValue |
getBinding(long tid,
String name)
Obtains the object ID bound to a name. |
int |
getClassId(long tid,
byte[] classInfo)
Returns the class ID to represent classes with the specified class information. |
byte[] |
getClassInfo(long tid,
int classId)
Returns the class information associated with the specified class ID. |
byte[] |
getObject(long tid,
long oid,
boolean forUpdate)
Obtains the data associated with an object ID. |
int |
getPort()
Returns the port being used for the server. |
void |
markForUpdate(long tid,
long oid)
Notifies the server that an object is going to be modified. |
long |
newNodeId()
Returns a new node ID for use with a newly started node. |
String |
nextBoundName(long tid,
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(long tid,
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(long tid)
Prepares the transaction to commit. |
void |
prepareAndCommit(long tid)
Prepares and commits the transaction. |
(package private) void |
reapExpiredTransactions()
Find transactions that are expired and not in use, and tell the data store to abort them. |
BindingValue |
removeBinding(long tid,
String name)
Removes the binding for a name. |
void |
removeObject(long tid,
long oid)
Removes the object with the specified object ID. |
BindingValue |
setBinding(long tid,
String name,
long oid)
Binds an object ID to a name. |
void |
setObject(long tid,
long oid,
byte[] data)
Specifies data to associate with an object ID. |
void |
setObjects(long tid,
long[] oids,
byte[][] dataArray)
Specifies data to associate with a series of object IDs. |
void |
shutdown()
Shuts down this server. |
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 |
| Field Detail |
|---|
static final LoggerWrapper logger
com.sun.sgs.impl.service.data.store.net.DataStoreServerImpl.TxnTable<?> txnTable
| Constructor Detail |
|---|
public DataStoreServerImpl(Properties properties,
ComponentRegistry systemRegistry,
TransactionProxy txnProxy)
throws IOException
class documentation for
a list of supported properties.
properties - the properties for configuring this instancesystemRegistry - the registry of available system componentstxnProxy - the transaction proxy
DataStoreException - if there is a problem with the database
IllegalArgumentException - if the value of the com.sun.sgs.impl.service.data.store.net.DataStoreServerImpl.port
property is less than 0 or greater than 65535,
or if thrown by the DataStoreImpl constructor
IOException - if a network problem occurs| Method Detail |
|---|
public long newNodeId()
newNodeId in interface DataStoreServerpublic long createObject(long tid)
setObject is called. Aborting a transaction is also
not required to unassign any of the IDs so long as other operations
treat them as non-existent objects.
createObject in interface DataStoreServertid - the ID of the transaction under which the operation should
take place
public void markForUpdate(long tid,
long oid)
markForUpdate in interface DataStoreServertid - the ID of the transaction under which the operation should
take placeoid - the object ID
public byte[] getObject(long tid,
long oid,
boolean forUpdate)
forUpdate
parameter is true, the caller is stating its intention to modify
the object.
getObject in interface DataStoreServertid - the ID of the transaction under which the operation should
take placeoid - the object IDforUpdate - whether the caller intends to modify the object
public void setObject(long tid,
long oid,
byte[] data)
setObject in interface DataStoreServertid - the ID of the transaction under which the operation should
take placeoid - the object IDdata - the data
public void setObjects(long tid,
long[] oids,
byte[][] dataArray)
setObjects in interface DataStoreServertid - the ID of the transaction under which the operation should
take placeoids - the object IDsdataArray - the associated data values
public void removeObject(long tid,
long oid)
removeObject in interface DataStoreServertid - the ID of the transaction under which the operation should
take placeoid - the object ID
public BindingValue getBinding(long tid,
String name)
null. If the name is not bound, the return value contains an
object ID of -1 and the next name found, which may be null.
getBinding in interface DataStoreServertid - the ID of the transaction under which the operation should
take placename - the name
public BindingValue setBinding(long tid,
String name,
long oid)
null. If the name is not bound, the return value contains an object ID
of -1 and the next name found, which may be null.
setBinding in interface DataStoreServertid - the ID of the transaction under which the operation should
take placename - the nameoid - the object ID
public BindingValue removeBinding(long tid,
String name)
-1. In all cases, the return value contains the next name
found, which may be null.
removeBinding in interface DataStoreServertid - the ID of the transaction under which the operation should
take placename - the name
public String nextBoundName(long tid,
String name)
null if there are no more bound names. If name is
null, then the search starts at the beginning.
nextBoundName in interface DataStoreServertid - the ID of 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 names
public int getClassId(long tid,
byte[] classInfo)
0. The
class information is the serialized form of the ObjectStreamClass instance that serialization uses to represent the
class.
getClassId in interface DataStoreServertid - the ID of the transaction under which the operation should
take placeclassInfo - the class information
public byte[] getClassInfo(long tid,
int classId)
throws ClassInfoNotFoundException
ObjectStreamClass instance that serialization uses to represent the
class.
getClassInfo in interface DataStoreServertid - the ID of the transaction under which the operation should
take placeclassId - the class ID
ClassInfoNotFoundException - if the ID is not found
public long nextObjectId(long tid,
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.
nextObjectId in interface DataStoreServertid - the ID of the transactionoid - the identifier of the object to search after, or
-1 to request the first object
oid, or -1 if there are no more
objectspublic long createTransaction(long timeout)
createTransaction in interface DataStoreServertimeout - the number of milliseconds the resulting transaction
should be allowed to run before it times out
public boolean prepare(long tid)
true when no state
was modified, and neither commit or abort should be
called.
prepare in interface DataStoreServertid - the ID of the transaction
true if this participant is read-only, otherwise
falsepublic void commit(long tid)
commit in interface DataStoreServertid - the ID of the transactionpublic void prepareAndCommit(long tid)
prepareAndCommit in interface DataStoreServertid - the ID of the transactionpublic void abort(long tid)
abort in interface DataStoreServertid - the ID of the transactionpublic void shutdown()
public int getPort()
public String toString()
toString in class Objectvoid reapExpiredTransactions()
|
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 | |||||||||