[07:20:08 CDT(-0500)] * tsnfoo (~tsnfoo@cpe-173-88-27-191.columbus.res.rr.com) has joined ##uportal
[07:34:31 CDT(-0500)] * jessm (~Jess@c-68-40-84-116.hsd1.mi.comcast.net) has joined ##uportal
[08:05:28 CDT(-0500)] * lfuller (~sparhk@wsip-72-215-204-133.ph.ph.cox.net) has joined ##uportal
[08:21:29 CDT(-0500)] * tsnfoo (~tsnfoo@wso-mbp15-2.test.denison.edu) has joined ##uportal
[08:22:48 CDT(-0500)] * tsnfoo_ (~tsnfoo@cpe-173-88-27-191.columbus.res.rr.com) has joined ##uportal
[09:51:46 CDT(-0500)] * holdorph (~holdorph@wsip-72-215-204-133.ph.ph.cox.net) has joined ##uportal
[10:03:18 CDT(-0500)] * bsparks (~bsparks@wsip-72-215-204-133.ph.ph.cox.net) has joined ##uportal
[11:00:41 CDT(-0500)] * EricDalquist (~apollo@ip68-6-110-30.sb.sd.cox.net) has joined ##uportal
[12:41:08 CDT(-0500)] * awills (~awills@wsip-72-215-204-133.ph.ph.cox.net) has joined ##uportal
[12:50:09 CDT(-0500)] <awills> EricDalquist: you have a new annotation-based cache API? possibly on googlecode?
[13:09:19 CDT(-0500)] <EricDalquist> yes
[13:09:27 CDT(-0500)] <EricDalquist> nick blair & I wrote it
[13:09:39 CDT(-0500)] <EricDalquist> after wanting something like it for a long time
[13:10:30 CDT(-0500)] <EricDalquist> how did you happen upon it awills?
[13:19:56 CDT(-0500)] * lfuller stumbled across it a while back too. Good idea but wasn't quite what we needed so I ended up moving.
[13:20:19 CDT(-0500)] <EricDalquist> neat
[13:20:24 CDT(-0500)] <EricDalquist> glad that people are finding it
[13:21:05 CDT(-0500)] <lfuller> actually more than just quite... would have needed to add a ton to it, and there was another option which allowed me to meet pearson's needs in roughly 3 hours of effort. So I had to drop it. Even though it did look like it would be more fun to play with
[13:21:25 CDT(-0500)] <EricDalquist> just out of curiosity
[13:21:28 CDT(-0500)] <EricDalquist> what was it missing?
[13:22:51 CDT(-0500)] <awills> athena brought it up last week eric
[13:23:03 CDT(-0500)] <awills> and I found it: http://code.google.com/p/ehcache-spring-annotations/
[13:23:13 CDT(-0500)] <awills> and stacked it on ohloh
[13:23:18 CDT(-0500)] <EricDalquist>
[13:23:29 CDT(-0500)] <lfuller> Has been over a year. I remember thinking it was a good first step, but I think I needed some combined key action and multiple purges upon particular method calls.
[13:23:31 CDT(-0500)] <lfuller> has been a while.
[13:23:38 CDT(-0500)] <EricDalquist> ah
[13:23:49 CDT(-0500)] <lfuller> has been a long time though
[13:24:34 CDT(-0500)] * lfuller has not slept a whole lot since then... perhaps it just seemed longer than it was
[13:24:44 CDT(-0500)] <EricDalquist> lol
[13:24:59 CDT(-0500)] <lfuller> perhaps you have noticed how time tends to stretch with a little one around as well
[13:25:05 CDT(-0500)] <EricDalquist> well we've added a bunch to it recently and always love to hear more ideas
[13:25:06 CDT(-0500)] <EricDalquist> yes
[13:25:14 CDT(-0500)] <EricDalquist> the last 4 months seems like a few years
[13:25:21 CDT(-0500)] <awills> heh
[13:25:21 CDT(-0500)] <EricDalquist> memories of pre-baby don't seem to exist anymore
[13:26:06 CDT(-0500)] <awills> i want to use usernames as keys... do you have a @KeyGenerator example for that?
[13:26:20 CDT(-0500)] <EricDalquist> how do you get the username?
[13:26:29 CDT(-0500)] <EricDalquist> I'm assuming it isn't part of the method parameters?
[13:26:37 CDT(-0500)] <awills> getRemoteUser()
[13:26:55 CDT(-0500)] <EricDalquist> what does your @Cacheable method signature look like?
[13:27:10 CDT(-0500)] <awills> probably not... not looking at it yet...
[13:27:27 CDT(-0500)] <awills> @Cacheable(cacheName="inboxCache")
[13:27:36 CDT(-0500)] <awills> (i guess... haven't written it yet)
[13:27:40 CDT(-0500)] <EricDalquist>
[13:28:02 CDT(-0500)] <EricDalquist> so if the method parameters don't include the data you want to be part of the key you'd need to use a ThreadLocal to pass that data in
[13:28:52 CDT(-0500)] <EricDalquist> like if you were using Spring's dispatcher (portlet|servlet)
[13:28:56 CDT(-0500)] <EricDalquist> you could use http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/context/request/RequestContextHolder.html
[13:29:20 CDT(-0500)] <EricDalquist> and call RequestContextHolder.currentRequestAttributes()
[13:29:26 CDT(-0500)] <EricDalquist> in your key generator
[13:29:31 CDT(-0500)] <awills> ic
[13:29:56 CDT(-0500)] <awills> what if it is a param i'm being passed?
[13:29:57 CDT(-0500)] <EricDalquist> if you're not using Spring you would need stick the request in a Thread Local before the API calll
[13:30:23 CDT(-0500)] <EricDalquist> so if you want only some of the parameters to be used: http://code.google.com/p/ehcache-spring-annotations/wiki/UsingPartialCacheKey
[13:31:37 CDT(-0500)] <EricDalquist> once you get your actual method signature figured out I can give you a more specific example
[13:32:03 CDT(-0500)] <awills> oh this is simple... can use StringCacheKeyGenerator w/ a wrapper object i write and implement a proper toString
[13:32:21 CDT(-0500)] <EricDalquist> yup
[13:32:32 CDT(-0500)] <awills> that's completely simple
[13:33:46 CDT(-0500)] <awills> going to try this approach in email-preview, if you're curious
[13:33:51 CDT(-0500)] <EricDalquist> great
[13:34:01 CDT(-0500)] <EricDalquist> we're using the library a lot at UW
[13:34:21 CDT(-0500)] <EricDalquist> works great to add caching into an app on daos
[13:35:22 CDT(-0500)] <awills> yes... the EmailAccountDaoImpl was exactly where I was looking at inserting it
[13:35:54 CDT(-0500)] <EricDalquist> well let me know how it goes with the docs we have up there
[13:36:08 CDT(-0500)] <EricDalquist> and if there are things that need clarification or missing detauls
[13:36:40 CDT(-0500)] <awills> maybe i'm getting ahead of myself... the StringCacheKeyGenerator chooses a key for putting it into the chace... how does it choose a key for cache lookup??
[13:36:45 CDT(-0500)] <awills> will do
[13:36:54 CDT(-0500)] <EricDalquist> same way
[13:37:12 CDT(-0500)] <EricDalquist> so when foo.myMethod(arg1, arg2) is called
[13:37:21 CDT(-0500)] <EricDalquist> a key is generated first
[13:37:28 CDT(-0500)] <EricDalquist> then that key is used to do a cache get
[13:37:41 CDT(-0500)] <EricDalquist> if there is no cached entry the annotated method is called
[13:37:51 CDT(-0500)] <EricDalquist> the returned value is stored in the cache with the key
[13:38:03 CDT(-0500)] <EricDalquist> if a cached entry is returned that is returned immediately
[13:38:32 CDT(-0500)] <awills> what goes into the key for foo.myMethod(arg1, arg2)?
[13:38:48 CDT(-0500)] <awills> (thought i understood, but now confused)
[13:38:53 CDT(-0500)] <EricDalquist> depends on the key generator in use
[13:38:57 CDT(-0500)] <EricDalquist> and how it is configured
[13:38:59 CDT(-0500)] <awills> arg1 & arg2?
[13:39:18 CDT(-0500)] <EricDalquist> yeah and by default the class & method name
[13:39:20 CDT(-0500)] <EricDalquist> http://code.google.com/p/ehcache-spring-annotations/wiki/StringCacheKeyGenerator
[13:39:56 CDT(-0500)] <EricDalquist> so if you look at the bottom of that page
[13:40:01 CDT(-0500)] <EricDalquist> you see that the key:
[13:40:02 CDT(-0500)] <EricDalquist> [class x.y.z.WeatherDaoImpl, getWeather class x.y.z.Weather, [class java.lang.String], [49931]]
[13:40:14 CDT(-0500)] <awills> looking at that
[13:40:15 CDT(-0500)] <EricDalquist> is generated from the method:
[13:40:16 CDT(-0500)] <EricDalquist> @Cacheable(cacheName="weatherCache", @KeyGenerator(name="StringCacheKeyGenerator"))
[13:40:16 CDT(-0500)] <EricDalquist> Weather getWeather(String zip)
[13:41:13 CDT(-0500)] <EricDalquist> so the key is actually generated from an Object[]
[13:41:42 CDT(-0500)] <EricDalquist> where you have Class, Method, Class[] parameter types, Object[] argument values
[13:42:11 CDT(-0500)] <EricDalquist> if you take a look at http://code.google.com/p/ehcache-spring-annotations/wiki/CacheKeyGenerators
[13:42:16 CDT(-0500)] <awills> what if you only want to use some arguments, not all?
[13:42:24 CDT(-0500)] <EricDalquist> http://code.google.com/p/ehcache-spring-annotations/wiki/UsingPartialCacheKey
[13:42:36 CDT(-0500)] <EricDalquist> there is an additional argument level annotation for that
[13:43:06 CDT(-0500)] <EricDalquist> so on the CacheKeyGenerators page there is also a description of the available config options for all the key generators
[13:43:28 CDT(-0500)] <EricDalquist> which let you toggle if the method signature and parameter types are included in the generated key
[13:43:31 CDT(-0500)] <awills> got it
[13:48:47 CDT(-0500)] <awills> this example is bad: @Cacheable(cacheName="weatherCache", @KeyGenerator(name="StringCacheKeyGenerator"))
[13:48:55 CDT(-0500)] <awills> this wiki page: http://code.google.com/p/ehcache-spring-annotations/wiki/StringCacheKeyGenerator
[13:49:12 CDT(-0500)] <EricDalquist> what would make it better?
[13:49:52 CDT(-0500)] <awills> keyGenerator =
[13:50:01 CDT(-0500)] <awills> @Cacheable(cacheName="inboxCache", keyGenerator = @KeyGenerator(name="StringCacheKeyGenerator"))
[13:50:14 CDT(-0500)] <awills> but w/ "weatherCache"
[13:50:19 CDT(-0500)] <EricDalquist> ah got it
[13:50:19 CDT(-0500)] <EricDalquist> thanks
[13:53:47 CDT(-0500)] <awills> ehcace.xml goes in the root of the classpath?
[13:54:16 CDT(-0500)] <awills> might be worth mentioning the default location here: http://code.google.com/p/ehcache-spring-annotations/wiki/UsingCacheable
[13:54:27 CDT(-0500)] <EricDalquist> yeah
[13:54:45 CDT(-0500)] <EricDalquist> that is why that page links to http://ehcache.org/documentation/configuration.html
[13:59:16 CDT(-0500)] <awills> yeah saw that
[14:00:20 CDT(-0500)] <awills> building for first try now... 36 min since I started asking questions about it on IRC
[14:16:23 CDT(-0500)] <EricDalquist> Spring SPEL is neat!
[15:26:03 CDT(-0500)] <EricDalquist> just added SPEL support to the Image portlet: https://developer.jasig.org/source/changelog/jasigsvn/?projectKey=UP&cs=21383
[15:26:34 CDT(-0500)] <EricDalquist> and you can now specify a preference that looks like:
[15:26:34 CDT(-0500)] <EricDalquist> contextPath + '/media/org/jasig/portal/channels/CImage/admin_feature.png'
[15:54:13 CDT(-0500)] <awills> can these cache annotations work with spring 2.5.6?
[15:54:23 CDT(-0500)] <EricDalquist> yup
[15:54:27 CDT(-0500)] <EricDalquist> 2.5 or 3.0
[15:54:40 CDT(-0500)] <awills> cool
[16:19:52 CDT(-0500)] <awills> what do i need to do to access an ehcache as an mbean in jmx?
[16:34:26 CDT(-0500)] <EricDalquist> see https://source.jasig.org/uPortal/trunk/uportal-war/src/main/resources/properties/contexts/jmxContext.xml
[16:34:34 CDT(-0500)] <EricDalquist> at the bottom of the file
[17:00:36 CDT(-0500)] <awills> tyvm
[17:00:56 CDT(-0500)] <EricDalquist> UHG we recently switched to Oracle SFS
[17:01:00 CDT(-0500)] <EricDalquist> filling out a travel request
[17:01:07 CDT(-0500)] <EricDalquist> horribly painful
[17:01:22 CDT(-0500)] <awills> i suppose that's a feature
[17:01:30 CDT(-0500)] <EricDalquist> hah
[17:01:37 CDT(-0500)] <EricDalquist> I spent 30 minutes on my first try
[17:01:47 CDT(-0500)] <EricDalquist> then accidentally hit refresh
[17:01:55 CDT(-0500)] <EricDalquist> apparently that destroys all state
[17:18:51 CDT(-0500)] * tsnfoo (~tsnfoo@cpe-173-88-27-191.columbus.res.rr.com) has joined ##uportal
[18:15:25 CDT(-0500)] * bsparks (~bsparks@wsip-72-215-204-133.ph.ph.cox.net) has joined ##uportal
Page Comparison
General
Content
Integrations