Return-Path: Delivered-To: apmail-jakarta-jcs-users-archive@www.apache.org Received: (qmail 88167 invoked from network); 9 Jul 2008 12:44:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Jul 2008 12:44:47 -0000 Received: (qmail 37930 invoked by uid 500); 9 Jul 2008 12:44:48 -0000 Delivered-To: apmail-jakarta-jcs-users-archive@jakarta.apache.org Received: (qmail 37758 invoked by uid 500); 9 Jul 2008 12:44: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 37747 invoked by uid 99); 9 Jul 2008 12:44:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 05:44:47 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [128.121.26.230] (HELO mail.biotest.net) (128.121.26.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 12:43:53 +0000 Received: from localhost (mail.biotest.net [128.121.26.2]) by mail.biotest.net (Postfix) with ESMTP id E44031B70225 for ; Wed, 9 Jul 2008 12:43:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at biotest.net Received: from mail.biotest.net ([127.0.0.1]) by localhost (odin.biotest.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wvv4dMPEp1fc for ; Wed, 9 Jul 2008 12:43:41 +0000 (UTC) Received: from [192.168.1.2] (pool-96-231-58-180.washdc.fios.verizon.net [96.231.58.180]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.biotest.net (Postfix) with ESMTPSA id BAC721B701C5 for ; Wed, 9 Jul 2008 12:43:41 +0000 (UTC) Message-ID: <4874B27F.6000100@loki.ws> Date: Wed, 09 Jul 2008 08:43:43 -0400 From: Joshua Szmajda User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: JCS Users List Subject: Re: Really stupid question - can I cache any random object? References: <1215599095.6790.10.camel@localhost> <2F7A2CD96A48A14C8CCD54C46A3B6448073260C9@LSWMAIL-AUSTIN.lombardisw.com> In-Reply-To: <2F7A2CD96A48A14C8CCD54C46A3B6448073260C9@LSWMAIL-AUSTIN.lombardisw.com> Content-Type: multipart/alternative; boundary="------------010003020201040204090207" X-Virus-Checked: Checked by ClamAV on apache.org --------------010003020201040204090207 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit FYI I implement Serializable just by adding 'implements java.io.Serializable'. I let java take care of the serialVersionUID, etc. Works very well for me, and it's one less thing to keep track of :) Bret Schuhmacher wrote: > Niall, > > Thanks for the reply. I do appreciate your time. However, I did find > that the minute I implemented Serializable and added just a single line > of code to my object to complete the Serializable implementation: > static final long serialVersionUID = 1; > > everything started working. Apparently the objects you cache, even if > you never plan to let the object leave your JVM, have to be > Serializable. > > Thanks again for the reply! > > Rgds, > > Bret > > > >> -----Original Message----- >> From: Niall Gallagher [mailto:niall@switchfire.com] >> Sent: Wednesday, July 09, 2008 6:25 AM >> To: JCS Users List >> Subject: RE: Really stupid question - can I cache any random object? >> >> Hi Bret, >> >> *As far as I know* (-caveat!) your object doesn't need to be >> serializable if you are just using the memory cache. So you can cache >> any random object. It needs to be serializable if it will ever leave >> the JVM however - so if you have configured any kind of disk caching >> for example, your object would need to be serializable so it can be >> moved from the JVM out to disk. I think in the examples on the web >> pages configure a disk cache. >> >> Try a minimal ccf file like this: >> >> jcs.default= >> >> > jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttribu > >> tes >> jcs.default.cacheattributes.MaxObjects=10000 >> >> > jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memor > >> y.lru.LRUMemoryCache >> jcs.default.cacheattributes.UseMemoryShrinker=false >> jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes >> jcs.default.elementattributes.IsEternal=false >> jcs.default.elementattributes.IsLateral=false >> jcs.default.elementattributes.IsRemote=false >> jcs.default.elementattributes.IsSpool=false >> >> Regards, >> Niall >> >> On Tue, 2008-07-08 at 23:29 -0500, Bret Schuhmacher wrote: >> >> >>> No, just an object. I thought you could cache anything (the little >>> docs I found just showed "Object"). But being serializable makes >>> sense now that I think about it. Is this required for memory >>> >> caching, >> >>> too, though? I've got the most minimal memory cache set up >>> >> (cache.ccf >> >>> copied directly from the web pages). I'll change my objects and see >>> what happens. Thanks for the quick response!! :-) >>> >>> Rgds, >>> >>> >>> Bret >>> >>> >>> >>>> -----Original Message----- >>>> From: Michael Toback [mailto:Michael.Toback@chordiant.com] >>>> Sent: Wednesday, July 09, 2008 12:17 AM >>>> To: JCS Users List >>>> Subject: RE: Really stupid question - can I cache any random >>>> >> object? >> >>>> Silly question about your stupid question. Is your object >>>> >>> serializable? >>> >>>> -----Original Message----- >>>> From: Bret Schuhmacher [mailto:Bret.Schuhmacher@lombardi.com] >>>> Sent: Tuesday, July 08, 2008 9:09 PM >>>> To: jcs-users@jakarta.apache.org >>>> Subject: Really stupid question - can I cache any random object? >>>> >>>> Can I cache *any* object? I get exceptions when I attempt to >>>> > cache > >>>> objects I've created, although I can cache simple objects like >>>> >>> Strings. >>> >>>> Unfortunately cache.put(String foo, myCustomObject bar) doesn't >>>> >> tell >> >>> me >>> >>>> much more than the name of the class I'm trying to cache (i.e. >>>> "myCustomObject"). It doesn't tell me why it threw the exception, >>>> it just prints a stacktrace. Like I said - it all works fine if I >>>> do >>>> this: >>>> cache.put("foo", "bar"), but if I do cache.put("foo", new >>>> myCustomObject()) it will fail. I've even cast myCustomObject >>>> > back > >>>> to Object, but it still doesn't like it. Any way to get more >>>> verbose messages out of the JCS code instead of just ERROR level? >>>> >>>> Thanks, >>>> >>>> >>>> Bret >>>> >>>> >>>> >>>> > ------------------------------------------------------------------- > >> - >> >>>> - To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org >>>> For additional commands, e-mail: jcs-users-help@jakarta.apache.org >>>> >>>> The information transmitted herewith is sensitive information >>>> >> of >> >>>> Chordiant Software or its customers and is intended only for use >>>> > to > >>> the >>> >>>> individual or entity to which it is addressed. If the reader of >>>> >> this >> >>>> message is not the intended recipient, you are hereby notified >>>> > that > >>> any >>> >>>> review, retransmission, dissemination, distribution, copying or >>>> other use of, or taking of any action in reliance upon, this >>>> information is strictly prohibited. If you have received this >>>> communication in error, please contact the sender and delete the >>>> >> material from your computer. >> >>>> > ------------------------------------------------------------------- > >> - >> >>>> - To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org >>>> For additional commands, e-mail: jcs-users-help@jakarta.apache.org >>>> >>> >>> > --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org >>> For additional commands, e-mail: jcs-users-help@jakarta.apache.org >>> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org > For additional commands, e-mail: jcs-users-help@jakarta.apache.org > > --------------010003020201040204090207--