T5: @Cached(watch) parameter requires public property

2011-04-28 Thread Adam Zimowski
Hi Again -

Is there a specific reason why watch parameter for @Cached annotation
requires public property when using default prop binding? This is an
inconvenient limitation IMO, as I don't necessarily want to expose my
watch property publicly. For example, my watch on getShoppingCart may
be something like this:

@Cached(watch=cartWatch)
public ShoppingCartBean getShoppingCart() {

Long userId = getUserId();
Long cartId = getCartId();
log.debug(cartId: {}, userId: {}, cartId, userId);

return cartService.findShoppingCart(cartId, userId);
}

private long getCartWatch() {
Long userId = getUserId();
Long cartId = getCartId();
if(userId == null) userId = 0L;
if(cartId == null) cartId = 0L;

return userId + cartId;
}

Minor issue, but unless there is a strict reason behind it, I thing
watch should allow any scope.

Adam

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: T5: @Cached(watch) parameter requires public property

2011-04-28 Thread Thiago H. de Paula Figueiredo
On Thu, 28 Apr 2011 17:38:01 -0300, Adam Zimowski zimowsk...@gmail.com  
wrote:



Hi Again -


Hi!


Is there a specific reason why watch parameter for @Cached annotation
requires public property when using default prop binding?


I'd guess the JVM bytecode verifier would complain about invalid access,  
as the prop binding generates its classes outside the page class.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org