net.sourceforge.hatbox
Class Lock

java.lang.Object
  extended by net.sourceforge.hatbox.Lock

public class Lock
extends java.lang.Object

Acquires a read or write lock on the rtree meta node. The meta node is a special node that contains spatial table metadata rather than index entries.

Author:
Peter Yuill

Constructor Summary
Lock(java.sql.Connection con, RTreeDml dml)
          The write lock constructor.
Lock(java.sql.Connection con, RTreeDml dml, java.sql.PreparedStatement selectStmt)
          The read lock constructor.
 
Method Summary
 void close()
           
 java.sql.ResultSet getResultSet()
           
 long getRootId()
           
 boolean isClosed()
           
 boolean isWrite()
           
 void setRootId(long rootId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lock

public Lock(java.sql.Connection con,
            RTreeDml dml,
            java.sql.PreparedStatement selectStmt)
The read lock constructor. Assumes a constructed index is available. Acquires a read lock on the Meta Node

Parameters:
con - The connection to use for acquiring the lock
dml - The database and index specific DML to use
write - Is the lock to be used for writing the index?

Lock

public Lock(java.sql.Connection con,
            RTreeDml dml)
The write lock constructor. Assumes a constructed index is available. Acquires a write lock on the Meta Node

Parameters:
con - The connection to use for acquiring the lock
dml - The database and index specific DML to use
write - Is the lock to be used for writing the index?
Method Detail

getRootId

public long getRootId()

setRootId

public void setRootId(long rootId)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

getResultSet

public java.sql.ResultSet getResultSet()

isWrite

public boolean isWrite()

close

public void close()
           throws java.sql.SQLException
Throws:
java.sql.SQLException

isClosed

public boolean isClosed()


Copyright © 2010. All Rights Reserved.