+ /* (non-Javadoc)
+ * @see org.vamsas.client.simpleclient.Lock#getLength()
+ */
+ public long length() {
+ if (isLocked()){
+ try {
+ return rafile.length();
+ } catch (Exception e) {
+ log.debug("getLength exception:",e);
+ }
+ }
+ return -1;
+ }
+
+ public RandomAccessFile getRaFile() throws IOException {
+ if (isLocked())
+ return rafile;
+ else
+ log.debug("Failed to getRaFile on "+target);
+ return null;
+ }
+
+ public FileChannel getRaChannel() throws IOException {
+ if (isLocked())
+ return rafile.getChannel();
+ else
+ log.debug("Failed to getRaChannel on "+target);
+ return null;
+ }
+