jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet" <guillaume.no...@deliasystems.com>
Subject RE: Handeling events
Date Tue, 27 Apr 2004 07:41:48 GMT
I was looking for a way to be notified of insertion/removal
when i found this thread. I saw that the way to do it is to use
IElementEventHandler.
I look through the code and i saw that some events declared in
IElementEventConstants were not used:
	* ELEMENT_EVENT_EXCEEDED_MAXLIFE_ONREQUEST
	* ELEMENT_EVENT_EXCEEDED_IDLETIME_ONREQUEST
	* ELEMENT_EVENT_REMOVED

What i was looking for is a way to know what objects
are accessible in the cache (either memory or disk).
Are the necessary events implemented ? How can i be
aware that an element is inserted or removed from the cache ?

Guillaume

-----Message d'origine-----
De : Aaron Smuts [mailto:aasmuts@wisc.edu]
Envoye : lundi 26 avril 2004 17:55
A : 'Turbine JCS Users List'
Objet : RE: Handeling events


I was wondering what that method was?  Ha!  I didn't write it.

> -----Original Message-----
> From: Mike Pettypiece [mailto:Mike.Pettypiece@EMBARCADERO.COM]
> Sent: Monday, April 26, 2004 10:41 AM
> To: Turbine JCS Users List
> Subject: RE: Handeling events
> 
> I just noticed that CacheAccess.resetElementAttributes() is not
actually
> implemented.
> 
> Try cache.getElementAttributes().addElementEventHandler( new
> EventHandler() );
> 
> -----Original Message-----
> From: Aaron Smuts [mailto:aasmuts@wisc.edu]
> Sent: Monday, April 26, 2004 11:42 AM
> To: 'Turbine JCS Users List'
> Subject: RE: Handeling events
> 
> Are you inserting things into the cache after you change the default
> element attributes or before?  You have to do it before.
> 
> Aaron
> 
> > -----Original Message-----
> > From: Cristian OPINCARU [mailto:cristian.opincaru@unibw-muenchen.de]
> > Sent: Monday, April 26, 2004 9:56 AM
> > To: turbine-jcs-user@jakarta.apache.org
> > Subject: Handeling events
> >
> > Hi,
> >
> > I'm having problems using the events in JCS:
> >
> > Here is my code:
> >
> > public class EventHandler implements IElementEventHandler {
> > 	public EventHandler() {
> > 	}
> >
> > 	public java.io.Serializable handleElementEvent(IElementEvent e)
> {
> > 		System.out.println("!Here!");
> > 		return null;
> > 	}
> > }
> >
> > //..........
> > JCS cache = JCS.getInstance("testCache1"); ElementAttributes ea =
new
> > ElementAttributes(); ea.addElementEventHandler(new EventHandler());
> > cache.resetElementAttributes(ea);
> >
> >
> > I'm then adding 1000 elements in a cache that only handles 100
> objects,
> > and
> > even though some elements are deleted from the cache (to make room
for
> new
> > ones) the handleElementEvent never gets called.
> >
> > Can anyone help me ?
> >
> > Cristian
> >
> > ===========================================================
> > Dipl. Ing. Cristian OPINCARU
> > University of Federal Armed Forces, Munich - Faculty of Informatics
> >
> > Werner-Heisenberg-Weg 39, D-85577, Neubiberg, Germany Building 41 /
> > Room 0224
> >
> > Tel   : +49-89-6004.2279
> > Fax   : +49-89-6004.3898
> > E-mail: Cristian.Opincaru@Unibw-Muenchen.de
> > Web   : http://web.ss.pub.ro/~oppy
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> turbine-jcs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> turbine-jcs-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
turbine-jcs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> turbine-jcs-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
turbine-jcs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
turbine-jcs-user-help@jakarta.apache.org


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



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


Mime
View raw message