|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweblogic.cluster.singleton.DatabaseLeasingBasis
public class DatabaseLeasingBasis
LeasingBasis
that leverages an HA-database for lease
ownership. Assumes transactional behaviour of SQL-queries.
Field Summary | |
---|---|
protected weblogic.management.configuration.JDBCSystemResourceMBean |
jdbcResource
|
protected int |
queryTimeoutSeconds
|
protected String |
TABLE_NAME
|
Constructor Summary | |
---|---|
DatabaseLeasingBasis(weblogic.management.configuration.JDBCSystemResourceMBean jdbcResource,
int unresponsiveTimeout,
String tableName)
|
Method Summary | |
---|---|
protected int |
abdicateLease(String leaseName,
String owner)
|
boolean |
acquire(String leaseName,
String owner,
int leaseTimeout)
Attempts to claim immediate ownership of a lease for this server. |
protected int |
acquireLease(String leaseName,
String owner)
|
protected int |
assumeLease(String leaseName,
String owner,
int leaseTimeout)
|
protected void |
closePreparedStatement(PreparedStatement ps)
|
protected void |
closeResultSet(ResultSet rs)
|
protected void |
closeSQLConnection(Connection con)
|
static LeasingBasis |
createBasis(weblogic.management.configuration.ServerMBean server,
weblogic.management.configuration.JDBCSystemResourceMBean jdbcResource,
int unresponsiveTimeout,
String tableName)
Check to make sure the database is reachable. |
String[] |
findExpiredLeases(int gracePeriod)
Returns a list of the servers that have consistently missed sending heartbeats in a timely manner, and failed to do so for longer than their grace period. |
String |
findOwner(String leaseName)
Returns the identity of the server that currently owns the lease. |
String |
findPreviousOwner(String leaseName)
|
protected Connection |
getJDBCConnection()
|
void |
release(String leaseName,
String owner)
If the lease is owned by this server, attempts to give up ownership. |
int |
renewAllLeases(int healthCheckPeriod,
String owner)
Attempts to send a heartbeat to prove the health of the server. |
protected int |
renewAllLeases(String owner,
int healthCheckPeriod)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final weblogic.management.configuration.JDBCSystemResourceMBean jdbcResource
protected final String TABLE_NAME
protected final int queryTimeoutSeconds
Constructor Detail |
---|
public DatabaseLeasingBasis(weblogic.management.configuration.JDBCSystemResourceMBean jdbcResource, int unresponsiveTimeout, String tableName)
Method Detail |
---|
public boolean acquire(String leaseName, String owner, int leaseTimeout) throws LeasingException
LeasingBasis
acquire
in interface LeasingBasis
leaseTimeout
- in milliseconds
LeasingException
public void release(String leaseName, String owner) throws IOException
LeasingBasis
release
in interface LeasingBasis
IOException
public int renewAllLeases(int healthCheckPeriod, String owner) throws MissedHeartbeatException
LeasingBasis
renewAllLeases
in interface LeasingBasis
healthCheckPeriod
- in milliseconds
MissedHeartbeatException
protected int renewAllLeases(String owner, int healthCheckPeriod)
protected int abdicateLease(String leaseName, String owner)
protected int acquireLease(String leaseName, String owner)
protected int assumeLease(String leaseName, String owner, int leaseTimeout)
public String findPreviousOwner(String leaseName) throws IOException
findPreviousOwner
in interface LeasingBasis
IOException
public String findOwner(String leaseName) throws IOException
LeasingBasis
findOwner
in interface LeasingBasis
IOException
public String[] findExpiredLeases(int gracePeriod)
LeasingBasis
findExpiredLeases
in interface LeasingBasis
gracePeriod
- in millisecondsprotected void closePreparedStatement(PreparedStatement ps)
protected void closeSQLConnection(Connection con)
protected void closeResultSet(ResultSet rs)
protected Connection getJDBCConnection() throws SQLException
SQLException
public static LeasingBasis createBasis(weblogic.management.configuration.ServerMBean server, weblogic.management.configuration.JDBCSystemResourceMBean jdbcResource, int unresponsiveTimeout, String tableName) throws weblogic.server.ServiceFailureException
weblogic.server.ServiceFailureException
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs100 Copyright 2006 BEA Systems Inc. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |