froehlich 01/12/13 10:37:14 Modified: scratchpad/src/org/apache/cocoon/jispstore JispKey.java JispFilesystemStore.java Log: some cosmetic fixes Revision Changes Path 1.3 +5 -0 xml-cocoon2/scratchpad/src/org/apache/cocoon/jispstore/JispKey.java Index: JispKey.java =================================================================== RCS file: /home/cvs/xml-cocoon2/scratchpad/src/org/apache/cocoon/jispstore/JispKey.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JispKey.java 2001/12/13 13:21:04 1.2 +++ JispKey.java 2001/12/13 18:37:14 1.3 @@ -12,6 +12,11 @@ import java.io.ObjectInput; import java.io.ObjectOutput; +/** + * JispKey + * + * @author <a href="mailto:[EMAIL PROTECTED]">Gerhard Froehlich</a> + */ final class JispKey extends KeyObject{ static final long serialVersionUID = -6894793231339165076L; private String mKey; 1.5 +22 -10 xml-cocoon2/scratchpad/src/org/apache/cocoon/jispstore/JispFilesystemStore.java Index: JispFilesystemStore.java =================================================================== RCS file: /home/cvs/xml-cocoon2/scratchpad/src/org/apache/cocoon/jispstore/JispFilesystemStore.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- JispFilesystemStore.java 2001/12/13 16:24:28 1.4 +++ JispFilesystemStore.java 2001/12/13 18:37:14 1.5 @@ -23,6 +23,7 @@ import com.coyotegulch.jisp.IndexedObjectDatabase; import com.coyotegulch.jisp.BTreeIndex; +import com.coyotegulch.jisp.KeyNotFound; import java.io.File; import java.io.IOException; @@ -92,6 +93,8 @@ mDatabase.attachIndex(mIndex); mIndex.dumpTree(); } + } catch (KeyNotFound ignore) { + } catch (Exception e) { getLogger().error("initialize(..) Exception",e); } @@ -168,14 +171,18 @@ public void store(Object key, Object value) throws IOException { this.getLogger().debug("store(): Store file with key: " + key.toString()); - //this.remove(key); - try { - JispKey[] keyArray = new JispKey[1]; - keyArray[0] = new JispKey(key.toString()); - - mDatabase.write(keyArray,(Serializable)value); - } catch (Exception e) { - this.getLogger().error("store(..): Exception",e); + + if(value instanceof Serializable) { + try { + JispKey[] keyArray = new JispKey[1]; + keyArray[0] = new JispKey(key.toString()); + + mDatabase.write(keyArray,(Serializable)value); + } catch (Exception e) { + this.getLogger().error("store(..): Exception",e); + } + } else { + throw new IOException("Object not Serializable"); } } @@ -195,8 +202,10 @@ keyArray[0] = new JispKey(key.toString()); mDatabase.remove(keyArray); + } catch (KeyNotFound ignore) { + } catch (Exception e) { - this.getLogger().error("remove(..): Exception",e); + this.getLogger().error("remove(..): Exception",e); } } @@ -206,9 +215,12 @@ try { res = mIndex.findKey(new JispKey(key.toString())); this.getLogger().debug("containsKey(..): res=" + res); + } catch (KeyNotFound ignore) { + } catch (Exception e) { - this.getLogger().error("containsKey(..) Exception",e); + this.getLogger().error("containsKey(..): Exception",e); } + if(res > 0) { return true; } else {
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]