This is an automated email from the ASF dual-hosted git repository. tv pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jcs.git
commit 32b5552de5fbf7948404673d665af00ba4826540 Author: Thomas Vandahl <[email protected]> AuthorDate: Sun Feb 1 16:19:41 2026 +0100 Remove all unused getters and setters from Attributes interfaces --- commons-jcs4-core/src/main/java/module-info.java | 2 +- .../disk/AbstractDiskCacheAttributes.java | 6 - .../disk/behavior/IDiskCacheAttributes.java | 52 --------- .../disk/jdbc/JDBCDiskCacheAttributes.java | 21 ---- .../auxiliary/lateral/LateralCacheAttributes.java | 103 +---------------- .../lateral/behavior/ILateralCacheAttributes.java | 123 --------------------- .../lateral/socket/tcp/LateralTCPCacheFactory.java | 2 +- .../socket/tcp/LateralTCPDiscoveryListener.java | 5 +- .../socket/tcp/TCPLateralCacheAttributes.java | 14 --- .../tcp/behavior/ITCPLateralCacheAttributes.java | 113 ------------------- .../remote/AbstractRemoteCacheNoWaitFacade.java | 6 +- .../remote/CommonRemoteCacheAttributes.java | 10 -- .../auxiliary/remote/RemoteCacheAttributes.java | 8 -- .../auxiliary/remote/RemoteCacheNoWaitFacade.java | 4 +- .../behavior/ICommonRemoteCacheAttributes.java | 72 ------------ .../remote/behavior/IRemoteCacheAttributes.java | 59 ---------- .../remote/server/RemoteCacheServerAttributes.java | 5 - .../behavior/IRemoteCacheServerAttributes.java | 36 ------ .../jcs4/engine/CompositeCacheAttributes.java | 40 ------- .../commons/jcs4/engine/ElementAttributes.java | 8 -- .../engine/behavior/ICompositeCacheAttributes.java | 111 ------------------- .../jcs4/engine/behavior/IElementAttributes.java | 24 ---- .../engine/control/CompositeCacheConfigurator.java | 3 - .../jcs4/io/ObjectInputStreamClassLoaderAware.java | 16 ++- .../utils/discovery/UDPDiscoveryAttributes.java | 68 ------------ .../serialization/SerializationConversionUtil.java | 3 +- .../commons/jcs4/access/CacheAccessUnitTest.java | 17 ++- .../auxiliary/disk/AbstractDiskCacheUnitTest.java | 4 +- .../disk/block/AbstractBlockDiskCacheUnitTest.java | 7 +- .../indexed/AbstractIndexDiskCacheUnitTest.java | 9 +- .../indexed/IndexedDiskCacheKeyStoreUnitTest.java | 7 +- .../tcp/LateralTCPConcurrentRandomTestUtil.java | 2 - .../tcp/LateralTCPDiscoveryListenerUnitTest.java | 11 +- .../LateralTCPFilterRemoveHashCodeUnitTest.java | 2 - .../tcp/LateralTCPIssueRemoveOnPutUnitTest.java | 3 - .../lateral/socket/tcp/TestTCPLateralUnitTest.java | 4 - .../remote/RemoteCacheListenerUnitTest.java | 10 +- .../remote/RemoteCacheNoWaitFacadeUnitTest.java | 2 +- .../remote/server/RemoteCacheServerUnitTest.java | 7 +- .../control/CompositeCacheDiskUsageUnitTest.java | 12 +- .../engine/control/CompositeCacheUnitTest.java | 11 +- .../memory/fifo/FIFOMemoryCacheUnitTest.java | 5 +- .../memory/shrinking/ShrinkerThreadUnitTest.java | 18 +-- .../SerializationConversionUtilUnitTest.java | 7 +- .../org/apache/commons/jcs4/jcache/JCSCache.java | 2 +- init-git-svn.sh | 21 ---- jcache-fast.sh | 23 ---- 47 files changed, 82 insertions(+), 1016 deletions(-) diff --git a/commons-jcs4-core/src/main/java/module-info.java b/commons-jcs4-core/src/main/java/module-info.java index a6311d9d..43881c5a 100644 --- a/commons-jcs4-core/src/main/java/module-info.java +++ b/commons-jcs4-core/src/main/java/module-info.java @@ -100,7 +100,7 @@ module org.apache.commons.jcs4.core { requires transitive java.naming; // Optional dependencies for remote HTTP caching - requires static jakarta.servlet; + requires static transitive jakarta.servlet; // Optional dependencies for JDBC disk cache requires static org.apache.commons.dbcp2; diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/AbstractDiskCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/AbstractDiskCacheAttributes.java index 120cca2d..201af1a7 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/AbstractDiskCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/AbstractDiskCacheAttributes.java @@ -113,19 +113,16 @@ public abstract class AbstractDiskCacheAttributes extends AbstractAuxiliaryCache * @param allowRemoveAll * The allowRemoveAll to set. */ - @Override public void setAllowRemoveAll(final boolean allowRemoveAll) { this.allowRemoveAll = allowRemoveAll; } - @Override public void setDiskLimitType(final DiskLimitType diskLimitType) { this.diskLimitType = diskLimitType; } - @Override public void setDiskLimitTypeName(final String diskLimitTypeName) { if (diskLimitTypeName != null) @@ -163,7 +160,6 @@ public abstract class AbstractDiskCacheAttributes extends AbstractAuxiliaryCache * @param path * The new diskPath value */ - @Override public void setDiskPath(final String path) { setDiskPath(new File(path)); @@ -176,7 +172,6 @@ public abstract class AbstractDiskCacheAttributes extends AbstractAuxiliaryCache * @param maxPurgatorySize * The new maxPurgatorySize value */ - @Override public void setMaxPurgatorySize(final int maxPurgatorySize) { this.maxPurgatorySize = maxPurgatorySize; @@ -194,7 +189,6 @@ public abstract class AbstractDiskCacheAttributes extends AbstractAuxiliaryCache * @param shutdownSpoolTimeLimit * the time in seconds */ - @Override public void setShutdownSpoolTimeLimit(final int shutdownSpoolTimeLimit) { this.shutdownSpoolTimeLimit = shutdownSpoolTimeLimit; diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/behavior/IDiskCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/behavior/IDiskCacheAttributes.java index 24af0949..9e9b783a 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/behavior/IDiskCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/behavior/IDiskCacheAttributes.java @@ -76,56 +76,4 @@ public interface IDiskCacheAttributes * @return boolean */ boolean isAllowRemoveAll(); - - /** - * If this is false, then remove all requests will not be honored. - * <p> - * This provides a safety mechanism for the persistent store. - * - * @param allowRemoveAll - */ - void setAllowRemoveAll( boolean allowRemoveAll ); - - /** - * set the type of the limit of the cache size - * @param diskLimitType COUNT - limit by count of the elements, SIZE, limit by sum of element's size - */ - void setDiskLimitType(DiskLimitType diskLimitType); - - /** - * Translates and stores String values of DiskLimitType - * - * Allowed values: "COUNT" and "SIZE" - * @param diskLimitTypeName - */ - void setDiskLimitTypeName(String diskLimitTypeName); - - /** - * Sets the diskPath attribute of the IJISPCacheAttributes object - * - * @param path - * The new diskPath value - */ - void setDiskPath( String path ); - - /** - * Sets the maxPurgatorySize attribute of the DiskCacheAttributes object - * - * @param maxPurgatorySize - * The new maxPurgatorySize value - */ - void setMaxPurgatorySize( int maxPurgatorySize ); - - /** - * Sets the amount of time in seconds we will wait for elements to move to - * disk during shutdown for a particular region. - * <p> - * This is how long we give the event queue to empty. - * <p> - * The default is 60 seconds. - * - * @param shutdownSpoolTimeLimit - * the time in seconds - */ - void setShutdownSpoolTimeLimit( int shutdownSpoolTimeLimit ); } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java index 77bcd533..cba80d36 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java @@ -51,9 +51,6 @@ public class JDBCDiskCacheAttributes /** URL for the db */ private String url; - /** The name of the database. */ - private String database = ""; - /** The driver */ private String driverClassName; @@ -100,14 +97,6 @@ public class JDBCDiskCacheAttributes return connectionPoolName; } - /** - * @return the database. - */ - public String getDatabase() - { - return database; - } - /** * @return the driverClassName. */ @@ -204,15 +193,6 @@ public class JDBCDiskCacheAttributes this.connectionPoolName = connectionPoolName; } - /** - * This is appended to the url. - * @param database The database to set. - */ - public void setDatabase( final String database ) - { - this.database = database; - } - /** * @param driverClassName The driverClassName to set. */ @@ -316,7 +296,6 @@ public class JDBCDiskCacheAttributes buf.append( "\nJDBCCacheAttributes" ); buf.append( "\n UserName [" + getUserName() + "]" ); buf.append( "\n Url [" + getUrl() + "]" ); - buf.append( "\n Database [" + getDatabase() + "]" ); buf.append( "\n DriverClassName [" + getDriverClassName() + "]" ); buf.append( "\n TableName [" + getTableName() + "]" ); buf.append( "\n TestBeforeInsert [" + isTestBeforeInsert() + "]" ); diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/LateralCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/LateralCacheAttributes.java index 228844b1..bf683a69 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/LateralCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/LateralCacheAttributes.java @@ -35,24 +35,12 @@ public class LateralCacheAttributes /** Default receive setting */ private static final boolean DEFAULT_RECEIVE = true; - /** Indicates the lateral type, this needs to change */ - private Type transmissionType = Type.UDP; - - /** The http servers */ - private String httpServers; - - /** Used to identify the service that this manager will be operating on */ - private String httpServer = ""; - /** This needs to change */ private String udpMulticastAddr = "228.5.6.7"; /** This needs to change */ private int udpMulticastPort = 6789; - /** This needs to change */ - private int httpListenerPort = 8080; - /** Disables gets from laterals */ private boolean putOnlyMode = true; @@ -65,36 +53,6 @@ public class LateralCacheAttributes /** If the primary fails, we will queue items before reconnect. This limits the number of items that can be queued. */ private int zombieQueueMaxSize = DEFAULT_ZOMBIE_QUEUE_MAX_SIZE; - /** - * Gets the httpListenerPort attribute of the ILateralCacheAttributes object - * @return The httpListenerPort value - */ - @Override - public int getHttpListenerPort() - { - return this.httpListenerPort; - } - - /** - * Gets the httpServer attribute of the LateralCacheAttributes object - * @return The httpServer value - */ - @Override - public String getHttpServer() - { - return httpServer; - } - - /** - * Gets the httpSrvers attribute of the LateralCacheAttributes object - * @return The httpServers value - */ - @Override - public String getHttpServers() - { - return httpServers; - } - /** * @return The outgoingOnlyMode value. Stops gets from going remote. */ @@ -104,16 +62,6 @@ public class LateralCacheAttributes return putOnlyMode; } - /** - * Gets the transmissionType attribute of the LateralCacheAttributes object - * @return The transmissionType value - */ - @Override - public Type getTransmissionType() - { - return this.transmissionType; - } - /** * Gets the udpMulticastAddr attribute of the LateralCacheAttributes object * @return The udpMulticastAddr value @@ -155,44 +103,12 @@ public class LateralCacheAttributes return receive; } - /** - * Sets the httpListenerPort attribute of the ILateralCacheAttributes object - * @param val The new tcpListenerPort value - */ - @Override - public void setHttpListenerPort( final int val ) - { - this.httpListenerPort = val; - } - - /** - * Sets the httpServer attribute of the LateralCacheAttributes object - * - * @param val The new httpServer value - */ - @Override - public void setHttpServer( final String val ) - { - httpServer = val; - } - - /** - * Sets the httpServers attribute of the LateralCacheAttributes object - * @param val The new httpServers value - */ - @Override - public void setHttpServers( final String val ) - { - httpServers = val; - } - /** * Sets the outgoingOnlyMode attribute of the ILateralCacheAttributes. When this is true the * lateral cache will only issue put and remove order and will not try to retrieve elements from * other lateral caches. * @param val The new transmissionTypeName value */ - @Override public void setPutOnlyMode( final boolean val ) { this.putOnlyMode = val; @@ -201,27 +117,15 @@ public class LateralCacheAttributes /** * @param receive The receive to set. */ - @Override public void setReceive( final boolean receive ) { this.receive = receive; } - /** - * Sets the transmissionType attribute of the LateralCacheAttributes object - * @param val The new transmissionType value - */ - @Override - public void setTransmissionType( final Type val ) - { - this.transmissionType = val; - } - /** * Sets the udpMulticastAddr attribute of the LateralCacheAttributes object * @param val The new udpMulticastAddr value */ - @Override public void setUdpMulticastAddr( final String val ) { udpMulticastAddr = val; @@ -231,7 +135,6 @@ public class LateralCacheAttributes * Sets the udpMulticastPort attribute of the LateralCacheAttributes object * @param val The new udpMulticastPort value */ - @Override public void setUdpMulticastPort( final int val ) { udpMulticastPort = val; @@ -243,7 +146,6 @@ public class LateralCacheAttributes * * @param zombieQueueMaxSize The zombieQueueMaxSize to set. */ - @Override public void setZombieQueueMaxSize( final int zombieQueueMaxSize ) { this.zombieQueueMaxSize = zombieQueueMaxSize; @@ -258,10 +160,7 @@ public class LateralCacheAttributes final StringBuilder buf = new StringBuilder(); //buf.append( "cacheName=" + cacheName + "\n" ); //buf.append( "putOnlyMode=" + putOnlyMode + "\n" ); - //buf.append( "transmissionTypeName=" + transmissionTypeName + "\n" ); - //buf.append( "transmissionType=" + transmissionType + "\n" ); - //buf.append( "tcpServer=" + tcpServer + "\n" ); - buf.append( transmissionType.toString() + httpServer + udpMulticastAddr + String.valueOf( udpMulticastPort ) ); + buf.append(udpMulticastAddr + String.valueOf( udpMulticastPort ) ); return buf.toString(); } } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/behavior/ILateralCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/behavior/ILateralCacheAttributes.java index c9afb0c3..2dde85b1 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/behavior/ILateralCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/behavior/ILateralCacheAttributes.java @@ -30,76 +30,17 @@ import org.apache.commons.jcs4.auxiliary.AuxiliaryCacheAttributes; public interface ILateralCacheAttributes extends AuxiliaryCacheAttributes { - enum Type - { - /** HTTP type */ - HTTP("HTTP"), // 1 - - /** UDP type */ - UDP("UDP"), // 2 - - /** TCP type */ - TCP("TCP"), // 3 - - /** XMLRPC type */ - XMLRPC("XMLRPC"); // 4 - - private final String typeName; - - Type(final String typeName) - { - this.typeName = typeName; - } - - /** - * @since 3.1 - */ - @Override - public String toString() - { - return typeName; - } - } - /** * The number of elements the zombie queue will hold. This queue is used to store events if we * loose our connection with the server. */ int DEFAULT_ZOMBIE_QUEUE_MAX_SIZE = 1000; - /** - * Gets the httpListenerPort attribute of the ILateralCacheAttributes object - * - * @return The httpListenerPort value - */ - int getHttpListenerPort(); - - /** - * Gets the httpServer attribute of the ILateralCacheAttributes object - * - * @return The httpServer value - */ - String getHttpServer(); - - /** - * Gets the httpSrvers attribute of the LateralCacheAttributes object - * - * @return The httpServers value - */ - String getHttpServers(); - /** * @return The outgoingOnlyMode value. Stops gets from going remote. */ boolean getPutOnlyMode(); - /** - * Gets the transmissionType attribute of the ILateralCacheAttributes object - * - * @return The transmissionType value - */ - Type getTransmissionType(); - /** * Gets the udpMulticastAddr attribute of the ILateralCacheAttributes object * @@ -135,68 +76,4 @@ public interface ILateralCacheAttributes * @return true if we should have a listener connection */ boolean isReceive(); - - /** - * Sets the httpListenerPort attribute of the ILateralCacheAttributes object - * - * @param val The new tcpListenerPort value - */ - void setHttpListenerPort( int val ); - - /** - * Sets the httpServer attribute of the ILateralCacheAttributes object - * - * @param val The new httpServer value - */ - void setHttpServer( String val ); - - /** - * Sets the httpServers attribute of the LateralCacheAttributes object - * - * @param val The new httpServers value - */ - void setHttpServers( String val ); - - /** - * Sets the putOnlyMode attribute of the ILateralCacheAttributes. When this is true the lateral - * cache will only issue put and remove order and will not try to retrieve elements from other - * lateral caches. - * - * @param val The new transmissionTypeName value - */ - void setPutOnlyMode( boolean val ); - - /** - * @param receive The receive to set. - */ - void setReceive( boolean receive ); - - /** - * Sets the transmissionType attribute of the ILateralCacheAttributes object - * - * @param val The new transmissionType value - */ - void setTransmissionType( Type val ); - - /** - * Sets the udpMulticastAddr attribute of the ILateralCacheAttributes object - * - * @param val The new udpMulticastAddr value - */ - void setUdpMulticastAddr( String val ); - - /** - * Sets the udpMulticastPort attribute of the ILateralCacheAttributes object - * - * @param val The new udpMulticastPort value - */ - void setUdpMulticastPort( int val ); - - /** - * The number of elements the zombie queue will hold. This queue is used to store events if we - * loose our connection with the server. - * - * @param zombieQueueMaxSize The zombieQueueMaxSize to set. - */ - void setZombieQueueMaxSize( int zombieQueueMaxSize ); } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java index 5c09562f..d027167e 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPCacheFactory.java @@ -180,7 +180,7 @@ public class LateralTCPCacheFactory for (final String server : servers) { log.debug( "tcp server = {0}", server ); - final ITCPLateralCacheAttributes lacClone = (ITCPLateralCacheAttributes) lac.clone(); + final TCPLateralCacheAttributes lacClone = (TCPLateralCacheAttributes) lac.clone(); lacClone.setTcpServer( server ); final LateralCacheNoWait<K, V> lateralNoWait = createCacheNoWait(lacClone, cacheEventLogger, elementSerializer); diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListener.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListener.java index cdce0d52..e0537a7d 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListener.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListener.java @@ -26,7 +26,6 @@ import java.util.concurrent.CopyOnWriteArrayList; import org.apache.commons.jcs4.auxiliary.lateral.LateralCacheNoWait; import org.apache.commons.jcs4.auxiliary.lateral.LateralCacheNoWaitFacade; -import org.apache.commons.jcs4.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes; import org.apache.commons.jcs4.engine.behavior.IElementSerializer; import org.apache.commons.jcs4.engine.control.CompositeCacheManager; import org.apache.commons.jcs4.engine.logging.behavior.ICacheEventLogger; @@ -134,8 +133,8 @@ public class LateralTCPDiscoveryListener continue; } - final ITCPLateralCacheAttributes lca = - (ITCPLateralCacheAttributes) facade.getAuxiliaryCacheAttributes().clone(); + final TCPLateralCacheAttributes lca = + (TCPLateralCacheAttributes) facade.getAuxiliaryCacheAttributes().clone(); lca.setTcpServer(serverAndPort); final LateralTCPCacheFactory factory = diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/TCPLateralCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/TCPLateralCacheAttributes.java index 0a5a7160..07ed92b2 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/TCPLateralCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/TCPLateralCacheAttributes.java @@ -266,7 +266,6 @@ public class TCPLateralCacheAttributes * * @param allowGet */ - @Override public void setAllowGet( final boolean allowGet ) { this.allowGet = allowGet; @@ -277,7 +276,6 @@ public class TCPLateralCacheAttributes * * @param allowPut */ - @Override public void setAllowPut( final boolean allowPut ) { this.allowPut = allowPut; @@ -292,7 +290,6 @@ public class TCPLateralCacheAttributes * * @param filter */ - @Override public void setFilterRemoveByHashCode( final boolean filter ) { this.filterRemoveByHashCode = filter; @@ -305,7 +302,6 @@ public class TCPLateralCacheAttributes * * @param issueRemoveOnPut */ - @Override public void setIssueRemoveOnPut( final boolean issueRemoveOnPut ) { this.issueRemoveOnPut = issueRemoveOnPut; @@ -314,7 +310,6 @@ public class TCPLateralCacheAttributes /** * @param openTimeOut the openTimeOut to set */ - @Override public void setOpenTimeOut( final int openTimeOut ) { this.openTimeOut = openTimeOut; @@ -323,7 +318,6 @@ public class TCPLateralCacheAttributes /** * @param socketTimeOut the socketTimeOut to set */ - @Override public void setSocketTimeOut( final int socketTimeOut ) { this.socketTimeOut = socketTimeOut; @@ -335,7 +329,6 @@ public class TCPLateralCacheAttributes * @param val * The new tcpListenerHost value */ - @Override public void setTcpListenerHost( final String val ) { this.tcpListenerHost = val; @@ -346,7 +339,6 @@ public class TCPLateralCacheAttributes * * @param val The new tcpListenerPort value */ - @Override public void setTcpListenerPort( final int val ) { this.tcpListenerPort = val; @@ -357,7 +349,6 @@ public class TCPLateralCacheAttributes * * @param val The new tcpServer value */ - @Override public void setTcpServer( final String val ) { this.tcpServer = val; @@ -368,7 +359,6 @@ public class TCPLateralCacheAttributes * * @param val The new tcpServers value */ - @Override public void setTcpServers( final String val ) { this.tcpServers = val; @@ -379,7 +369,6 @@ public class TCPLateralCacheAttributes * * @param udpDiscoveryAddr The udpDiscoveryAddr to set. */ - @Override public void setUdpDiscoveryAddr( final String udpDiscoveryAddr ) { this.udpDiscoveryAddr = udpDiscoveryAddr; @@ -391,7 +380,6 @@ public class TCPLateralCacheAttributes * * @param udpDiscoveryEnabled The udpDiscoveryEnabled to set. */ - @Override public void setUdpDiscoveryEnabled( final boolean udpDiscoveryEnabled ) { this.udpDiscoveryEnabled = udpDiscoveryEnabled; @@ -402,7 +390,6 @@ public class TCPLateralCacheAttributes * * @param udpDiscoveryPort The udpDiscoveryPort to set. */ - @Override public void setUdpDiscoveryPort( final int udpDiscoveryPort ) { this.udpDiscoveryPort = udpDiscoveryPort; @@ -414,7 +401,6 @@ public class TCPLateralCacheAttributes * @param udpTTL The udpTTL to set. * @since 3.1 */ - @Override public void setUdpTTL( final int udpTTL ) { this.udpTTL = udpTTL; diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/behavior/ITCPLateralCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/behavior/ITCPLateralCacheAttributes.java index 384cc0b9..6a8368a4 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/behavior/ITCPLateralCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/behavior/ITCPLateralCacheAttributes.java @@ -131,117 +131,4 @@ public interface ITCPLateralCacheAttributes * @return the udpDiscoveryEnabled. */ boolean isUdpDiscoveryEnabled(); - - /** - * Is the lateral allowed to try and get from other laterals. - * <p> - * This replaces the old putOnlyMode - * - * @param allowGet - */ - void setAllowGet( boolean allowGet ); - - /** - * Is the lateral allowed to put objects to other laterals. - * - * @param allowPut - */ - void setAllowPut( boolean allowPut ); - - /** - * Should the receiver try to match hash codes. If true, the receiver will - * see if the client supplied a hash code. If it did, then it will try to get - * the item locally. If the item exists, then it will compare the hash code. - * if they are the same, it will not remove. This isn't perfect since - * different objects can have the same hash code, but it is unlikely of - * objects of the same type. - * - * @param filter - */ - void setFilterRemoveByHashCode( boolean filter ); - - /** - * Should the client send a remove command rather than a put when update is - * called. This is a client option, not a receiver option. This allows you - * to prevent the lateral from serializing objects. - * - * @param issueRemoveOnPut - */ - void setIssueRemoveOnPut( boolean issueRemoveOnPut ); - - /** - * @param openTimeOut the openTimeOut to set - */ - void setOpenTimeOut( int openTimeOut ); - - /** - * @param socketTimeOut the socketTimeOut to set - */ - void setSocketTimeOut( int socketTimeOut ); - - /** - * Sets the tcpListenerHost attribute of the ILateralCacheAttributes object - * - * @param val - * The new tcpListenerHost value - */ - void setTcpListenerHost( String val ); - - /** - * Sets the tcpListenerPort attribute of the ILateralCacheAttributes object - * - * @param val - * The new tcpListenerPort value - */ - void setTcpListenerPort( int val ); - - /** - * Sets the tcpServer attribute of the ILateralCacheAttributes object - * - * @param val - * The new tcpServer value - */ - void setTcpServer( String val ); - - /** - * Sets the tcpServers attribute of the ILateralCacheAttributes object - * - * @param val - * The new tcpServers value - */ - void setTcpServers( String val ); - - /** - * Sets the address to broadcast to if UDPDiscovery is enabled. - * - * @param udpDiscoveryAddr - * The udpDiscoveryAddr to set. - */ - void setUdpDiscoveryAddr( String udpDiscoveryAddr ); - - /** - * Can setup UDP Discovery. This only works for TCp laterals right now. It - * allows TCP laterals to find each other by broadcasting to a multicast - * port. - * - * @param udpDiscoveryEnabled - * The udpDiscoveryEnabled to set. - */ - void setUdpDiscoveryEnabled( boolean udpDiscoveryEnabled ); - - /** - * Sets the port to use if UDPDiscovery is enabled. - * - * @param udpDiscoveryPort - * The udpDiscoveryPort to set. - */ - void setUdpDiscoveryPort( int udpDiscoveryPort ); - - /** - * Sets the time-to-live for the UDP multicast packet - * - * @param udpTTL The udpTTL to set. - * @since 3.1 - */ - void setUdpTTL( final int udpTTL ); } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java index abade09d..99a5d945 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/AbstractRemoteCacheNoWaitFacade.java @@ -51,7 +51,7 @@ public abstract class AbstractRemoteCacheNoWaitFacade<K, V> protected List<RemoteCacheNoWait<K, V>> noWaits; /** Holds failover and cluster information */ - private final IRemoteCacheAttributes remoteCacheAttributes; + private final RemoteCacheAttributes remoteCacheAttributes; /** * Constructs with the given remote cache, and fires events to any listeners. @@ -65,7 +65,7 @@ public abstract class AbstractRemoteCacheNoWaitFacade<K, V> final ICacheEventLogger cacheEventLogger, final IElementSerializer elementSerializer ) { log.debug( "CONSTRUCTING NO WAIT FACADE" ); - this.remoteCacheAttributes = rca; + this.remoteCacheAttributes = (RemoteCacheAttributes)rca; setCacheEventLogger( cacheEventLogger ); setElementSerializer( elementSerializer ); this.noWaits = new ArrayList<>(noWaits); @@ -111,7 +111,7 @@ public abstract class AbstractRemoteCacheNoWaitFacade<K, V> * @return the AuxiliaryCacheAttributes. */ @Override - public IRemoteCacheAttributes getAuxiliaryCacheAttributes() + public RemoteCacheAttributes getAuxiliaryCacheAttributes() { return this.remoteCacheAttributes; } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/CommonRemoteCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/CommonRemoteCacheAttributes.java index bc5c0865..5b556ffc 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/CommonRemoteCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/CommonRemoteCacheAttributes.java @@ -167,7 +167,6 @@ public class CommonRemoteCacheAttributes * * @param s The new clusterServers value */ - @Override public void setClusterServers( final String s ) { this.clusterServers = s; @@ -177,7 +176,6 @@ public class CommonRemoteCacheAttributes * Sets the getOnly attribute of the RemoteCacheAttributes object * @param r The new getOnly value */ - @Override public void setGetOnly( final boolean r ) { this.getOnly = r; @@ -188,7 +186,6 @@ public class CommonRemoteCacheAttributes * * @param r The new localClusterConsistency value */ - @Override public void setLocalClusterConsistency( final boolean r ) { this.localClusterConsistency = r; @@ -199,7 +196,6 @@ public class CommonRemoteCacheAttributes * * @param location The new location value */ - @Override public void setRemoteLocation( final RemoteLocation location ) { this.location = location; @@ -211,7 +207,6 @@ public class CommonRemoteCacheAttributes * @param host The new remoteHost value * @param port The new remotePort value */ - @Override public void setRemoteLocation( final String host, final int port ) { this.location = new RemoteLocation(host, port); @@ -222,7 +217,6 @@ public class CommonRemoteCacheAttributes * * @param s The new remoteServiceName value */ - @Override public void setRemoteServiceName( final String s ) { this.remoteServiceName = s; @@ -233,7 +227,6 @@ public class CommonRemoteCacheAttributes * * @param p The new remoteType value */ - @Override public void setRemoteType( final RemoteType p ) { this.remoteType = p; @@ -244,7 +237,6 @@ public class CommonRemoteCacheAttributes * * @param s The new remoteTypeName value */ - @Override public void setRemoteTypeName( final String s ) { this.remoteType = RemoteType.valueOf(s); @@ -255,7 +247,6 @@ public class CommonRemoteCacheAttributes * * @param r The new removeUponRemotePut value */ - @Override public void setRemoveUponRemotePut( final boolean r ) { this.removeUponRemotePut = r; @@ -264,7 +255,6 @@ public class CommonRemoteCacheAttributes /** * @param rmiSocketFactoryTimeoutMillis The rmiSocketFactoryTimeoutMillis to set. */ - @Override public void setRmiSocketFactoryTimeoutMillis( final int rmiSocketFactoryTimeoutMillis ) { this.rmiSocketFactoryTimeoutMillis = rmiSocketFactoryTimeoutMillis; diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheAttributes.java index f4c34c46..a92caec7 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheAttributes.java @@ -165,7 +165,6 @@ public class RemoteCacheAttributes * * @param p The new failoverIndex value */ - @Override public void setFailoverIndex( final int p ) { this.failoverIndex = p; @@ -176,7 +175,6 @@ public class RemoteCacheAttributes * * @param failovers The new failovers value */ - @Override public void setFailovers( final List<RemoteLocation> failovers ) { this.failovers = failovers; @@ -187,7 +185,6 @@ public class RemoteCacheAttributes * * @param s The new failoverServers value */ - @Override public void setFailoverServers( final String s ) { this.failoverServers = s; @@ -196,7 +193,6 @@ public class RemoteCacheAttributes /** * @param millis */ - @Override public void setGetTimeoutMillis( final int millis ) { getTimeoutMillis = millis; @@ -206,7 +202,6 @@ public class RemoteCacheAttributes * Sets the localPort attribute of the RemoteCacheAttributes object * @param p The new localPort value */ - @Override public void setLocalPort( final int p ) { this.localPort = p; @@ -218,7 +213,6 @@ public class RemoteCacheAttributes * * @param receive */ - @Override public void setReceive( final boolean receive ) { this.receive = receive; @@ -227,7 +221,6 @@ public class RemoteCacheAttributes /** * @param name */ - @Override public void setThreadPoolName( final String name ) { threadPoolName = name; @@ -239,7 +232,6 @@ public class RemoteCacheAttributes * * @param zombieQueueMaxSize The zombieQueueMaxSize to set. */ - @Override public void setZombieQueueMaxSize( final int zombieQueueMaxSize ) { this.zombieQueueMaxSize = zombieQueueMaxSize; diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheNoWaitFacade.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheNoWaitFacade.java index d0af2d71..b6d737c0 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheNoWaitFacade.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheNoWaitFacade.java @@ -98,7 +98,7 @@ public class RemoteCacheNoWaitFacade<K, V> */ protected void connectAndRestore() { - final IRemoteCacheAttributes rca0 = getAuxiliaryCacheAttributes(); + final RemoteCacheAttributes rca0 = getAuxiliaryCacheAttributes(); // Each RemoteCacheManager corresponds to one remote connection. final List<RemoteLocation> failovers = rca0.getFailovers(); // we should probably check to see if there are any failovers, @@ -286,7 +286,7 @@ public class RemoteCacheNoWaitFacade<K, V> */ private boolean restorePrimary() { - final IRemoteCacheAttributes rca0 = getAuxiliaryCacheAttributes(); + final RemoteCacheAttributes rca0 = getAuxiliaryCacheAttributes(); // try to move back to the primary final RemoteLocation server = rca0.getFailovers().get(0); diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java index eca05230..52c6cc3a 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/behavior/ICommonRemoteCacheAttributes.java @@ -97,76 +97,4 @@ public interface ICommonRemoteCacheAttributes * @return The localClusterConsistency value */ boolean isLocalClusterConsistency(); - - /** - * Sets the clusterServers attribute of the IRemoteCacheAttributes object - * - * @param s The new clusterServers value - */ - void setClusterServers( String s ); - - /** - * Sets the getOnly attribute of the IRemoteCacheAttributes object - * - * @param r The new getOnly value - */ - void setGetOnly( boolean r ); - - /** - * Should cluster updates be propagated to the locals - * - * @param r The new localClusterConsistency value - */ - void setLocalClusterConsistency( boolean r ); - - /** - * Sets the location attribute of the RemoteCacheAttributes object. - * - * @param location The new location value - */ - void setRemoteLocation( RemoteLocation location ); - - /** - * Sets the location attribute of the RemoteCacheAttributes object. - * - * @param host The new remoteHost value - * @param port The new remotePort value - */ - void setRemoteLocation( String host, int port ); - - /** - * Sets the remoteServiceName attribute of the IRemoteCacheAttributes object - * - * @param s The new remoteServiceName value - */ - void setRemoteServiceName( String s ); - - /** - * Sets the remoteType attribute of the IRemoteCacheAttributes object - * - * @param p The new remoteType value - */ - void setRemoteType( RemoteType p ); - - /** - * Sets the remoteTypeName attribute of the IRemoteCacheAttributes object - * - * @param s The new remoteTypeName value - */ - void setRemoteTypeName( String s ); - - /** - * Sets the removeUponRemotePut attribute of the IRemoteCacheAttributes object - * - * @param r The new removeUponRemotePut value - */ - void setRemoveUponRemotePut( boolean r ); - - /** - * This sets a general timeout on the RMI socket factory. By default the socket factory will - * block forever. - * - * @param rmiSocketFactoryTimeoutMillis - */ - void setRmiSocketFactoryTimeoutMillis( int rmiSocketFactoryTimeoutMillis ); } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/behavior/IRemoteCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/behavior/IRemoteCacheAttributes.java index d13823ae..81ddc7b1 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/behavior/IRemoteCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/behavior/IRemoteCacheAttributes.java @@ -139,63 +139,4 @@ public interface IRemoteCacheAttributes * @return the receive value. */ boolean isReceive(); - - /** - * Sets the failoverIndex attribute of the IRemoteCacheAttributes object - * - * @param p The new failoverIndex value - */ - void setFailoverIndex( int p ); - - /** - * Sets the failovers attribute of the IRemoteCacheAttributes object - * - * @param failovers The new failovers value - */ - void setFailovers( List<RemoteLocation> failovers ); - - /** - * Sets the failoverServers attribute of the IRemoteCacheAttributes object - * - * @param s The new failoverServers value - */ - void setFailoverServers( String s ); - - /** - * -1 means no timeout, this is the default if the timeout is -1 or 0, no threadpool will be - * used. If the timeout is greater than 0 a threadpool will be used for get requests. - * - * @param millis - */ - void setGetTimeoutMillis( int millis ); - - /** - * Sets the localPort attribute of the IRemoteCacheAttributes object - * - * @param p The new localPort value - */ - void setLocalPort( int p ); - - /** - * By default this option is true. If you set it to false, you will not receive updates or - * removes from the remote server. - * - * @param receive - */ - void setReceive( boolean receive ); - - /** - * Sets the name of the pool to use. Pools should be defined in the cache.ccf. - * - * @param name - */ - void setThreadPoolName( String name ); - - /** - * The number of elements the zombie queue will hold. This queue is used to store events if we - * loose our connection with the server. - * - * @param zombieQueueMaxSize The zombieQueueMaxSize to set. - */ - void setZombieQueueMaxSize( int zombieQueueMaxSize ); } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/server/RemoteCacheServerAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/server/RemoteCacheServerAttributes.java index 059ab8cd..982e49e7 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/server/RemoteCacheServerAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/server/RemoteCacheServerAttributes.java @@ -113,7 +113,6 @@ public class RemoteCacheServerAttributes * * @param r The new localClusterConsistency value */ - @Override public void setAllowClusterGet( final boolean r ) { allowClusterGet = r; @@ -124,7 +123,6 @@ public class RemoteCacheServerAttributes * * @param s The new clusterServers value */ - @Override public void setConfigFileName( final String s ) { configFileName = s; @@ -133,7 +131,6 @@ public class RemoteCacheServerAttributes /** * @param registryKeepAliveDelayMillis the registryKeepAliveDelayMillis to set */ - @Override public void setRegistryKeepAliveDelayMillis( final long registryKeepAliveDelayMillis ) { this.registryKeepAliveDelayMillis = registryKeepAliveDelayMillis; @@ -144,7 +141,6 @@ public class RemoteCacheServerAttributes * * @param p The new localPort value */ - @Override public void setServicePort( final int p ) { this.servicePort = p; @@ -155,7 +151,6 @@ public class RemoteCacheServerAttributes * * @param useRegistryKeepAlive the useRegistryKeepAlive to set */ - @Override public void setUseRegistryKeepAlive( final boolean useRegistryKeepAlive ) { this.useRegistryKeepAlive = useRegistryKeepAlive; diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/server/behavior/IRemoteCacheServerAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/server/behavior/IRemoteCacheServerAttributes.java index 55f98801..85bcb88d 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/server/behavior/IRemoteCacheServerAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/auxiliary/remote/server/behavior/IRemoteCacheServerAttributes.java @@ -65,40 +65,4 @@ public interface IRemoteCacheServerAttributes * @return the useRegistryKeepAlive */ boolean isUseRegistryKeepAlive(); - - /** - * Should cluster updates be propagated to the locals. - * - * @param r - * The new localClusterConsistency value - */ - void setAllowClusterGet( boolean r ); - - /** - * Sets the ConfigFileName attribute of the IRemoteCacheAttributes object. - * - * @param s - * The new configuration file name - */ - void setConfigFileName( String s ); - - /** - * @param registryKeepAliveDelayMillis the registryKeepAliveDelayMillis to set - */ - void setRegistryKeepAliveDelayMillis( long registryKeepAliveDelayMillis ); - - /** - * Sets the localPort attribute of the IRemoteCacheAttributes object. - * - * @param p - * The new localPort value - */ - void setServicePort( int p ); - - /** - * Should we try to keep the registry alive - * - * @param useRegistryKeepAlive the useRegistryKeepAlive to set - */ - void setUseRegistryKeepAlive( boolean useRegistryKeepAlive ); } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/CompositeCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/CompositeCacheAttributes.java index 9bff16cf..c30f6560 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/CompositeCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/CompositeCacheAttributes.java @@ -37,9 +37,6 @@ public class CompositeCacheAttributes /** Default lateral switch */ private static final boolean DEFAULT_USE_LATERAL = true; - /** Default remote switch */ - private static final boolean DEFAULT_USE_REMOTE = true; - /** Default disk switch */ private static final boolean DEFAULT_USE_DISK = true; @@ -67,9 +64,6 @@ public class CompositeCacheAttributes /** Allow lateral caches */ private boolean useLateral = DEFAULT_USE_LATERAL; - /** Allow remote caches */ - private boolean useRemote = DEFAULT_USE_REMOTE; - /** Whether we should use a disk cache if it is configured. */ private boolean useDisk = DEFAULT_USE_DISK; @@ -246,17 +240,6 @@ public class CompositeCacheAttributes return this.useMemoryShrinker; } - /** - * Gets the useRemote attribute of the CompositeCacheAttributes object - * - * @return The useRemote value - */ - @Override - public boolean isUseRemote() - { - return this.useRemote; - } - /** * Sets the cacheName attribute of the CompositeCacheAttributes object * @@ -273,7 +256,6 @@ public class CompositeCacheAttributes * * @param diskUsagePattern The diskUsagePattern to set. */ - @Override public void setDiskUsagePattern( final DiskUsagePattern diskUsagePattern ) { this.diskUsagePattern = diskUsagePattern; @@ -286,7 +268,6 @@ public class CompositeCacheAttributes * * @param diskUsagePatternName The diskUsagePattern to set. */ - @Override public void setDiskUsagePatternName( final String diskUsagePatternName ) { if ( diskUsagePatternName != null ) @@ -308,7 +289,6 @@ public class CompositeCacheAttributes * * @param seconds The new MaxMemoryIdleTimeSeconds value */ - @Override public void setMaxMemoryIdleTimeSeconds( final long seconds ) { this.maxMemoryIdleTimeSeconds = seconds; @@ -319,7 +299,6 @@ public class CompositeCacheAttributes * * @param maxObjs The new maxObjects value */ - @Override public void setMaxObjects( final int maxObjs ) { this.maxObjs = maxObjs; @@ -333,7 +312,6 @@ public class CompositeCacheAttributes * * @param maxSpoolPerRun The new maxSpoolPerRun value */ - @Override public void setMaxSpoolPerRun( final int maxSpoolPerRun ) { this.maxSpoolPerRun = maxSpoolPerRun; @@ -344,7 +322,6 @@ public class CompositeCacheAttributes * * @param s The new memoryCacheName value */ - @Override public void setMemoryCacheName( final String s ) { this.memoryCacheName = s; @@ -356,7 +333,6 @@ public class CompositeCacheAttributes * * @param seconds The new ShrinkerIntervalSeconds value */ - @Override public void setShrinkerIntervalSeconds( final long seconds ) { this.shrinkerIntervalSeconds = seconds; @@ -367,7 +343,6 @@ public class CompositeCacheAttributes * * @param spoolChunkSize */ - @Override public void setSpoolChunkSize( final int spoolChunkSize ) { this.spoolChunkSize = spoolChunkSize; @@ -378,7 +353,6 @@ public class CompositeCacheAttributes * * @param useDisk The new useDisk value */ - @Override public void setUseDisk( final boolean useDisk ) { this.useDisk = useDisk; @@ -389,7 +363,6 @@ public class CompositeCacheAttributes * * @param b The new useLateral value */ - @Override public void setUseLateral( final boolean b ) { this.useLateral = b; @@ -400,23 +373,11 @@ public class CompositeCacheAttributes * * @param useShrinker The new UseMemoryShrinker value */ - @Override public void setUseMemoryShrinker( final boolean useShrinker ) { this.useMemoryShrinker = useShrinker; } - /** - * Sets the useRemote attribute of the CompositeCacheAttributes object - * - * @param useRemote The new useRemote value - */ - @Override - public void setUseRemote( final boolean useRemote ) - { - this.useRemote = useRemote; - } - /** * Dumps the core attributes. * @@ -429,7 +390,6 @@ public class CompositeCacheAttributes dump.append( "[ " ); dump.append( "useLateral = " ).append( useLateral ); - dump.append( ", useRemote = " ).append( useRemote ); dump.append( ", useDisk = " ).append( useDisk ); dump.append( ", maxObjs = " ).append( maxObjs ); dump.append( ", maxSpoolPerRun = " ).append( maxSpoolPerRun ); diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/ElementAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/ElementAttributes.java index 025e313a..7cf67ab7 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/ElementAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/ElementAttributes.java @@ -334,7 +334,6 @@ public class ElementAttributes * removed on retrieval, or removed actively if the memory shrinker is turned on. * @param idle The new idleTime value */ - @Override public void setIdleTime( final long idle ) { this.maxIdleTime = idle; @@ -347,7 +346,6 @@ public class ElementAttributes * * @param val The new isEternal value */ - @Override public void setIsEternal( final boolean val ) { this.IS_ETERNAL = val; @@ -359,7 +357,6 @@ public class ElementAttributes * By default this is true. * @param val The new isLateral value */ - @Override public void setIsLateral( final boolean val ) { this.IS_LATERAL = val; @@ -369,7 +366,6 @@ public class ElementAttributes * Sets the isRemote attribute of the ElementAttributes object * @param val The new isRemote value */ - @Override public void setIsRemote( final boolean val ) { this.IS_REMOTE = val; @@ -381,7 +377,6 @@ public class ElementAttributes * By default this is true. * @param val The new isSpool value */ - @Override public void setIsSpool( final boolean val ) { this.IS_SPOOL = val; @@ -409,7 +404,6 @@ public class ElementAttributes * * @param mls The new MaxLifeSeconds value */ - @Override public void setMaxLife(final long mls) { this.maxLife = mls; @@ -421,13 +415,11 @@ public class ElementAttributes * * @param size The new size value */ - @Override public void setSize( final int size ) { this.size = size; } - @Override public void setTimeFactorForMilliseconds(final long factor) { this.timeFactor = factor; diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/behavior/ICompositeCacheAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/behavior/ICompositeCacheAttributes.java index e192f676..5ec4ade5 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/behavior/ICompositeCacheAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/behavior/ICompositeCacheAttributes.java @@ -123,13 +123,6 @@ public interface ICompositeCacheAttributes */ boolean isUseMemoryShrinker(); - /** - * returns whether the cache is remote enabled - * - * @return The useRemote value - */ - boolean isUseRemote(); - /** * Sets the name of the cache, referenced by the appropriate manager. * @@ -137,108 +130,4 @@ public interface ICompositeCacheAttributes * The new cacheName value */ void setCacheName( String s ); - - /** - * By default this is SWAP_ONLY. - * - * @param diskUsagePattern The diskUsagePattern to set. - */ - void setDiskUsagePattern( DiskUsagePattern diskUsagePattern ); - - /** - * Translates the name to the disk usage pattern short value. - * <p> - * The allowed values are SWAP and UPDATE. - * - * @param diskUsagePatternName The diskUsagePattern to set. - */ - void setDiskUsagePatternName( String diskUsagePatternName ); - - /** - * If UseMemoryShrinker is true the memory cache should auto-expire elements - * to reclaim space. - * - * @param seconds - * The new MaxMemoryIdleTimeSeconds value - */ - void setMaxMemoryIdleTimeSeconds( long seconds ); - - /** - * SetMaxObjects is used to set the attribute to determine the maximum - * number of objects allowed in the memory cache. If the max number of - * objects or the cache size is set, the default for the one not set is - * ignored. If both are set, both are used to determine the capacity of the - * cache, i.e., object will be removed from the cache if either limit is - * reached. TODO: move to MemoryCache config file. - * - * @param size - * The new maxObjects value - */ - void setMaxObjects( int size ); - - /** - * If UseMemoryShrinker is true the memory cache should auto-expire elements - * to reclaim space. This sets the maximum number of items to spool per run. - * - * @param maxSpoolPerRun - * The new maxSpoolPerRun value - */ - void setMaxSpoolPerRun( int maxSpoolPerRun ); - - /** - * Sets the name of the MemoryCache, referenced by the appropriate manager. - * TODO: create a separate memory cache attribute class. - * - * @param s - * The new memoryCacheName value - */ - void setMemoryCacheName( String s ); - - /** - * If UseMemoryShrinker is true the memory cache should auto-expire elements - * to reclaim space. This sets the shrinker interval. - * - * @param seconds - * The new ShrinkerIntervalSeconds value - */ - void setShrinkerIntervalSeconds( long seconds ); - - /** - * Number to send to disk at a time. - * - * @param spoolChunkSize - */ - void setSpoolChunkSize( int spoolChunkSize ); - - /** - * Sets the useDisk attribute of the ICompositeCacheAttributes object - * - * @param useDisk - * The new useDisk value - */ - void setUseDisk( boolean useDisk ); - - /** - * Sets whether the cache should use a lateral cache - * - * @param d - * The new useLateral value - */ - void setUseLateral( boolean d ); - - /** - * Sets whether the memory cache should perform background memory shrinkage. - * - * @param useShrinker - * The new UseMemoryShrinker value - */ - void setUseMemoryShrinker( boolean useShrinker ); - - /** - * Sets whether the cache is remote enabled - * - * @param isRemote - * The new useRemote value - */ - void setUseRemote( boolean isRemote ); } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/behavior/IElementAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/behavior/IElementAttributes.java index a624a718..e6c8ceee 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/behavior/IElementAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/behavior/IElementAttributes.java @@ -156,30 +156,6 @@ public interface IElementAttributes extends Serializable, Cloneable */ void setIsEternal( boolean val ); - /** - * Sets the isLateral attribute of the IElementAttributes object - * <p> - * By default this is true. - * @param val The new isLateral value - */ - void setIsLateral( boolean val ); - - /** - * Sets the isRemote attribute of the IElementAttributes object. - * <p> - * By default this is true. - * @param val The new isRemote value - */ - void setIsRemote( boolean val ); - - /** - * Sets the isSpool attribute of the IElementAttributes object - * <p> - * By default this is true. - * @param val The new isSpool value - */ - void setIsSpool( boolean val ); - /** * Sets the LastAccessTime as now of the IElementAttributes object */ diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/control/CompositeCacheConfigurator.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/control/CompositeCacheConfigurator.java index 085b0faa..d41e2c16 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/control/CompositeCacheConfigurator.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/engine/control/CompositeCacheConfigurator.java @@ -267,9 +267,6 @@ public class CompositeCacheConfigurator ccAttr.setCacheName( regName ); log.debug( "End of parsing for \"{0}\"", attrName ); - - // GET CACHE FROM FACTORY WITH ATTRIBUTES - ccAttr.setCacheName( regName ); return ccAttr; } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/io/ObjectInputStreamClassLoaderAware.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/io/ObjectInputStreamClassLoaderAware.java index 8680eae4..00bef68d 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/io/ObjectInputStreamClassLoaderAware.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/io/ObjectInputStreamClassLoaderAware.java @@ -52,20 +52,26 @@ public class ObjectInputStreamClassLoaderAware extends ObjectInputStream } @Override - protected Class<?> resolveClass(final ObjectStreamClass desc) throws ClassNotFoundException { + protected Class<?> resolveClass(final ObjectStreamClass desc) throws ClassNotFoundException + { return Class.forName(desc.getName(), false, classLoader); } @Override - protected Class<?> resolveProxyClass(final String[] interfaces) throws IOException, ClassNotFoundException { + protected Class<?> resolveProxyClass(final String[] interfaces) throws IOException, ClassNotFoundException + { final Class<?>[] cinterfaces = new Class[interfaces.length]; - for (int i = 0; i < interfaces.length; i++) { + for (int i = 0; i < interfaces.length; i++) + { cinterfaces[i] = Class.forName(interfaces[i], false, classLoader); } - try { + try + { return Proxy.getProxyClass(classLoader, cinterfaces); - } catch (final IllegalArgumentException e) { + } + catch (final IllegalArgumentException e) + { throw new ClassNotFoundException(null, e); } } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/utils/discovery/UDPDiscoveryAttributes.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/utils/discovery/UDPDiscoveryAttributes.java index 2f26a0f8..7c55965f 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/utils/discovery/UDPDiscoveryAttributes.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/utils/discovery/UDPDiscoveryAttributes.java @@ -34,26 +34,15 @@ public final class UDPDiscoveryAttributes /** Default udp discovery port */ private static final int DEFAULT_UDP_DISCOVERY_PORT = 5678; - /** Default delay between sending passive broadcasts */ - private static final int DEFAULT_SEND_DELAY_SEC = 60; - /** Default amount of time before we remove services that we haven't heard from */ private static final int DEFAULT_MAX_IDLE_TIME_SEC = 180; - /** Service name */ - private String serviceName; - /** Service address */ private String serviceAddress; /** Service port */ private int servicePort; - /** - * false -> this service instance is not ready to receive requests. true -> ready for use - */ - private boolean isDark; - /** Udp discovery address */ private String udpDiscoveryAddr = DEFAULT_UDP_DISCOVERY_ADDRESS; @@ -66,9 +55,6 @@ public final class UDPDiscoveryAttributes /** Udp datagram TTL */ private int udpTTL; - /** Delay between sending passive broadcasts */ - private int sendDelaySec = DEFAULT_SEND_DELAY_SEC; - /** Amount of time before we remove services that we haven't heard from */ private int maxIdleTimeSec = DEFAULT_MAX_IDLE_TIME_SEC; @@ -77,13 +63,10 @@ public final class UDPDiscoveryAttributes public UDPDiscoveryAttributes clone() { final UDPDiscoveryAttributes attributes = new UDPDiscoveryAttributes(); - attributes.setSendDelaySec( getSendDelaySec() ); attributes.setMaxIdleTimeSec( getMaxIdleTimeSec() ); - attributes.setServiceName( getServiceName() ); attributes.setServicePort( getServicePort() ); attributes.setUdpDiscoveryAddr( getUdpDiscoveryAddr() ); attributes.setUdpDiscoveryPort( getUdpDiscoveryPort() ); - attributes.setDark( isDark() ); return attributes; } @@ -95,14 +78,6 @@ public final class UDPDiscoveryAttributes return maxIdleTimeSec; } - /** - * @return the sendDelaySec. - */ - public int getSendDelaySec() - { - return sendDelaySec; - } - /** * @return the serviceAddress. */ @@ -111,14 +86,6 @@ public final class UDPDiscoveryAttributes return serviceAddress; } - /** - * @return the serviceName. - */ - public String getServiceName() - { - return serviceName; - } - /** * @return the servicePort. */ @@ -159,22 +126,6 @@ public final class UDPDiscoveryAttributes return udpTTL; } - /** - * @return the isDark. - */ - public boolean isDark() - { - return isDark; - } - - /** - * @param isDark The isDark to set. - */ - public void setDark( final boolean isDark ) - { - this.isDark = isDark; - } - /** * @param maxIdleTimeSec The maxIdleTimeSec to set. */ @@ -183,14 +134,6 @@ public final class UDPDiscoveryAttributes this.maxIdleTimeSec = maxIdleTimeSec; } - /** - * @param sendDelaySec The sendDelaySec to set. - */ - public void setSendDelaySec( final int sendDelaySec ) - { - this.sendDelaySec = sendDelaySec; - } - /** * @param serviceAddress The serviceAddress to set. */ @@ -199,14 +142,6 @@ public final class UDPDiscoveryAttributes this.serviceAddress = serviceAddress; } - /** - * @param serviceName The serviceName to set. - */ - public void setServiceName( final String serviceName ) - { - this.serviceName = serviceName; - } - /** * @param servicePort The servicePort to set. */ @@ -255,14 +190,11 @@ public final class UDPDiscoveryAttributes { final StringBuilder buf = new StringBuilder(); buf.append( "\n UDPDiscoveryAttributes" ); - buf.append( "\n ServiceName = [" + getServiceName() + "]" ); buf.append( "\n ServiceAddress = [" + getServiceAddress() + "]" ); buf.append( "\n ServicePort = [" + getServicePort() + "]" ); buf.append( "\n UdpDiscoveryAddr = [" + getUdpDiscoveryAddr() + "]" ); buf.append( "\n UdpDiscoveryPort = [" + getUdpDiscoveryPort() + "]" ); - buf.append( "\n SendDelaySec = [" + getSendDelaySec() + "]" ); buf.append( "\n MaxIdleTimeSec = [" + getMaxIdleTimeSec() + "]" ); - buf.append( "\n IsDark = [" + isDark() + "]" ); return buf.toString(); } } diff --git a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/utils/serialization/SerializationConversionUtil.java b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/utils/serialization/SerializationConversionUtil.java index 9580e13d..41a921e2 100644 --- a/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/utils/serialization/SerializationConversionUtil.java +++ b/commons-jcs4-core/src/main/java/org/apache/commons/jcs4/utils/serialization/SerializationConversionUtil.java @@ -105,7 +105,8 @@ public class SerializationConversionUtil } else { - if ( elementSerializer == null ) { + if ( elementSerializer == null ) + { // we could just use the default. throw new IOException( "Could not serialize object. The ElementSerializer is null." ); } diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/access/CacheAccessUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/access/CacheAccessUnitTest.java index 4fb2ff2c..7fc64b88 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/access/CacheAccessUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/access/CacheAccessUnitTest.java @@ -38,7 +38,6 @@ import org.apache.commons.jcs4.engine.CompositeCacheAttributes; import org.apache.commons.jcs4.engine.ElementAttributes; import org.apache.commons.jcs4.engine.behavior.ICacheElement; import org.apache.commons.jcs4.engine.behavior.ICompositeCacheAttributes; -import org.apache.commons.jcs4.engine.behavior.IElementAttributes; import org.junit.jupiter.api.Test; /** @@ -110,12 +109,12 @@ class CacheAccessUnitTest final String keyprefix1 = "MyPrefix1"; final String keyprefix2 = "MyPrefix2"; final String memoryCacheClassName = "org.apache.commons.jcs4.engine.memory.lru.LRUMemoryCache"; - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setMemoryCacheName( memoryCacheClassName ); cattr.setMaxObjects( maxMemorySize ); final long maxLife = 9876; - final IElementAttributes attr = new ElementAttributes(); + final ElementAttributes attr = new ElementAttributes(); attr.setMaxLife(maxLife); final CacheAccess<String, Integer> access = JCS.getInstance( "testGetMatching_Normal", cattr, attr ); @@ -165,12 +164,12 @@ class CacheAccessUnitTest final String keyprefix1 = "MyPrefix1"; final String keyprefix2 = "MyPrefix2"; final String memoryCacheClassName = "org.apache.commons.jcs4.engine.memory.lru.LRUMemoryCache"; - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setMemoryCacheName( memoryCacheClassName ); cattr.setMaxObjects( maxMemorySize ); final long maxLife = 9876; - final IElementAttributes attr = new ElementAttributes(); + final ElementAttributes attr = new ElementAttributes(); attr.setMaxLife(maxLife); final CacheAccess<String, Integer> access = JCS.getInstance( "testGetMatching_Normal", cattr, attr ); @@ -310,7 +309,7 @@ class CacheAccessUnitTest void testRegionDefinitonWithAttributes() throws Exception { - final ICompositeCacheAttributes ca = new CompositeCacheAttributes(); + final CompositeCacheAttributes ca = new CompositeCacheAttributes(); final long maxIdleTime = 8765; ca.setMaxMemoryIdleTimeSeconds( maxIdleTime ); @@ -331,13 +330,13 @@ class CacheAccessUnitTest void testRegionDefinitonWithBothAttributes() throws Exception { - final ICompositeCacheAttributes ca = new CompositeCacheAttributes(); + final CompositeCacheAttributes ca = new CompositeCacheAttributes(); final long maxIdleTime = 8765; ca.setMaxMemoryIdleTimeSeconds( maxIdleTime ); final long maxLife = 9876; - final IElementAttributes attr = new ElementAttributes(); + final ElementAttributes attr = new ElementAttributes(); attr.setMaxLife(maxLife); final CacheAccess<String, String> access = JCS.getInstance( "testRegionDefinitonWithAttributes", ca, attr ); @@ -359,7 +358,7 @@ class CacheAccessUnitTest assertNotNull( access, "We should have an access class" ); final long maxLife = 9876; - final IElementAttributes attr = new ElementAttributes(); + final ElementAttributes attr = new ElementAttributes(); attr.setMaxLife(maxLife); access.setDefaultElementAttributes( attr ); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/AbstractDiskCacheUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/AbstractDiskCacheUnitTest.java index 2fdc6dd1..d6d00c95 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/AbstractDiskCacheUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/AbstractDiskCacheUnitTest.java @@ -221,7 +221,7 @@ class AbstractDiskCacheUnitTest throws IOException { // SETUP - final IDiskCacheAttributes diskCacheAttributes = new IndexedDiskCacheAttributes(); + final IndexedDiskCacheAttributes diskCacheAttributes = new IndexedDiskCacheAttributes(); diskCacheAttributes.setAllowRemoveAll( true ); final AbstractDiskCacheTestInstance<String, String> diskCache = new AbstractDiskCacheTestInstance<>( diskCacheAttributes ); @@ -254,7 +254,7 @@ class AbstractDiskCacheUnitTest final StringWriter stringWriter = new StringWriter(); TestLogConfigurationUtil.configureLogger( stringWriter, AbstractDiskCache.class.getName() ); - final IDiskCacheAttributes diskCacheAttributes = new IndexedDiskCacheAttributes(); + final IndexedDiskCacheAttributes diskCacheAttributes = new IndexedDiskCacheAttributes(); diskCacheAttributes.setAllowRemoveAll( false ); final AbstractDiskCacheTestInstance<String, String> diskCache = new AbstractDiskCacheTestInstance<>( diskCacheAttributes ); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/block/AbstractBlockDiskCacheUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/block/AbstractBlockDiskCacheUnitTest.java index 79f325e6..71e7d59f 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/block/AbstractBlockDiskCacheUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/block/AbstractBlockDiskCacheUnitTest.java @@ -33,7 +33,6 @@ import java.util.Map; import org.apache.commons.jcs4.engine.CacheElement; import org.apache.commons.jcs4.engine.ElementAttributes; import org.apache.commons.jcs4.engine.behavior.ICacheElement; -import org.apache.commons.jcs4.engine.behavior.IElementAttributes; import org.apache.commons.jcs4.engine.control.group.GroupAttrName; import org.apache.commons.jcs4.engine.control.group.GroupId; import org.apache.commons.jcs4.utils.serialization.StandardSerializer; @@ -337,7 +336,7 @@ public abstract class AbstractBlockDiskCacheUnitTest{ final CacheElement<GroupAttrName<String>, String> element = new CacheElement<>(cacheName, groupAttrName, "data:" + i); - final IElementAttributes eAttr = new ElementAttributes(); + final ElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool(true); element.setElementAttributes(eAttr); @@ -387,7 +386,7 @@ public abstract class AbstractBlockDiskCacheUnitTest{ final int cnt = 25; for (int i = 0; i < cnt; i++) { - final IElementAttributes eAttr = new ElementAttributes(); + final ElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool(true); final ICacheElement<String, String> element = new CacheElement<>("testRemove_PartialKey", i + ":key", "data:" + i); @@ -430,7 +429,7 @@ public abstract class AbstractBlockDiskCacheUnitTest{ final int cnt = 25; for (int i = 0; i < cnt; i++) { - final IElementAttributes eAttr = new ElementAttributes(); + final ElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool(true); final ICacheElement<String, String> element = new CacheElement<>("testRemoveItems", "key:" + i, "data:" + i); element.setElementAttributes(eAttr); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/indexed/AbstractIndexDiskCacheUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/indexed/AbstractIndexDiskCacheUnitTest.java index 07c78e3f..cb936df9 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/indexed/AbstractIndexDiskCacheUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/indexed/AbstractIndexDiskCacheUnitTest.java @@ -38,7 +38,6 @@ import org.apache.commons.jcs4.auxiliary.disk.DiskTestObject; import org.apache.commons.jcs4.engine.CacheElement; import org.apache.commons.jcs4.engine.ElementAttributes; import org.apache.commons.jcs4.engine.behavior.ICacheElement; -import org.apache.commons.jcs4.engine.behavior.IElementAttributes; import org.apache.commons.jcs4.engine.control.group.GroupAttrName; import org.apache.commons.jcs4.engine.control.group.GroupId; import org.apache.commons.jcs4.utils.timing.SleepUtil; @@ -705,7 +704,7 @@ public abstract class AbstractIndexDiskCacheUnitTest{ final CacheElement<GroupAttrName<String>, String> element = new CacheElement<>(cacheName, groupAttrName, "data:" + i); - final IElementAttributes eAttr = new ElementAttributes(); + final ElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool(true); element.setElementAttributes(eAttr); @@ -755,7 +754,7 @@ public abstract class AbstractIndexDiskCacheUnitTest{ final int cnt = 25; for (int i = 0; i < cnt; i++) { - final IElementAttributes eAttr = new ElementAttributes(); + final ElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool(true); final ICacheElement<String, String> element = new CacheElement<>("testRemove_PartialKey", i + ":key", "data:" + i); @@ -829,7 +828,7 @@ public abstract class AbstractIndexDiskCacheUnitTest{ final int cnt = 25; for (int i = 0; i < cnt; i++) { - final IElementAttributes eAttr = new ElementAttributes(); + final ElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool(true); final ICacheElement<String, String> element = new CacheElement<>("testRemoveItems", "key:" + i, "data:" + i); element.setElementAttributes(eAttr); @@ -864,7 +863,7 @@ public abstract class AbstractIndexDiskCacheUnitTest{ final int cnt = 999; for (int i = 0; i < cnt; i++) { - final IElementAttributes eAttr = new ElementAttributes(); + final ElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool(true); final ICacheElement<String, String> element = new CacheElement<>("testSimplePutAndGet", "key:" + i, "data:" + i); element.setElementAttributes(eAttr); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java index 91ff0e45..01fd5636 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java @@ -7,7 +7,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.apache.commons.jcs4.engine.CacheElement; import org.apache.commons.jcs4.engine.ElementAttributes; import org.apache.commons.jcs4.engine.behavior.ICacheElement; -import org.apache.commons.jcs4.engine.behavior.IElementAttributes; import org.junit.jupiter.api.Test; /* @@ -57,7 +56,7 @@ class IndexedDiskCacheKeyStoreUnitTest final int cnt = 25; for ( int i = 0; i < cnt; i++ ) { - final IElementAttributes eAttr = new ElementAttributes(); + final ElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool( true ); final ICacheElement<String, String> element = new CacheElement<>( cattr.getCacheName(), "key:" + i, "data:" + i ); element.setElementAttributes( eAttr ); @@ -66,7 +65,7 @@ class IndexedDiskCacheKeyStoreUnitTest final long preAddRemoveSize = disk.getDataFileSize(); - final IElementAttributes eAttr = new ElementAttributes(); + final ElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool( true ); final ICacheElement<String, String> elementSetup = new CacheElement<>( cattr.getCacheName(), "key:A", "data:A" ); elementSetup.setElementAttributes( eAttr ); @@ -116,7 +115,7 @@ class IndexedDiskCacheKeyStoreUnitTest final int cnt = 25; for ( int i = 0; i < cnt; i++ ) { - final IElementAttributes eAttr = new ElementAttributes(); + final ElementAttributes eAttr = new ElementAttributes(); eAttr.setIsSpool( true ); final ICacheElement<String, String> element = new CacheElement<>( cattr.getCacheName(), "key:" + i, "data:" + i ); element.setElementAttributes( eAttr ); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java index bf37c555..e5dc9c73 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPConcurrentRandomTestUtil.java @@ -26,7 +26,6 @@ import java.util.Random; import org.apache.commons.jcs4.JCS; import org.apache.commons.jcs4.access.CacheAccess; -import org.apache.commons.jcs4.auxiliary.lateral.LateralCacheAttributes; import org.apache.commons.jcs4.engine.CacheElement; import org.apache.commons.jcs4.engine.behavior.ICacheElement; import org.apache.commons.jcs4.utils.serialization.StandardSerializer; @@ -72,7 +71,6 @@ public class LateralTCPConcurrentRandomTestUtil final TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes(); lattr2.setTcpListenerPort( 1103 ); - lattr2.setTransmissionType(LateralCacheAttributes.Type.TCP); lattr2.setTcpServer( "localhost:1102" ); // this service will put and remove using the lateral to diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java index 504b16b5..0cee54d1 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPDiscoveryListenerUnitTest.java @@ -28,7 +28,6 @@ import java.util.List; import org.apache.commons.jcs4.auxiliary.lateral.LateralCache; import org.apache.commons.jcs4.auxiliary.lateral.LateralCacheNoWait; import org.apache.commons.jcs4.auxiliary.lateral.LateralCacheNoWaitFacade; -import org.apache.commons.jcs4.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes; import org.apache.commons.jcs4.engine.ZombieCacheServiceNonLocal; import org.apache.commons.jcs4.engine.behavior.IElementSerializer; import org.apache.commons.jcs4.engine.control.CompositeCacheManager; @@ -75,7 +74,7 @@ class LateralTCPDiscoveryListenerUnitTest private LateralCacheNoWaitFacade<String, String> setupFacade(final String cacheName) { final List<LateralCacheNoWait<String, String>> noWaits = new ArrayList<>(); - final ITCPLateralCacheAttributes cattr = new TCPLateralCacheAttributes(); + final TCPLateralCacheAttributes cattr = new TCPLateralCacheAttributes(); cattr.setCacheName( cacheName ); return new LateralCacheNoWaitFacade<>( null, noWaits, cattr ); @@ -83,7 +82,7 @@ class LateralTCPDiscoveryListenerUnitTest private LateralCacheNoWait<String, String> setupNoWait(final String cacheName) { - final ITCPLateralCacheAttributes cattr = new TCPLateralCacheAttributes(); + final TCPLateralCacheAttributes cattr = new TCPLateralCacheAttributes(); cattr.setCacheName( cacheName ); final LateralCache<String, String> cache = new LateralCache<>(cattr, new ZombieCacheServiceNonLocal<>(), null); @@ -106,7 +105,7 @@ class LateralTCPDiscoveryListenerUnitTest service.setServiceAddress( "localhost" ); service.setServicePort( 9999 ); - final ITCPLateralCacheAttributes lca = new TCPLateralCacheAttributes(); + final TCPLateralCacheAttributes lca = new TCPLateralCacheAttributes(); // used as identifying key by factory lca.setTcpServer( service.getServiceAddress() + ":" + service.getServicePort() ); lca.setCacheName(cacheName); @@ -188,7 +187,7 @@ class LateralTCPDiscoveryListenerUnitTest // SETUP final String cacheName = "testEmptyNoWaits"; - final ITCPLateralCacheAttributes lca = new TCPLateralCacheAttributes(); + final TCPLateralCacheAttributes lca = new TCPLateralCacheAttributes(); lca.setTcpServers(""); // default lca.setTcpListenerPort(1120); lca.setCacheName(cacheName); @@ -216,7 +215,7 @@ class LateralTCPDiscoveryListenerUnitTest service.setServiceAddress( "localhost" ); service.setServicePort( 9999 ); - final ITCPLateralCacheAttributes lca = new TCPLateralCacheAttributes(); + final TCPLateralCacheAttributes lca = new TCPLateralCacheAttributes(); // used as identifying key by factory lca.setTcpServer( service.getServiceAddress() + ":" + service.getServicePort() ); lca.setCacheName(cacheName); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java index cdc77727..1f6d7726 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPFilterRemoveHashCodeUnitTest.java @@ -28,7 +28,6 @@ import java.io.Serializable; import org.apache.commons.jcs4.JCS; import org.apache.commons.jcs4.access.CacheAccess; -import org.apache.commons.jcs4.auxiliary.lateral.LateralCacheAttributes; import org.apache.commons.jcs4.engine.CacheElement; import org.apache.commons.jcs4.engine.behavior.ICacheElement; import org.apache.commons.jcs4.utils.serialization.StandardSerializer; @@ -76,7 +75,6 @@ public class LateralTCPFilterRemoveHashCodeUnitTest final TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes(); lattr2.setTcpListenerPort( 1102 ); - lattr2.setTransmissionType(LateralCacheAttributes.Type.TCP); lattr2.setTcpServer( "localhost:" + serverPort ); lattr2.setIssueRemoveOnPut( true ); // should still try to remove diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java index a31e52c2..35a78b8c 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/LateralTCPIssueRemoveOnPutUnitTest.java @@ -28,7 +28,6 @@ import java.util.Random; import org.apache.commons.jcs4.JCS; import org.apache.commons.jcs4.access.CacheAccess; -import org.apache.commons.jcs4.auxiliary.lateral.LateralCacheAttributes; import org.apache.commons.jcs4.engine.CacheElement; import org.apache.commons.jcs4.engine.behavior.ICacheElement; import org.apache.commons.jcs4.utils.serialization.StandardSerializer; @@ -76,7 +75,6 @@ public class LateralTCPIssueRemoveOnPutUnitTest final TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes(); lattr2.setTcpListenerPort( 1102 ); - lattr2.setTransmissionType(LateralCacheAttributes.Type.TCP); lattr2.setTcpServer( "localhost:" + serverPort ); lattr2.setIssueRemoveOnPut( true ); // should still try to remove @@ -189,7 +187,6 @@ public class LateralTCPIssueRemoveOnPutUnitTest final TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes(); lattr2.setTcpListenerPort( 1102 ); - lattr2.setTransmissionType(LateralCacheAttributes.Type.TCP); lattr2.setTcpServer( "localhost:" + serverPort ); lattr2.setIssueRemoveOnPut( false ); // should still try to remove diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java index 4d2aa9be..9da7e584 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/lateral/socket/tcp/TestTCPLateralUnitTest.java @@ -27,7 +27,6 @@ import java.util.Map; import java.util.Set; import org.apache.commons.jcs4.JCS; -import org.apache.commons.jcs4.auxiliary.lateral.LateralCacheAttributes; import org.apache.commons.jcs4.auxiliary.lateral.LateralCommand; import org.apache.commons.jcs4.auxiliary.lateral.LateralElementDescriptor; import org.apache.commons.jcs4.engine.CacheElement; @@ -56,7 +55,6 @@ class TestTCPLateralUnitTest { final TCPLateralCacheAttributes lattr = new TCPLateralCacheAttributes(); lattr.setTcpListenerPort(port); - lattr.setTransmissionType(LateralCacheAttributes.Type.TCP); final CompositeCache<K, V> cache = cacheMgr.getCache( "test" ); @@ -72,7 +70,6 @@ class TestTCPLateralUnitTest { final TCPLateralCacheAttributes lattr2 = new TCPLateralCacheAttributes(); lattr2.setTcpListenerPort(listenerPort); - lattr2.setTransmissionType(LateralCacheAttributes.Type.TCP); lattr2.setTcpServer("localhost:" + serverPort); final LateralTCPService<K, V> service = new LateralTCPService<>(lattr2, new StandardSerializer()); @@ -97,7 +94,6 @@ class TestTCPLateralUnitTest JCS.getInstance( "test" ); final TCPLateralCacheAttributes lac = new TCPLateralCacheAttributes(); - lac.setTransmissionType(LateralCacheAttributes.Type.TCP); lac.setTcpServer( "localhost:" + port ); lac.setTcpListenerPort( port ); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheListenerUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheListenerUnitTest.java index 333b8a0a..fa8383db 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheListenerUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheListenerUnitTest.java @@ -23,14 +23,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; -import org.apache.commons.jcs4.auxiliary.remote.behavior.IRemoteCacheAttributes; import org.apache.commons.jcs4.engine.CacheElementSerialized; import org.apache.commons.jcs4.engine.ElementAttributes; import org.apache.commons.jcs4.engine.behavior.ICache; import org.apache.commons.jcs4.engine.behavior.ICacheElement; import org.apache.commons.jcs4.engine.behavior.ICacheElementSerialized; import org.apache.commons.jcs4.engine.behavior.ICompositeCacheManager; -import org.apache.commons.jcs4.engine.behavior.IElementAttributes; import org.apache.commons.jcs4.engine.behavior.IElementSerializer; import org.apache.commons.jcs4.engine.control.MockCompositeCacheManager; import org.apache.commons.jcs4.utils.serialization.StandardSerializer; @@ -53,7 +51,7 @@ class RemoteCacheListenerUnitTest throws Exception { // SETUP - final IRemoteCacheAttributes irca = new RemoteCacheAttributes(); + final RemoteCacheAttributes irca = new RemoteCacheAttributes(); irca.setRemoveUponRemotePut( false ); final ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); final RemoteCacheListener<String, String> listener = new RemoteCacheListener<>( irca, cacheMgr, new StandardSerializer() ); @@ -61,7 +59,7 @@ class RemoteCacheListenerUnitTest final String cacheName = "testName"; final String key = "key"; final String value = "value fdsadf dsafdsa fdsaf dsafdsaf dsafdsaf dsaf dsaf dsaf dsafa dsaf dsaf dsafdsaf"; - final IElementAttributes attr = new ElementAttributes(); + final ElementAttributes attr = new ElementAttributes(); attr.setMaxLife(34); final IElementSerializer elementSerializer = new StandardSerializer(); @@ -97,7 +95,7 @@ class RemoteCacheListenerUnitTest throws Exception { // SETUP - final IRemoteCacheAttributes irca = new RemoteCacheAttributes(); + final RemoteCacheAttributes irca = new RemoteCacheAttributes(); irca.setRemoveUponRemotePut( true ); final ICompositeCacheManager cacheMgr = new MockCompositeCacheManager(); final RemoteCacheListener<String, String> listener = new RemoteCacheListener<>( irca, cacheMgr, new StandardSerializer() ); @@ -105,7 +103,7 @@ class RemoteCacheListenerUnitTest final String cacheName = "testName"; final String key = "key"; final String value = "value fdsadf dsafdsa fdsaf dsafdsaf dsafdsaf dsaf dsaf dsaf dsafa dsaf dsaf dsafdsaf"; - final IElementAttributes attr = new ElementAttributes(); + final ElementAttributes attr = new ElementAttributes(); attr.setMaxLife(34); final IElementSerializer elementSerializer = new StandardSerializer(); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheNoWaitFacadeUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheNoWaitFacadeUnitTest.java index 21a09d9b..eff19a45 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheNoWaitFacadeUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/RemoteCacheNoWaitFacadeUnitTest.java @@ -68,7 +68,7 @@ class RemoteCacheNoWaitFacadeUnitTest void testFailover() { // SETUP - final IRemoteCacheAttributes cattr = new RemoteCacheAttributes(); + final RemoteCacheAttributes cattr = new RemoteCacheAttributes(); cattr.setCacheName("testCache1"); cattr.setFailoverServers("localhost:1101,localhost:1102"); cattr.setReceive(false); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/server/RemoteCacheServerUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/server/RemoteCacheServerUnitTest.java index 41e0c97c..df2b795e 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/server/RemoteCacheServerUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/auxiliary/remote/server/RemoteCacheServerUnitTest.java @@ -30,7 +30,6 @@ import java.util.Properties; import org.apache.commons.jcs4.auxiliary.MockCacheEventLogger; import org.apache.commons.jcs4.auxiliary.remote.MockRemoteCacheListener; import org.apache.commons.jcs4.auxiliary.remote.RemoteUtils; -import org.apache.commons.jcs4.auxiliary.remote.server.behavior.IRemoteCacheServerAttributes; import org.apache.commons.jcs4.auxiliary.remote.server.behavior.RemoteType; import org.apache.commons.jcs4.engine.CacheElement; import org.apache.commons.jcs4.engine.behavior.ICacheElement; @@ -54,7 +53,7 @@ class RemoteCacheServerUnitTest void setUp() throws Exception { - final IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes(); + final RemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes(); rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" ); final Properties config = RemoteUtils.loadProps(rcsa.getConfigFileName()); this.server = new RemoteCacheServer<>( rcsa, config ); @@ -327,7 +326,7 @@ class RemoteCacheServerUnitTest void testSimpleRegisterListenerAndPut() throws Exception { - final IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes(); + final RemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes(); rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" ); final Properties config = RemoteUtils.loadProps(rcsa.getConfigFileName()); @@ -374,7 +373,7 @@ class RemoteCacheServerUnitTest throws Exception { // SETUP - final IRemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes(); + final RemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes(); rcsa.setLocalClusterConsistency( true ); rcsa.setConfigFileName( "/TestRemoteCacheServer.ccf" ); final Properties config = RemoteUtils.loadProps(rcsa.getConfigFileName()); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/control/CompositeCacheDiskUsageUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/control/CompositeCacheDiskUsageUnitTest.java index 31af0c15..b90ef8bb 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/control/CompositeCacheDiskUsageUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/control/CompositeCacheDiskUsageUnitTest.java @@ -267,7 +267,7 @@ class CompositeCacheDiskUsageUnitTest void testSpoolAllowed() { // SETUP - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setCacheName(CACHE_NAME); cattr.setDiskUsagePattern( ICompositeCacheAttributes.DiskUsagePattern.SWAP ); @@ -297,7 +297,7 @@ class CompositeCacheDiskUsageUnitTest void testSpoolNotAllowed() { // SETUP - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setCacheName(CACHE_NAME); cattr.setDiskUsagePattern( ICompositeCacheAttributes.DiskUsagePattern.UPDATE ); @@ -345,7 +345,7 @@ class CompositeCacheDiskUsageUnitTest throws IOException { // SETUP - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setCacheName(CACHE_NAME); cattr.setDiskUsagePattern( ICompositeCacheAttributes.DiskUsagePattern.UPDATE ); @@ -381,7 +381,7 @@ class CompositeCacheDiskUsageUnitTest throws IOException { // SETUP - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setCacheName(CACHE_NAME); cattr.setDiskUsagePattern( ICompositeCacheAttributes.DiskUsagePattern.UPDATE ); @@ -416,7 +416,7 @@ class CompositeCacheDiskUsageUnitTest throws IOException { // SETUP - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setCacheName(CACHE_NAME); cattr.setDiskUsagePattern( ICompositeCacheAttributes.DiskUsagePattern.UPDATE ); @@ -472,7 +472,7 @@ class CompositeCacheDiskUsageUnitTest throws IOException { // SETUP - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setCacheName(CACHE_NAME); cattr.setDiskUsagePattern( ICompositeCacheAttributes.DiskUsagePattern.SWAP ); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/control/CompositeCacheUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/control/CompositeCacheUnitTest.java index 50bba29e..c9412fef 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/control/CompositeCacheUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/control/CompositeCacheUnitTest.java @@ -31,7 +31,6 @@ import org.apache.commons.jcs4.engine.CompositeCacheAttributes; import org.apache.commons.jcs4.engine.ElementAttributes; import org.apache.commons.jcs4.engine.behavior.ICacheElement; import org.apache.commons.jcs4.engine.behavior.ICacheType.CacheType; -import org.apache.commons.jcs4.engine.behavior.ICompositeCacheAttributes; import org.apache.commons.jcs4.engine.behavior.IElementAttributes; import org.apache.commons.jcs4.engine.memory.MockMemoryCache; import org.junit.jupiter.api.Test; @@ -56,7 +55,7 @@ class CompositeCacheUnitTest final String keyprefix2 = "MyPrefix2"; final String cacheName = "testGetMatching_Normal"; final String memoryCacheClassName = "org.apache.commons.jcs4.engine.memory.lru.LRUMemoryCache"; - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setMemoryCacheName( memoryCacheClassName ); cattr.setMaxObjects( maxMemorySize ); @@ -106,7 +105,7 @@ class CompositeCacheUnitTest final int maxMemorySize = 0; final String cacheName = "testGetMatching_NotOnDisk"; final String memoryCacheClassName = "org.apache.commons.jcs4.engine.memory.lru.LRUMemoryCache"; - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setCacheName(cacheName); cattr.setMemoryCacheName( memoryCacheClassName ); cattr.setMaxObjects( maxMemorySize ); @@ -139,7 +138,7 @@ class CompositeCacheUnitTest final int maxMemorySize = 0; final String cacheName = "testGetMatching_NotOnDisk"; final String memoryCacheClassName = "org.apache.commons.jcs4.engine.memory.lru.LRUMemoryCache"; - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setCacheName(cacheName); cattr.setMemoryCacheName( memoryCacheClassName ); cattr.setMaxObjects( maxMemorySize ); @@ -172,7 +171,7 @@ class CompositeCacheUnitTest // SETUP final String cacheName = "testCacheName"; final String mockMemoryCacheClassName = "org.apache.commons.jcs4.engine.memory.MockMemoryCache"; - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setMemoryCacheName( mockMemoryCacheClassName ); final IElementAttributes attr = new ElementAttributes(); @@ -211,7 +210,7 @@ class CompositeCacheUnitTest // SETUP final String cacheName = "testCacheName"; final String mockMemoryCacheClassName = "org.apache.commons.jcs4.engine.memory.MockMemoryCache"; - final ICompositeCacheAttributes cattr = new CompositeCacheAttributes(); + final CompositeCacheAttributes cattr = new CompositeCacheAttributes(); cattr.setMemoryCacheName( mockMemoryCacheClassName ); final IElementAttributes attr = new ElementAttributes(); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/memory/fifo/FIFOMemoryCacheUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/memory/fifo/FIFOMemoryCacheUnitTest.java index caf8162a..e49258e2 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/memory/fifo/FIFOMemoryCacheUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/memory/fifo/FIFOMemoryCacheUnitTest.java @@ -27,7 +27,6 @@ import java.io.IOException; import org.apache.commons.jcs4.engine.CacheElement; import org.apache.commons.jcs4.engine.CompositeCacheAttributes; import org.apache.commons.jcs4.engine.ElementAttributes; -import org.apache.commons.jcs4.engine.behavior.ICompositeCacheAttributes; import org.apache.commons.jcs4.engine.control.CompositeCache; import org.junit.jupiter.api.Test; @@ -47,7 +46,7 @@ class FIFOMemoryCacheUnitTest final int maxObjects = 10; final String cacheName = "testExpirationPolicy_oneExtra"; - final ICompositeCacheAttributes attributes = new CompositeCacheAttributes(); + final CompositeCacheAttributes attributes = new CompositeCacheAttributes(); attributes.setCacheName(cacheName); attributes.setMaxObjects( maxObjects ); attributes.setSpoolChunkSize( 1 ); @@ -83,7 +82,7 @@ class FIFOMemoryCacheUnitTest final int maxObjects = 10; final String cacheName = "testExpirationPolicy_oneExtra"; - final ICompositeCacheAttributes attributes = new CompositeCacheAttributes(); + final CompositeCacheAttributes attributes = new CompositeCacheAttributes(); attributes.setCacheName(cacheName); attributes.setMaxObjects( maxObjects ); attributes.setSpoolChunkSize( 1 ); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/memory/shrinking/ShrinkerThreadUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/memory/shrinking/ShrinkerThreadUnitTest.java index 0e4742b5..85f0bc29 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/memory/shrinking/ShrinkerThreadUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/engine/memory/shrinking/ShrinkerThreadUnitTest.java @@ -64,8 +64,8 @@ class ShrinkerThreadUnitTest final ICacheElement<String, String> element = new CacheElement<>( "testRegion", key, value ); final ElementAttributes elementAttr = new ElementAttributes(); elementAttr.setIsEternal( false ); + elementAttr.setMaxLife(1); element.setElementAttributes( elementAttr ); - element.getElementAttributes().setMaxLife(1); long now = System.currentTimeMillis(); // add two seconds @@ -101,9 +101,9 @@ class ShrinkerThreadUnitTest final ICacheElement<String, String> element = new CacheElement<>( "testRegion", key, value ); final ElementAttributes elementAttr = new ElementAttributes(); elementAttr.setIsEternal( false ); + elementAttr.setMaxLife(100); + elementAttr.setIdleTime(1); element.setElementAttributes( elementAttr ); - element.getElementAttributes().setMaxLife(100); - element.getElementAttributes().setIdleTime( 1 ); long now = System.currentTimeMillis(); // add two seconds @@ -139,8 +139,8 @@ class ShrinkerThreadUnitTest final ICacheElement<String, String> element = new CacheElement<>( "testRegion", key, value ); final ElementAttributes elementAttr = new ElementAttributes(); elementAttr.setIsEternal( false ); + elementAttr.setMaxLife(1); element.setElementAttributes( elementAttr ); - element.getElementAttributes().setMaxLife(1); long now = System.currentTimeMillis(); // subtract two seconds @@ -176,9 +176,9 @@ class ShrinkerThreadUnitTest final ICacheElement<String, String> element = new CacheElement<>( "testRegion", key, value ); final ElementAttributes elementAttr = new ElementAttributes(); elementAttr.setIsEternal( false ); + elementAttr.setMaxLife(100); + elementAttr.setIdleTime(1); element.setElementAttributes( elementAttr ); - element.getElementAttributes().setMaxLife(100); - element.getElementAttributes().setIdleTime( 1 ); long now = System.currentTimeMillis(); // subtract two seconds @@ -220,8 +220,8 @@ class ShrinkerThreadUnitTest final ElementAttributes elementAttr = new ElementAttributes(); elementAttr.setIsEternal( false ); + elementAttr.setMaxLife(1); element.setElementAttributes( elementAttr ); - element.getElementAttributes().setMaxLife(1); memory.update( element ); final ICacheElement<String, String> returnedElement1 = memory.get( key ); @@ -270,8 +270,8 @@ class ShrinkerThreadUnitTest final ElementAttributes elementAttr = new ElementAttributes(); elementAttr.setIsEternal( false ); + elementAttr.setMaxLife(1); element.setElementAttributes( elementAttr ); - element.getElementAttributes().setMaxLife(1); memory.update( element ); final ICacheElement<String, String> returnedElement1 = memory.get( key ); @@ -324,8 +324,8 @@ class ShrinkerThreadUnitTest final ElementAttributes elementAttr = new ElementAttributes(); elementAttr.addElementEventHandler( handler ); elementAttr.setIsEternal( false ); + elementAttr.setMaxLife(1); element.setElementAttributes( elementAttr ); - element.getElementAttributes().setMaxLife(1); memory.update( element ); final ICacheElement<String, String> returnedElement1 = memory.get( key ); diff --git a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/utils/serialization/SerializationConversionUtilUnitTest.java b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/utils/serialization/SerializationConversionUtilUnitTest.java index 1e02e8e5..c2fc877e 100644 --- a/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/utils/serialization/SerializationConversionUtilUnitTest.java +++ b/commons-jcs4-core/src/test/java/org/apache/commons/jcs4/utils/serialization/SerializationConversionUtilUnitTest.java @@ -30,7 +30,6 @@ import org.apache.commons.jcs4.engine.CacheElement; import org.apache.commons.jcs4.engine.ElementAttributes; import org.apache.commons.jcs4.engine.behavior.ICacheElement; import org.apache.commons.jcs4.engine.behavior.ICacheElementSerialized; -import org.apache.commons.jcs4.engine.behavior.IElementAttributes; import org.apache.commons.jcs4.engine.behavior.IElementSerializer; import org.junit.jupiter.api.Test; @@ -55,7 +54,7 @@ class SerializationConversionUtilUnitTest final IElementSerializer elementSerializer = new StandardSerializer(); - final IElementAttributes attr = new ElementAttributes(); + final ElementAttributes attr = new ElementAttributes(); attr.setMaxLife(34); final ICacheElement<String, String> before = new CacheElement<>( cacheName, key, value ); @@ -138,7 +137,7 @@ class SerializationConversionUtilUnitTest final IElementSerializer elementSerializer = null; // new StandardSerializer(); - final IElementAttributes attr = new ElementAttributes(); + final ElementAttributes attr = new ElementAttributes(); attr.setMaxLife(34); final ICacheElement<String, String> before = new CacheElement<>( cacheName, key, value ); @@ -174,7 +173,7 @@ class SerializationConversionUtilUnitTest final IElementSerializer elementSerializer = new StandardSerializer(); - final IElementAttributes attr = new ElementAttributes(); + final ElementAttributes attr = new ElementAttributes(); attr.setMaxLife(34); final ICacheElement<String, String> before = new CacheElement<>( cacheName, key, value ); diff --git a/commons-jcs4-jcache/src/main/java/org/apache/commons/jcs4/jcache/JCSCache.java b/commons-jcs4-jcache/src/main/java/org/apache/commons/jcs4/jcache/JCSCache.java index e15a0a20..5a692b90 100644 --- a/commons-jcs4-jcache/src/main/java/org/apache/commons/jcs4/jcache/JCSCache.java +++ b/commons-jcs4-jcache/src/main/java/org/apache/commons/jcs4/jcache/JCSCache.java @@ -720,7 +720,7 @@ public class JCSCache<K, V> implements Cache<K, V> element.getElementAttributes().setIdleTime(duration.getTimeUnit().toMillis(duration.getDurationAmount())); } else - { + { element.getElementAttributes().setMaxLife(duration.getTimeUnit().toMillis(duration.getDurationAmount())); } } diff --git a/init-git-svn.sh b/init-git-svn.sh deleted file mode 100755 index 60203db8..00000000 --- a/init-git-svn.sh +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# !/bin/zsh -f -cd .git;wget http://git.apache.org/authors.txt; cd .. -git config svn.authorsfile ".git/authors.txt" -git svn init --prefix=origin/ --tags=tags --trunk=trunk --branches=branches https://svn.apache.org/repos/asf/commons/proper/jcs -git svn rebase diff --git a/jcache-fast.sh b/jcache-fast.sh deleted file mode 100755 index 88c6eb8e..00000000 --- a/jcache-fast.sh +++ /dev/null @@ -1,23 +0,0 @@ -#! /bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -cd commons-jcs-core && mvn clean install -Dmaven.test.skip=true && cd - -cd commons-jcs-jcache && mvn clean install && cd - -cd commons-jcs-jcache-openjpa && mvn clean install && cd - -cd commons-jcs-jcache-extras && mvn clean install && cd - -cd commons-jcs-tck-tests && mvn clean install -Djcache.tck && cd - -
