As a learning/debug helper I am trying to catch events when components are stored/removed from any context. org.jboss.seam.preSetVariable and the like do pretty much what I am looking for, but I would like to set this in a more coarse grained manner. As it is now, to use this I need to create a method for each event and for each variable I want to catch an event on. I would like to declare the components I want to catch events on and receive the events on the same listener.
I could programatically add the observer when I see a component I am interested in but when the method is called I will not know which component it is for as there is no parameter passed to these methods.
As an example if I have the following:
@Name( "personAction" ) @Scope( ScopeType=PAGE ) public class PersonAction implements Serializable { @In( scope=ScopeType.SESSION ) Person person; ... }
public presetVariable( Event someEvent ) { log.debug( "Event variable:" + someEvent.getVariable() ); log.debug( "Component:" + someEvent.getComponent() ); log.debug( "Contect type:" + someEvent.getContextType() ); }