|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.management.StandardMBean
org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
org.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.
Nested Class Summary |
Nested classes inherited from class javax.management.StandardMBean |
|
Field Summary | |
private java.util.ArrayList |
allMemberButUs
|
private java.util.HashMap |
backendRecoveryPolicy
backendName -> BackendRecoveryPolicy |
private java.util.Hashtable |
backendsPerController
JGroups Address -> ArrayList of DatabaseBackend |
private org.objectweb.tribe.channel.ReliableGroupChannelWithGms |
channel
JGroups channel |
private java.util.Hashtable |
controllersMap
Controller name mapping: jgroup Addr --> controller Name |
private org.objectweb.tribe.common.Group |
currentGroup
|
private java.lang.String |
groupName
Group name |
private org.objectweb.tribe.adapters.MulticastRequestAdapter |
multicastRequestAdapter
MessageDispatcher to communicate with the group |
Fields inherited from class org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase |
authenticationManager, backends, CHECK_BACKEND_DISABLE, CHECK_BACKEND_ENABLE, controller, currentNbOfThreads, logger, maxNbOfConnections, maxNbOfThreads, maxThreadIdleTime, metadata, minNbOfThreads, name, NO_CHECK_BACKEND, poolConnectionThreads, requestLogger, requestManager, rwLock |
Fields inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean |
|
Fields inherited from class javax.management.StandardMBean |
|
Fields inherited from interface org.objectweb.cjdbc.common.xml.XmlComponent |
DOCTYPE_DB, XML_VERSION |
Constructor Summary | |
DistributedVirtualDatabase(Controller controller,
java.lang.String name,
java.lang.String groupName,
int maxConnections,
boolean pool,
int minThreads,
int maxThreads,
long maxThreadIdleTime,
int sqlShortFormLength,
AbstractBlobFilter blobFilter)
Creates a new DistributedVirtualDatabase instance. |
Method Summary | |
void |
addBackend(DatabaseBackend db)
Add a backend to this virtual database. |
void |
addBackendRecoveryPolicy(BackendRecoveryPolicy policy)
Add a BackendRecoveryPolicy |
private void |
broadcastBackendInformation(java.util.ArrayList dest)
Broadcast backend information among controllers. |
private boolean |
checkConfigurationCompatibility(java.util.ArrayList dest)
Send the configuration of this controller to remote controller. |
BackendInfo |
createBackendInfo(DatabaseBackend backend,
boolean useXml)
Create backend information object from a DatabaseBackend object This will get only static information |
boolean |
equals(java.lang.Object other)
Two virtual databases are equal if they have the same name, login and password. |
protected void |
finalize()
Disconnect the channel and close it. |
java.util.ArrayList |
getAllMemberButUs()
Returns the list of all members in the group except us. |
java.util.HashMap |
getBackendRecoveryPolicy()
Get the backend distribution policies |
java.util.ArrayList |
getBackendsInfo(java.util.ArrayList backendsObject)
We have to convert the backends list from an array of DatabaseBackend object to an ArrayList of
BackendInfo objects. |
void |
getBackendStatus()
Get the status of all remote controllers |
org.objectweb.tribe.channel.ReliableGroupChannelWithGms |
getChannel()
Get the JGroups' channel used for group communications |
java.lang.String |
getControllerName()
Returns the controllerName value. |
org.objectweb.tribe.common.Group |
getCurrentGroup()
Returns the currentGroup value. |
protected java.lang.String |
getDistributionXml()
Get the XML dump of the Distribution element if any. |
java.lang.String |
getGroupName()
Returns the group name this virtual database belongs to. |
org.objectweb.tribe.adapters.MulticastRequestAdapter |
getMulticastRequestAdapter()
Return the group communication multicast request adapter. |
java.io.Serializable |
handleMessageMultiThreaded(java.io.Serializable msg,
org.objectweb.tribe.common.Member sender,
java.lang.Object handleMessageSingleThreadedResult)
|
java.lang.Object |
handleMessageSingleThreaded(java.io.Serializable msg,
org.objectweb.tribe.common.Member sender)
This method handle the scheduling part of the queries to be sure that the query is scheduled in total order before letting other queries to execute. |
boolean |
isCompatibleBackend(BackendInfo backend)
Check if the given backend definition is compatible with the backend definitions of this distributed virtual database. |
boolean |
isDistributed()
Is this virtual database distributed ? |
private boolean |
isLocalSender(org.objectweb.tribe.common.Member sender)
Returns true if the given member is ourselves. |
void |
joinGroup()
Makes this virtual database join a virtual database group. |
void |
quitChannel()
Quit the jgroups channel |
void |
receive(java.io.Serializable msg)
|
void |
removeBackend(java.lang.String backend)
Remove a backend from the virtual database list. |
void |
setAuthenticationManager(AuthenticationManager authenticationManager)
(non-Javadoc) |
void |
setGroupName(java.lang.String groupName)
Sets the group name used by the controllers hosting this virtual database. |
void |
setRequestManager(RequestManager requestManager)
Sets a new distributed request manager for this database. |
void |
transferBackend(java.lang.String backend,
java.lang.String controllerDestination)
Transfer the backend to the destinated controller. |
void |
viewAccepted(org.objectweb.tribe.common.Group newGroup)
|
java.lang.String[] |
viewControllerList()
Return the list of controllers defining this virtual database. |
java.util.Hashtable |
viewGroupBackends()
Returns a mapping of controller jmx names with their backends Note the method is only useful in distributed environment |
Methods inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean |
addNotificationListener, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getNotificationInfo, getParameterName, getParameterName, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class javax.management.StandardMBean |
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, invoke, setAttribute, setAttributes, setImplementation |
Methods inherited from class java.lang.Object |
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String groupName
private java.util.Hashtable controllersMap
private java.util.HashMap backendRecoveryPolicy
BackendRecoveryPolicy
private java.util.Hashtable backendsPerController
ArrayList
of DatabaseBackend
private org.objectweb.tribe.channel.ReliableGroupChannelWithGms channel
private org.objectweb.tribe.adapters.MulticastRequestAdapter multicastRequestAdapter
private org.objectweb.tribe.common.Group currentGroup
private java.util.ArrayList allMemberButUs
Constructor Detail |
public DistributedVirtualDatabase(Controller controller, java.lang.String name, java.lang.String groupName, int maxConnections, boolean pool, int minThreads, int maxThreads, long maxThreadIdleTime, int sqlShortFormLength, AbstractBlobFilter blobFilter) throws javax.management.NotCompliantMBeanException, JmxException
DistributedVirtualDatabase
instance.
controller
- the controller we belong toname
- 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.sqlShortFormLength
- maximum number of characters of an SQL statement
to diplay in traces or exceptionsblobFilter
- encoding method for blobs
javax.management.NotCompliantMBeanException
- in case the bean does not comply with
jmx
JmxException
- the bean could not be registeedMethod Detail |
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
Object.finalize()
public void addBackend(DatabaseBackend db) throws VirtualDatabaseException
VirtualDatabase
addBackend
in class VirtualDatabase
db
- the database backend to add
VirtualDatabaseException
- if an error occursVirtualDatabase.addBackend(org.objectweb.cjdbc.controller.backend.DatabaseBackend)
public void quitChannel() throws org.objectweb.tribe.exceptions.ChannelException, org.objectweb.tribe.exceptions.NotConnectedException
org.objectweb.tribe.exceptions.NotConnectedException
- if the channel is not connected
org.objectweb.tribe.exceptions.ChannelException
- if an error occured while closing the channelpublic java.lang.String getControllerName()
public java.lang.String getGroupName()
String
value. Returns null
if this
virtual database is standalonepublic void setGroupName(java.lang.String groupName)
groupName
- the group name to setpublic void addBackendRecoveryPolicy(BackendRecoveryPolicy policy)
policy
- the policy to addpublic void setRequestManager(RequestManager requestManager)
setRequestManager
in class VirtualDatabase
requestManager
- the new request manager.public void joinGroup() throws java.lang.Exception
java.lang.Exception
- if an error occurspublic org.objectweb.tribe.channel.ReliableGroupChannelWithGms getChannel()
JChannel
public org.objectweb.tribe.adapters.MulticastRequestAdapter getMulticastRequestAdapter()
public org.objectweb.tribe.common.Group getCurrentGroup()
public java.util.ArrayList getAllMemberButUs()
private boolean checkConfigurationCompatibility(java.util.ArrayList dest)
dest
- List of Address
to send the message to
private void broadcastBackendInformation(java.util.ArrayList dest) throws org.objectweb.tribe.exceptions.TimeoutException, org.objectweb.tribe.exceptions.ChannelException, org.objectweb.tribe.exceptions.NotConnectedException
dest
- List of Address
to send the message to
org.objectweb.tribe.exceptions.NotConnectedException
- if the channel is not connected
org.objectweb.tribe.exceptions.ChannelException
- if the channel reported an error
org.objectweb.tribe.exceptions.TimeoutException
- if a timeout occuredpublic boolean isCompatibleBackend(BackendInfo backend) throws VirtualDatabaseException
backend
- the backend to check
VirtualDatabaseException
- if locking the local backend list failspublic void receive(java.io.Serializable msg)
receive
in interface org.objectweb.tribe.messages.MessageListener
MessageListener.receive(java.io.Serializable)
public java.lang.Object handleMessageSingleThreaded(java.io.Serializable msg, org.objectweb.tribe.common.Member sender)
handleMessageSingleThreaded
in interface org.objectweb.tribe.adapters.MulticastRequestListener
MulticastRequestListener.handleMessageSingleThreaded(java.io.Serializable,
org.objectweb.tribe.common.Member)
public java.io.Serializable handleMessageMultiThreaded(java.io.Serializable msg, org.objectweb.tribe.common.Member sender, java.lang.Object handleMessageSingleThreadedResult)
handleMessageMultiThreaded
in interface org.objectweb.tribe.adapters.MulticastRequestListener
MulticastRequestListener.handleMessageMultiThreaded(Serializable,
Member, Object)
private boolean isLocalSender(org.objectweb.tribe.common.Member sender)
sender
- the sender
public void getBackendStatus() throws org.objectweb.tribe.exceptions.TimeoutException, org.objectweb.tribe.exceptions.ChannelException, org.objectweb.tribe.exceptions.NotConnectedException
org.objectweb.tribe.exceptions.NotConnectedException
- if the channel is not connected
org.objectweb.tribe.exceptions.ChannelException
- if the channel reported an error
org.objectweb.tribe.exceptions.TimeoutException
- if a timeout occuredpublic void viewAccepted(org.objectweb.tribe.common.Group newGroup)
MembershipListener.viewAccepted(org.jgroups.View)
public java.util.HashMap getBackendRecoveryPolicy()
public boolean isDistributed()
isDistributed
in interface VirtualDatabaseMBean
isDistributed
in class VirtualDatabase
public boolean equals(java.lang.Object other)
equals
in class VirtualDatabase
other
- an object
boolean
valueprotected java.lang.String getDistributionXml()
getDistributionXml
in class VirtualDatabase
public java.lang.String[] viewControllerList()
VirtualDatabaseMBean
viewOwningController
otherwise returns an array of
controller configuring this DistributedVirtualDatabase
viewControllerList
in interface VirtualDatabaseMBean
viewControllerList
in class VirtualDatabase
VirtualDatabaseMBean.viewControllerList()
public void setAuthenticationManager(AuthenticationManager authenticationManager)
setAuthenticationManager
in class VirtualDatabase
authenticationManager
- the AuthenticationManager
to
setVirtualDatabase.setAuthenticationManager(org.objectweb.cjdbc.controller.authentication.AuthenticationManager)
public java.util.Hashtable viewGroupBackends() throws VirtualDatabaseException
VirtualDatabaseMBean
viewGroupBackends
in interface VirtualDatabaseMBean
viewGroupBackends
in class VirtualDatabase
VirtualDatabaseException
VirtualDatabaseMBean.viewGroupBackends()
public java.util.ArrayList getBackendsInfo(java.util.ArrayList backendsObject)
DatabaseBackend
object to an ArrayList of
BackendInfo
objects. The DatabaseBackend objects cannot be
serialized because they are used as MBean and notification emitters, so we
want to extract the info out of them.
backendsObject
- the list of DatabaseBackend object
BackendInfo
public BackendInfo createBackendInfo(DatabaseBackend backend, boolean useXml)
backend
- the DatabaseBackend
object to get info fromuseXml
- should we use xml for extensive backend description
BackendInfo
public void removeBackend(java.lang.String backend) throws VirtualDatabaseException
VirtualDatabaseMBean
removeBackend
in interface VirtualDatabaseMBean
removeBackend
in class VirtualDatabase
VirtualDatabaseException
VirtualDatabaseMBean.removeBackend(java.lang.String)
public void transferBackend(java.lang.String backend, java.lang.String controllerDestination) throws VirtualDatabaseException
VirtualDatabaseMBean
transferBackend
in interface VirtualDatabaseMBean
transferBackend
in class VirtualDatabase
VirtualDatabaseException
VirtualDatabaseMBean.transferBackend(java.lang.String,
java.lang.String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |