diff options
author | Marc Laukien <marc@zeroc.com> | 2002-04-17 18:18:56 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-04-17 18:18:56 +0000 |
commit | ba3284190a5c6d7ded9645f00e965c5162393a5b (patch) | |
tree | 9d036f1baef585b57bad59e17de5516d9f9882b0 /java/demo/Freeze/library/Collocated.java | |
parent | getPropertyAsInt (diff) | |
download | ice-ba3284190a5c6d7ded9645f00e965c5162393a5b.tar.bz2 ice-ba3284190a5c6d7ded9645f00e965c5162393a5b.tar.xz ice-ba3284190a5c6d7ded9645f00e965c5162393a5b.zip |
property convenience operations
Diffstat (limited to 'java/demo/Freeze/library/Collocated.java')
-rw-r--r-- | java/demo/Freeze/library/Collocated.java | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/java/demo/Freeze/library/Collocated.java b/java/demo/Freeze/library/Collocated.java index ae7f391f8b8..1cdc2e83ee5 100644 --- a/java/demo/Freeze/library/Collocated.java +++ b/java/demo/Freeze/library/Collocated.java @@ -21,38 +21,19 @@ class LibraryCollocated extends Freeze.Application // // Create an Evictor for books. // - Freeze.EvictorPersistenceMode mode; - int v = 0; - try - { - v = Integer.parseInt(properties.getProperty("Library.SaveAfterMutatingOperation")); - } - catch (NumberFormatException ex) - { - } - - if (v != 0) + Freeze.Evictor evictor; + if (properties.getPropertyAsInt("Library.SaveAfterMutatingOperation") > 0) { - mode = Freeze.EvictorPersistenceMode.SaveAfterMutatingOperation; + evictor = dbBooks.createEvictor(Freeze.EvictorPersistenceMode.SaveAfterMutatingOperation); } else { - mode = Freeze.EvictorPersistenceMode.SaveUponEviction; + evictor = dbBooks.createEvictor(Freeze.EvictorPersistenceMode.SaveUponEviction); } - Freeze.Evictor evictor = dbBooks.createEvictor(mode); - - v = 0; - try - { - v = Integer.parseInt(properties.getProperty("Library.EvictorSize")); - } - catch (NumberFormatException ex) - { - } - - if (v != 0) + int evictorSize = properties.getPropertyAsInt("Library.EvictorSize"); + if (evictorSize > 0) { - evictor.setSize(v); + evictor.setSize(evictorSize); } // |