Ya, but it isn't a singleton. I was considering making the access objects store locks. But this would be too limiting, and to prevent myself form doing this, I'll name it getInstance.
I'll change it tomorrow if no one has done it by then. Nothing is using this class, so it is an easy change. > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > On Behalf Of Daniel Rall > Sent: Tuesday, February 12, 2002 9:30 PM > To: Turbine Developers List > Cc: [EMAIL PROTECTED] > Subject: Re: cvs commit: jakarta-turbine- > stratum/src/java/org/apache/stratum/jcs JCS.java > > Very nice! Could we use the method name getInstance() instead of > getJCS()? It's more in line with the conventions used in the rest of > the Turbine packages. > > Dan > > > [EMAIL PROTECTED] writes: > > > asmuts 02/02/12 07:47:21 > > > > Added: src/java/org/apache/stratum/jcs JCS.java > > Log: > > Simple class to get access to the cache. Should make using JCS much > easier. > > Most users will only need to use this one class. > > > > Revision Changes Path > > 1.1 jakarta-turbine- > stratum/src/java/org/apache/stratum/jcs/JCS.java > > > > Index: JCS.java > > =================================================================== > > package org.apache.stratum.jcs; > > > > import org.apache.stratum.jcs.access.GroupCacheAccess; > > import org.apache.stratum.jcs.engine.control.Cache; > > import org.apache.stratum.jcs.engine.control.CacheAttributes; > > > > import org.apache.stratum.jcs.engine.group.GroupAttrName; > > import org.apache.stratum.jcs.engine.group.GroupCacheManager; > > import org.apache.stratum.jcs.engine.group.GroupCacheManagerFactory; > > import org.apache.stratum.jcs.engine.group.GroupId; > > import org.apache.stratum.jcs.access.exception.CacheException; > > import > org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes; > > > > /** > > * To make using JCS a bit easier. > > * > > *@author asmuts > > *@created February 12, 2002 > > */ > > public class JCS extends GroupCacheAccess > > { > > > > private static GroupCacheManager cacheMgr; > > > > /////////////////////////////////////////// > > /** > > * Constructor for the JCS object > > * > > *@param cacheControl Description of the Parameter > > */ > > protected JCS( Cache cacheControl ) > > { > > super( cacheControl ); > > } > > > > > > ///////////////////////////////////////// > > /** > > * Gets the groupAccess attribute of the GroupCacheAccess class > > * > > *@param region Description of the Parameter > > *@return The groupAccess value > > *@exception CacheException Description of the Exception > > */ > > public static JCS getJCS( String region ) > > throws CacheException > > { > > if ( cacheMgr == null ) > > { > > synchronized ( GroupCacheAccess.class ) > > { > > if ( cacheMgr == null ) > > { > > cacheMgr = GroupCacheManagerFactory.getInstance(); > > } > > } > > } > > return new JCS( ( Cache ) cacheMgr.getCache( region ) ); > > } > > > > > > ///////////////////////////////////////// > > /** > > * Gets the groupAccess attribute of the GroupCacheAccess class > > * > > *@param region Description of the Parameter > > *@param icca Description of the Parameter > > *@return The groupAccess value > > *@exception CacheException Description of the Exception > > */ > > public static JCS getJCS( String region, ICompositeCacheAttributes > icca ) > > throws CacheException > > { > > if ( cacheMgr == null ) > > { > > synchronized ( GroupCacheAccess.class ) > > { > > if ( cacheMgr == null ) > > { > > cacheMgr = GroupCacheManagerFactory.getInstance(); > > } > > } > > } > > > > return new JCS( ( Cache ) cacheMgr.getCache( region, icca ) ); > > } > > > > > > > > } > > > > > > > > > > -- > > To unsubscribe, e-mail: <mailto:turbine-dev- > [EMAIL PROTECTED]> > > For additional commands, e-mail: <mailto:turbine-dev- > [EMAIL PROTECTED]> > > -- > To unsubscribe, e-mail: <mailto:turbine-dev- > [EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:turbine-dev- > [EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
