|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase
org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase
A DistributedVirtualDatabase is a virtual database hosted
by several controllers. Communication between the controllers is achieved
with reliable multicast provided by Javagroups.
| Field Summary | |
private org.jgroups.JChannel |
channel
|
private org.jgroups.blocks.MessageDispatcher |
dispatcher
|
| Fields inherited from class org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase |
authenticationManager, backends, currentNbOfThreads, groupName, logger, maxNbOfConnections, maxNbOfThreads, maxThreadIdleTime, metadata, minNbOfThreads, name, poolConnectionThreads, requestLogger, requestManager, rwLock |
| Constructor Summary | |
DistributedVirtualDatabase(java.lang.String name,
java.lang.String groupName,
int maxConnections,
boolean pool,
int minThreads,
int maxThreads,
long maxThreadIdleTime)
Creates a new DistributedVirtualDatabase instance. |
|
| Method Summary | |
void |
block()
|
boolean |
equals(java.lang.Object other)
Two virtual databases are equal if they have the same name, login and password. |
int |
execWriteRequest(AbstractWriteRequest request)
Performs a write request and returns the number of rows affected. |
java.sql.ResultSet |
execWriteRequestWithKeys(AbstractWriteRequest request)
Performs a write request and returns the auto generated keys. |
java.lang.String |
getInformation()
Get information about this virtual database |
byte[] |
getState()
|
java.lang.Object |
handle(org.jgroups.Message msg)
|
boolean |
isDistributed()
Is this virtual database distributed ? |
void |
joinGroup(java.lang.String groupName)
Makes this virtual database join a virtual database group. |
void |
receive(org.jgroups.Message msg)
|
void |
setRequestManager(RequestManager requestManager)
Sets a new distributed request manager for this database. |
void |
setState(byte[] state)
|
void |
suspect(org.jgroups.Address suspectedMember)
|
void |
viewAccepted(org.jgroups.View newView)
|
void |
writeNotify(AbstractWriteRequest request)
Notifies the cache that this write request has been issued, so that cache coherency can be maintained. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private org.jgroups.JChannel channel
private org.jgroups.blocks.MessageDispatcher dispatcher
| Constructor Detail |
public DistributedVirtualDatabase(java.lang.String name,
java.lang.String groupName,
int maxConnections,
boolean pool,
int minThreads,
int maxThreads,
long maxThreadIdleTime)
throws CJDBCException
DistributedVirtualDatabase instance.
name - the virtual database namegroupName - the virtual database group namemaxConnections - maximum number of concurrent connections.pool - should we use a pool of threads for handling connections?minThreads - minimum number of threads in the poolmaxThreads - maximum number of threads in the poolmaxThreadIdleTime - maximum time a thread can remain idle before being removed from the pool.
CJDBCException - in case of group communication-related error| Method Detail |
public void setRequestManager(RequestManager requestManager)
setRequestManager in class VirtualDatabaserequestManager - the new request manager.
public void joinGroup(java.lang.String groupName)
throws java.lang.Exception
groupName - name of the virtual database group
java.lang.Exception - if an error occurspublic java.lang.Object handle(org.jgroups.Message msg)
handle in interface org.jgroups.blocks.RequestHandlerRequestHandler.handle(org.jgroups.Message)public byte[] getState()
getState in interface org.jgroups.MessageListenerMessageListener.getState()public void receive(org.jgroups.Message msg)
receive in interface org.jgroups.MessageListenerMessageListener.receive(org.jgroups.Message)public void setState(byte[] state)
setState in interface org.jgroups.MessageListenerMessageListener.setState(byte[])public void block()
block in interface org.jgroups.MembershipListenerMembershipListener.block()public void suspect(org.jgroups.Address suspectedMember)
suspect in interface org.jgroups.MembershipListenerMembershipListener.suspect(org.jgroups.Address)public void viewAccepted(org.jgroups.View newView)
viewAccepted in interface org.jgroups.MembershipListenerMembershipListener.viewAccepted(org.jgroups.View)
public int execWriteRequest(AbstractWriteRequest request)
throws java.sql.SQLException
VirtualDatabase
execWriteRequest in class VirtualDatabaserequest - the request to execute
java.sql.SQLException - if the request failsVirtualDatabase.execWriteRequest(org.objectweb.cjdbc.sql.AbstractWriteRequest)
public java.sql.ResultSet execWriteRequestWithKeys(AbstractWriteRequest request)
throws java.sql.SQLException
VirtualDatabase
execWriteRequestWithKeys in class VirtualDatabaserequest - the request to execute
java.sql.SQLException - if the request failsVirtualDatabase.execWriteRequestWithKeys(org.objectweb.cjdbc.sql.AbstractWriteRequest)
public void writeNotify(AbstractWriteRequest request)
throws java.sql.SQLException
request - an AbstractRequest value
java.sql.SQLException - if an error occurspublic boolean isDistributed()
isDistributed in class VirtualDatabasepublic boolean equals(java.lang.Object other)
equals in class VirtualDatabaseother - an object
boolean valuepublic java.lang.String getInformation()
getInformation in class VirtualDatabaseString containing information
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||