|
Oracle Fusion Middleware Oracle WebLogic Server API Reference 11g Release 1 (10.3.5) Part Number E13941-05 |
||||||||||
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)
|
int |
renewLeases(String owner,
Set leases,
int healthCheckPeriod)
Attempts to renew all the currently held leases. |
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
public int renewLeases(String owner, Set leases, int healthCheckPeriod) throws IOException
LeasingBasis
renewLeases
in interface LeasingBasis
leases
- to be renewedhealthCheckPeriod
- in milliseconds
IOException
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 ServiceFailureException
ServiceFailureException
|
Copyright 1996, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Oracle WebLogic Server API Reference 11g Release 1 (10.3.5) Part Number E13941-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |