|
|||||||||||
| 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.loadbalancer.AbstractLoadBalancer
org.objectweb.cjdbc.controller.loadbalancer.singledb.SingleDB
Single Database request load balancer.
The requests coming from the request controller are directly forwarded to the single backend. This load balancer does not support multiple backends.
| Nested Class Summary |
| Nested classes inherited from class javax.management.StandardMBean |
|
| Field Summary | |
private DatabaseBackend |
backend
|
private static Trace |
logger
|
| Fields inherited from class org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer |
macroHandler, parsingGranularity, raidbLevel, vdb |
| 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 | |
SingleDB(VirtualDatabase vdb)
Creates a new SingleDB instance. |
|
| Method Summary | |
void |
begin(TransactionMarkerMetaData tm)
Begins a new transaction. |
void |
commit(TransactionMarkerMetaData tm)
Commits a transaction. |
void |
disableBackend(DatabaseBackend db)
Disables a backend that was previously enabled. |
void |
enableBackend(DatabaseBackend db,
boolean writeEnabled)
Enables a backend that was previously disabled. |
ControllerResultSet |
execReadOnlyReadStoredProcedure(StoredProcedure proc,
MetadataCache metadataCache)
Call a read-only stored procedure that returns a ResultSet. |
ControllerResultSet |
execReadRequest(SelectRequest request,
MetadataCache metadataCache)
Performs a read request. |
ControllerResultSet |
execReadStoredProcedure(StoredProcedure proc,
MetadataCache metadataCache)
Call a stored procedure that returns a ResultSet. |
int |
execWriteRequest(AbstractWriteRequest request)
Performs a write request on the backend. |
ControllerResultSet |
execWriteRequestWithKeys(AbstractWriteRequest request,
MetadataCache metadataCache)
Perform a write request and return a ResultSet containing the auto generated keys. |
int |
execWriteStoredProcedure(StoredProcedure proc)
Call a stored procedure that performs an update. |
java.lang.String |
getInformation()
Gets information about the request load balancer |
java.lang.String |
getXmlImpl()
Get information about the Request Load Balancer in xml |
void |
rollback(TransactionMarkerMetaData tm)
Rollbacks a transaction. |
void |
setWeight(java.lang.String name,
int w)
Associate a weight to a backend identified by its logical name. |
| Methods inherited from class org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer |
executeReadStoredProcedureOnBackend, executeSelectRequestOnBackend, executeUpdateRequestOnBackend, executeUpdateRequestOnBackendWithKeys, executeWriteStoredProcedureOnBackend, getAssociatedString, getConnectionAndBeginTransaction, getParsingGranularity, getRAIDbLevel, getXml, handleMacros, setMacroHandler, setParsingGranularity, setRAIDbLevel |
| 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private DatabaseBackend backend
private static Trace logger
| Constructor Detail |
public SingleDB(VirtualDatabase vdb)
throws java.lang.Exception
SingleDB instance.
vdb - the VirtualDatabase this load balancer belongs to
java.lang.Exception - if there is not exactly one backend attached to the
VirtualDatabase| Method Detail |
public ControllerResultSet execReadRequest(SelectRequest request,
MetadataCache metadataCache)
throws java.sql.SQLException
execReadRequest in class AbstractLoadBalancerrequest - an SelectRequestmetadataCache - MetadataCache (null if none)
java.sql.ResultSet
java.sql.SQLException - if an error occurs
public int execWriteRequest(AbstractWriteRequest request)
throws java.sql.SQLException
execWriteRequest in class AbstractLoadBalancerrequest - an AbstractWriteRequest
java.sql.SQLException - if an error occurs
public ControllerResultSet execWriteRequestWithKeys(AbstractWriteRequest request,
MetadataCache metadataCache)
throws java.sql.SQLException
AbstractLoadBalancer
execWriteRequestWithKeys in class AbstractLoadBalancerrequest - an AbstractWriteRequestmetadataCache - MetadataCache (null if none)
java.sql.SQLException - if an error occursAbstractLoadBalancer.execWriteRequestWithKeys(AbstractWriteRequest,
MetadataCache)
public ControllerResultSet execReadOnlyReadStoredProcedure(StoredProcedure proc,
MetadataCache metadataCache)
throws java.sql.SQLException
AbstractLoadBalancer
execReadOnlyReadStoredProcedure in class AbstractLoadBalancerproc - the stored procedure callmetadataCache - MetadataCache (null if none)
ControllerResultSet value
java.sql.SQLException - if an error occursAbstractLoadBalancer.execReadOnlyReadStoredProcedure(StoredProcedure,
MetadataCache)
public ControllerResultSet execReadStoredProcedure(StoredProcedure proc,
MetadataCache metadataCache)
throws java.sql.SQLException
AbstractLoadBalancer
execReadStoredProcedure in class AbstractLoadBalancerproc - the stored procedure callmetadataCache - MetadataCache (null if none)
ControllerResultSet value
java.sql.SQLException - if an error occursAbstractLoadBalancer.execReadStoredProcedure(StoredProcedure,
MetadataCache)
public int execWriteStoredProcedure(StoredProcedure proc)
throws java.sql.SQLException
AbstractLoadBalancer
execWriteStoredProcedure in class AbstractLoadBalancerproc - the stored procedure call
java.sql.SQLException - if an error occursAbstractLoadBalancer.execWriteStoredProcedure(org.objectweb.cjdbc.common.sql.StoredProcedure)
public void begin(TransactionMarkerMetaData tm)
throws java.sql.SQLException
begin in class AbstractLoadBalancertm - the transaction marker metadata
java.sql.SQLException - if an error occurs
public void commit(TransactionMarkerMetaData tm)
throws java.sql.SQLException
commit in class AbstractLoadBalancertm - the transaction marker metadata
java.sql.SQLException - if an error occurs
public void rollback(TransactionMarkerMetaData tm)
throws java.sql.SQLException
rollback in class AbstractLoadBalancertm - the transaction marker metadata
java.sql.SQLException - if an error occurs
public void enableBackend(DatabaseBackend db,
boolean writeEnabled)
throws java.sql.SQLException
enableBackend in class AbstractLoadBalancerdb - the database backend to enablewriteEnabled - True if the backend must be enabled for writes
java.sql.SQLException - if an error occurs
public void disableBackend(DatabaseBackend db)
throws java.sql.SQLException
disableBackend in class AbstractLoadBalancerdb - the database backend to disable
java.sql.SQLException - if an error occurs
public void setWeight(java.lang.String name,
int w)
throws java.sql.SQLException
AbstractLoadBalancer
setWeight in interface AbstractLoadBalancerMBeansetWeight in class AbstractLoadBalancername - the backend namew - the weight
java.sql.SQLException - if an error occursAbstractLoadBalancer.setWeight(String,
int)public java.lang.String getInformation()
getInformation in interface AbstractLoadBalancerMBeangetInformation in class AbstractLoadBalancerString containing informationpublic java.lang.String getXmlImpl()
AbstractLoadBalancer
getXmlImpl in class AbstractLoadBalancerString containing information, xml formattedAbstractLoadBalancer.getXmlImpl()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||