[jbosscache-dev] Usage of Option override

Ben Wang ben.wang at jboss.com
Thu Aug 31 03:24:24 EDT 2006


Manik,

Maybe I have missed something here. But what's the best usage of overriding the Option in 2.0? Currently, I have to do like:

         gravitateOption_.setForceDataGravitation(true);
         cache_.getInvocationContext().setOptionOverrides(gravitateOption_);
         Object obj = cache_.get(fqn, key);
         gravitateOption_.setForceDataGravitation(false);
         cache_.getInvocationContext().setOptionOverrides(gravitateOption_);
         return obj;

Of which is painful. I can use getOptionOverrides to retrieve the option and set it there. However, should I also check for nullity there?

Thanks,

-Ben




More information about the jbosscache-dev mailing list