Archive for July, 2008

Muttontown Preserve Hike

Monday, July 21st, 2008

Katie Bennet and I did a small, quiet hike on Long Island Saturday, July 19. The Muttontown Preserve is the largest nature preserve in Nassau country, somewhere in the vicinity of 550 acres. There are several marked trails for hiking (good ol’ #5 :) & you’re next red 3), cross-country skiing, and horseback riding.

The highlights of our hike were of course spending time with Ms. Bennet, being overly prepared, a super cool frog, berries that I know Katie wants to try, lots of beautiful wild flowers, the letter J, and the famous Muttontown Preserve “bridge.”

I certainly encourage anyone reading to go outside and enjoy the natural world around us.

super cool frog

Grails, Constructor Injection, and Spring Bean Builders

Friday, July 18th, 2008

Had a run-in with Grails and trying to wire up some custom beans using Grails’s Spring Bean Builder DSL mechanism. I was wiring up an instance of the Apache HttpClient object, which can be constructed with HttpClientParams and/or HttpConnectionManager. Now the Grails BB syntax expects the first argument to be the type you’re wiring, followed by the parameters to pass into the constructor. Something like this:
httpClient(org.apache.commons.httpclient.HttpClient, defaultGlobalHttpConnectionManager)

Where httpClient is the bean name/id, org.apache.commons.httpclient.HttpClient is the type we’re wiring, and defaultGlobalHttpConnectionManager is some custom implementation of the HttpConnectionManager.

When using this Bean Builder syntax, Grails gets consfused about the argument ordering and is unable to create its Grails Application Context. I also tried the following which didn’t work either.
httpClient(org.apache.commons.httpclient.HttpClient, null,
defaultGlobalHttpConnectionManager)

I don’t know if you can explicitly set the arguments the same way you can in the standard XML wiring approach. My solution was then to use the tried and true method.

<bean id="defaultGlobalHttpConnectionManager"
class="com.site.commons.http.GlobalHttpConnectionManager"
destroy-method="shutDown" lazy-init="default" autowire="default"
dependency-check="default">
<property name="soTimeout">
<value>20000</value>
</property>
<property name="connectionTimeout">
<value>20000</value >
</property>
</bean>


<bean id="httpClient"
class="org.apache.commons.httpclient.HttpClient" lazy-init="default"
autowire="default"
dependency-check="default">
<constructor-arg ref="defaultGlobalHttpConnectionManager" />
</bean>

Resources:
http://grails.org/doc/1.0.x/
http://hc.apache.org/httpclient-3.x/apidocs/index.html

Meditation

Friday, July 18th, 2008

I’ve been wanting to try this whole mediation thing for a while now, and once again the topic has made an appearance. Thanks to Katie B and Mike V, I gave it a shot last night. Katie and I attempted a 15-20 minute session.

It was pretty darn hard, but in the end I figured out a few things that really helped me calm my overactive brain. First off, I can’t close my eyes. When my eyes are shut, my mental film projector begins replaying accounts of the scenes I’ve seen that week. Two, and I think this is common, but I focused all my attention on my breathing pattern coupled with my signature blessing hand gesture to accompany the rhythm.

For a solid 5 minutes or so, I was completely relaxed and calm. My mind was actually quiet and I liked it. :)

Think I’ll try it again.. You should too.

Hello world!

Friday, July 18th, 2008

Welcome to my blog, an account of the happenings in my world.