ozeigermann    2004/07/12 02:42:59

  Modified:    src/share/org/apache/slide/store ExtendedStore.java
  Log:
  Added method to reset cache
  
  Revision  Changes    Path
  1.14      +34 -16    
jakarta-slide/src/share/org/apache/slide/store/ExtendedStore.java
  
  Index: ExtendedStore.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/store/ExtendedStore.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ExtendedStore.java        1 Jul 2004 13:12:30 -0000       1.13
  +++ ExtendedStore.java        12 Jul 2004 09:42:59 -0000      1.14
  @@ -134,6 +134,19 @@
   
       protected boolean globalCacheOff;
   
  +    int globalObjectCacheSize;
  +    int globalPermissionCacheSize;
  +    int globalLockCacheSize;
  +    int globalDescrtiptorsCacheSize;
  +    int globalDescrtiptorCacheSize;
  +    boolean contentCachingEnabled;
  +    int globalContentCacheSize;
  +    long contentCacheBytes;
  +    int txContentCacheSize;
  +    long txContentCacheBytes;
  +    long maxByteSizePerEntry;
  +    boolean noGlobalCacheInTx;
  +    
       private Map suspendedLocks = new HashMap();
   
       public ExtendedStore() {
  @@ -144,17 +157,17 @@
           throws ServiceParameterErrorException, ServiceParameterMissingException {
           super.setParameters(parameters);
   
  -        int globalObjectCacheSize = DEFAULT_OBJECT_GLOBAL_CACHE_SIZE;
  -        int globalPermissionCacheSize = DEFAULT_GLOBAL_PERMISSION_CACHE_SIZE;
  -        int globalLockCacheSize = DEFAULT_GLOBAL_LOCK_CACHE_SIZE;
  -        int globalDescrtiptorsCacheSize = DEFAULT_GLOBAL_DESCRIPTORS_CACHE_SIZE;
  -        int globalDescrtiptorCacheSize = DEFAULT_GLOBAL_DESCRIPTOR_CACHE_SIZE;
  -        boolean contentCachingEnabled = DEFAULT_ENABLE_CONTENT_CACHING;
  -        int globalContentCacheSize = DEFAULT_GLOBAL_CONTENT_CACHE_SIZE;
  -        long contentCacheBytes = DEFAULT_CONTENT_CACHE_BYTES;
  -        int txContentCacheSize = DEFAULT_TX_CONTENT_CACHE_SIZE;
  -        long txContentCacheBytes = DEFAULT_TX_CONTENT_CACHE_BYTES;
  -        long maxByteSizePerEntry = DEFAULT_MAX_CONTENT_BYTES_PER_ENTRY;
  +        globalObjectCacheSize = DEFAULT_OBJECT_GLOBAL_CACHE_SIZE;
  +        globalPermissionCacheSize = DEFAULT_GLOBAL_PERMISSION_CACHE_SIZE;
  +        globalLockCacheSize = DEFAULT_GLOBAL_LOCK_CACHE_SIZE;
  +        globalDescrtiptorsCacheSize = DEFAULT_GLOBAL_DESCRIPTORS_CACHE_SIZE;
  +        globalDescrtiptorCacheSize = DEFAULT_GLOBAL_DESCRIPTOR_CACHE_SIZE;
  +        contentCachingEnabled = DEFAULT_ENABLE_CONTENT_CACHING;
  +        globalContentCacheSize = DEFAULT_GLOBAL_CONTENT_CACHE_SIZE;
  +        contentCacheBytes = DEFAULT_CONTENT_CACHE_BYTES;
  +        txContentCacheSize = DEFAULT_TX_CONTENT_CACHE_SIZE;
  +        txContentCacheBytes = DEFAULT_TX_CONTENT_CACHE_BYTES;
  +        maxByteSizePerEntry = DEFAULT_MAX_CONTENT_BYTES_PER_ENTRY;
   
           timeout = DEFAULT_TLOCK_TIMEOUT;
           String timeoutString = (String) parameters.get(TLOCK_TIMEOUT_PARAMETER);
  @@ -322,7 +335,6 @@
           cacheModeString = cacheModeString.trim();
   
           boolean noGlobalCache;
  -        boolean noGlobalCacheInTx;
           if (cacheModeString.equals(CACHE_MODE_FULL)) {
               noGlobalCache = false;
               globalCacheOff = false;
  @@ -375,6 +387,12 @@
               noGlobalCacheInTx);
       }
   
  +    public void resetCache() {
  +        init(globalObjectCacheSize, globalPermissionCacheSize, globalLockCacheSize, 
globalDescrtiptorsCacheSize,
  +                globalDescrtiptorCacheSize, contentCachingEnabled, 
globalContentCacheSize, contentCacheBytes,
  +                txContentCacheSize, txContentCacheBytes, maxByteSizePerEntry, 
noGlobalCacheInTx);
  +    }
  +    
       public void exclusiveTransientLock(String uri)
                        throws ServiceAccessException {
                Xid txId = (Xid) activeTransactionBranch.get();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to