org.apache.karaf.main
Class DefaultJDBCLock

java.lang.Object
  extended by org.apache.karaf.main.DefaultJDBCLock
All Implemented Interfaces:
Lock
Direct Known Subclasses:
DerbyJDBCLock, MySQLJDBCLock, OracleJDBCLock

public class DefaultJDBCLock
extends java.lang.Object
implements Lock

Represents an exclusive lock on a database, used to avoid multiple Karaf instances attempting to become master.

Version:
$Revision: $

Constructor Summary
DefaultJDBCLock(java.util.Properties props)
           
 
Method Summary
 boolean isAlive()
          Indicates whether or not the lock still exists.
 boolean lock()
          A KeepAlive function to maintain the lock.
 void release()
          Terminate the lock connection safely.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJDBCLock

public DefaultJDBCLock(java.util.Properties props)
Method Detail

lock

public boolean lock()
Description copied from interface: Lock
A KeepAlive function to maintain the lock. Indicates whether or not the lock could be aquired.

Specified by:
lock in interface Lock
Returns:
true if connection lock retained, false otherwise.

release

public void release()
             throws Exception
Description copied from interface: Lock
Terminate the lock connection safely.

Specified by:
release in interface Lock
Throws:
Exception

isAlive

public boolean isAlive()
                throws Exception
Description copied from interface: Lock
Indicates whether or not the lock still exists.

Specified by:
isAlive in interface Lock
Returns:
true, if the lock still exists, otherwise false.
Throws:
Exception


Copyright © 2007-2011 Apache Software Foundation. All Rights Reserved.