[JIRA-Opensymphony] Commented: (CACHE-50) Allow third party code to send event notifications

[email protected]
Newsgroups gmane.comp.java.open-symphony.cvs
Message-ID <[email protected]>
The following comment has been added to this issue:

     Author: Chris Miller
    Created: Wed, 6 Aug 2003 10:14 AM
       Body:
I'm a bit unclear of your scenario, could you give me an example of what you mean by "group names are constructed in a way that identifies the entities from which data was used in cache entries"?

Also, the sendNotification() method is *supposed* to be protected - it is there to abstract the details of sending a message across the cluster away from the AbstractBroadcastingListener. It wasn't designed to be called directly, rather it gets called as the result of a cache event. The clustering support is peer-to-peer, caches communicate with each other each time something gets flushed. It seems that what you really are after is a way to flush the caches 'externally' from the EJB tier, even though a cache does not live there?

I've made the ClusterNotification constants public which should solve your package dependency, but I've left the sendNotification() as protected since I'm not convinced that should be exposed (however you can still override it and make it public if you so choose). In a post 2.0 build I'll try to come up with a cleaner way to allow external broadcasting.

(Oh yeah one other small thing - you shouldn't have needed to alter oscache.jar at all, you should be able have a duplicate package name coexisting outside the jar file without problems. I do this often when I need to override/workaround a problem in a 3rd party library).
---------------------------------------------------------------------
View the issue:

  http://jira.opensymphony.com/secure/ViewIssue.jspa?key=CACHE-50


Here is an overview of the issue:
---------------------------------------------------------------------
        Key: CACHE-50
    Summary: Allow third party code to send event notifications
       Type: Improvement

     Status: Assigned
   Priority: Minor

    Project: OSCache
 Components: 
             Listeners
   Versions:
             2.0 beta 2

   Assignee: Chris Miller
   Reporter: Sheldon Hearn

    Created: Wed, 6 Aug 2003 8:47 AM
    Updated: Wed, 6 Aug 2003 8:47 AM
Environment: OSCache used in JSP pages served by Tomcat.
JBoss providing data that we want to cache.

Description:
We're using OSCache to reduce expensive round-tripping between web containers and the EJB container.

We use groups to implement fine-grained cache control, where group names are constructed in a way that identifies the entities from which data was used in cache entries.

When entities change, the entities (running in the EJB container) fire cache flush notifications with JavaGroupsBroadcastingListener.sendNotification().

In this way, all cache entries associated with a changed entity are flushed.  It works wonderfully, and OSCache rocks hard, fast and furious.

The problems are:

1) AbstractBroadcastingListener and descendents declare sendNotification() protected, and

2) ClusterNotification's FLUSH_KEY, FLUSH_GROUP, FLUSH_PATTERN and FLUSH_CACHE constants are package-protected.

This means that we have to graft our own wrapper class into the com.opensymphony.oscache.plugins.clustersupport package and reroll oscache.jar.

Please consider promoting these overly protected members to public.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.opensymphony.com/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.