You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by sebb <se...@gmail.com> on 2014/03/19 18:25:28 UTC

[JCS] event handler callback not getting called

Adding component marker (please remember to add the subject marker in future.
This list handles user questions for all the Commons components so it
is important that the specific component is identified.

(sorry, cannot help with the question itself)

On 18 March 2014 11:29, pushkar priyadarshi
<pr...@gmail.com> wrote:
> Hi ,
>
> I have used the code from example at
> http://commons.apache.org/proper/commons-jcs/ElementEventHandling.html for
> event handling.
>
> But when an element is evicted from JCS cache im not getting any callback
> though i know cache eviction has happened for element for sure.
>
> Is there anything else that i need to do apart from what is mentioned in
> the example.
>
> CacheAccess<String, String> jcs = JCS.getInstance( "myregion" );
>
>     . . .
>
>     MyEventHandler meh = new MyEventHandler();
>
>     // this should add the event handler to all items as
>     //they are created.
>     // jcs.getDefaultElementAttributes returns a copy not a reference
>     IElementAttributes attributes = jcs.getDefaultElementAttributes();
>     attributes.addElementEventHandler( meh );
>     jcs.setDefaultElementAttributes( attributes );

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [JCS] event handler callback not getting called

Posted by Thomas Vandahl <tv...@apache.org>.
On 19.03.14 18:25, sebb wrote:
>> But when an element is evicted from JCS cache im not getting any callback
>> though i know cache eviction has happened for element for sure.
>>
>> Is there anything else that i need to do apart from what is mentioned in
>> the example.

Would you please open an issue in JIRA with this sample code and the
related configuration attached?

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org