1 23 24 package com.sun.ejb.base.sfsb.initialization; 25 26 import java.lang.reflect.Method ; 27 28 import java.net.InetAddress ; 29 30 import java.util.logging.Logger ; 31 import java.util.logging.Level ; 32 33 import com.sun.ejb.spi.sfsb.initialization.PersistenceStrategyBuilder; 34 import com.sun.ejb.spi.sfsb.initialization.SFSBContainerInitialization; 35 import com.sun.ejb.spi.sfsb.util.CheckpointPolicy; 36 37 import com.sun.ejb.base.sfsb.util.CheckpointPolicyImpl; 38 import com.sun.ejb.base.sfsb.util.ScrambledKeyGenerator; 39 import com.sun.ejb.base.sfsb.util.SimpleKeyGenerator; 40 41 import com.sun.enterprise.deployment.EjbDescriptor; 42 import com.sun.enterprise.util.Utility; 43 44 import com.sun.logging.LogDomains; 45 46 import com.sun.ejb.base.container.util.CacheProperties; 47 48 55 public abstract class AbstractPersistenceStrategyBuilder 56 implements PersistenceStrategyBuilder 57 { 58 protected static Logger _logger = 59 LogDomains.getLogger(LogDomains.EJB_LOGGER); 60 61 protected SFSBContainerInitialization container; 62 protected EjbDescriptor descriptor; 63 private int removalGracePeriodInSeconds = 0; 64 65 public AbstractPersistenceStrategyBuilder() { 66 } 67 68 public void initializePersistenceStrategy( 69 SFSBContainerInitialization container, EjbDescriptor descriptor) 70 { 71 this.container = container; 72 this.descriptor = descriptor; 73 74 CacheProperties cacheProps = new CacheProperties(descriptor); 75 int removalTimeout = cacheProps.getRemovalTimeoutInSeconds(); 76 if (removalTimeout > 0) { 77 this.removalGracePeriodInSeconds = removalTimeout / 2; 78 } 79 container.setRemovalGracePeriodInSeconds(removalGracePeriodInSeconds); 80 } 81 82 protected int getRemovalGracePeriodInSeconds() { 83 return this.removalGracePeriodInSeconds; 84 } 85 86 } 87 | Popular Tags |