Return-Path: Delivered-To: apmail-jakarta-jcs-users-archive@www.apache.org Received: (qmail 12193 invoked from network); 1 Sep 2005 18:30:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Sep 2005 18:30:48 -0000 Received: (qmail 48279 invoked by uid 500); 1 Sep 2005 18:30:48 -0000 Delivered-To: apmail-jakarta-jcs-users-archive@jakarta.apache.org Received: (qmail 48263 invoked by uid 500); 1 Sep 2005 18:30:47 -0000 Mailing-List: contact jcs-users-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JCS Users List" Delivered-To: mailing list jcs-users@jakarta.apache.org Received: (qmail 48250 invoked by uid 99); 1 Sep 2005 18:30:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2005 11:30:47 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [65.161.4.46] (HELO smtp01corp.interwoven.com) (65.161.4.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2005 11:31:01 -0700 Received: from exbesv01.Interwoven.com (localhost [127.0.0.1]) by smtp01corp.interwoven.com (8.12.10/8.12.10) with ESMTP id j81IUUeO010103 for ; Thu, 1 Sep 2005 11:30:41 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Cache Keys Date: Thu, 1 Sep 2005 11:30:36 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Cache Keys Thread-Index: AcWucueJIkw+LlnHQ8OxNhdRhcwtLAAsBAVg From: "Tim Cronin" To: "JCS Users List" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I'm using and object as the cache key is there something special I have to do? Here is my key class public class Key implements Serializable { /** * the site */ private String mSite =3D null; /** * the page */ private String mPage =3D null; /** * the locale */ private String mLocale =3D null; /** * the component ID */ private String mComponent =3D null; =20 /*********************************************************************** ****** * create new Key (used for purge) * * @param site the site =20 ************************************************************************ *****/ public Key(String site) { mSite =3D site; } =20 /*********************************************************************** ****** * create new Key (used for purge) * * @param site the site * @param page the page =20 ************************************************************************ *****/ public Key(String site, String page) { mSite =3D site; mPage =3D page; } =20 /*********************************************************************** ****** * create new Key (for page) * * @param site the site * @param page the page * @param locale the locale =20 ************************************************************************ *****/ public Key(String site, String page, String locale) { mLocale =3D locale; mPage =3D page; mSite =3D site; } =20 /*********************************************************************** ****** * create new Key (for component key) * * @param k the key (for the page) * @param component the component =20 ************************************************************************ *****/ public Key(Key k, String component) { mSite =3D k.mSite; mPage =3D k.mPage; mLocale =3D k.mLocale; mComponent =3D component; } =20 /*********************************************************************** ****** * Gets The component. * * @return Returns the component. =20 ************************************************************************ *****/ public String getComponent() { return mComponent; } =20 /*********************************************************************** ****** * Gets The locale. * * @return Returns the locale. =20 ************************************************************************ *****/ public String getLocale() { return mLocale; } =20 /*********************************************************************** ****** * Gets The page. * * @return Returns the page. =20 ************************************************************************ *****/ public String getPage() { return mPage; } =20 /*********************************************************************** ****** * Gets The site. * * @return Returns the site. =20 ************************************************************************ *****/ public String getSite() { return mSite; } =20 /*********************************************************************** ****** * get the xpath logic to use to filter cache options * * @return the xpath logic string =20 ************************************************************************ *****/ public String getXPath() { StringBuffer buff =3D new StringBuffer(); =20 buff.append("[@site=3D'").append(StringEscapeUtils.escapeJava(mSite)).app= e nd("'"); if (mPage !=3D null) { buff.append(" and @page=3D'").append(StringEscapeUtils.escapeJava(mPage)).append("'"); } buff.append("]"); return buff.toString(); } =20 /*********************************************************************** ****** * @see java.lang.Object#equals(java.lang.Object) =20 ************************************************************************ *****/ public boolean equals(Object o) { if (o instanceof Key) { return false; } if (this =3D=3D o) { return true; } Key that =3D (Key) o; return new EqualsBuilder() .append(mSite, that.mSite) .append(mPage, that.mPage) .append(mLocale, that.mLocale) .append(mComponent, that.mComponent) .isEquals(); } =20 /*********************************************************************** ****** * @see java.lang.Object#hashCode() =20 ************************************************************************ *****/ public int hashCode() { return new HashCodeBuilder() .append(mSite) .append(mPage) .append(mLocale) .append(mComponent) .toHashCode(); } =20 /*********************************************************************** ****** * @see java.lang.Object#toString() =20 ************************************************************************ *****/ public String toString() { return new ToStringBuilder(this) .append("mSite", mSite) .append("mPage", mPage) .append("mLocale", mLocale) .append("mComponent", mComponent) .toString(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org For additional commands, e-mail: jcs-users-help@jakarta.apache.org