javaguy44
unread,Nov 13, 2011, 4:38:45 PM11/13/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Groovy++
Hi,
I'm using groovypp and gretty, which are both great libraries.
Unfortunately I'm looking for an example of HttpClientPool & bindLater
with a local variable I want to access in the GrettyHttpResponse.
Currently my local var is null. As an example:
MimeMessage message = mail.message
httpClientPool.allocateResource() { it ->
GrettyClient grettyClient = it
GrettyHttpRequest grettyHttpRequest = new
GrettyHttpRequest("/")
grettyClient.request(grettyHttpRequest,
httpClientPool.executor) { responseBindLater ->
GrettyHttpResponse grettyHttpResponse =
responseBindLater.get()
println("message=${message}")
httpClientPool.releaseResource(grettyClient)
}
}
In this example, the variable message is null in the pringln statement
after I get the GrettyHttpResponse. In normal java / Swing
invokeLater, marking message as final is enough. However I'm not sure
how to bind in this case
Would appreciate an example / advice!
Thanks