[JBoss Seam] - how to use PropertyChangeListener on entity beans for drools
by ellenzhao
I want to use:
| StatefulSession ss = myRuleBase.newStatefulSession();
| ss.setGlobal("conversationBean", this);
| ...
| ss.insert(entity, true);
| ...
|
The true flag means the obj I inserted into the ss rule session is a dynamic object, the stateful rule session is aware of the changes of the properties of the entity. But according to Drools manual section 1.6.4.5, I must write code like this in my entity beans:
| private final PropertyChangeSupport changes = new PropertyChangeSupport( this );
| ...
| public void addPropertyChangeListener(final PropertyChangeListener l) {
| this.changes.addPropertyChangeListener( l );
| }
|
| public void removePropertyChangeListener(final PropertyChangeListener l) {
| this.changes.removePropertyChangeListener( l );
| }
| ...
|
| public void setState(final String newState) {
| String oldState = this.state;
| this.state = newState;
| this.changes.firePropertyChange( "state",
| oldState,
| newState );
| }
|
I have a feeling that frameworks like hibernate or seam or the ejb 3 container have already some property change listeners employed for entity beans....the property change listeners do already exist, how can I make Drools share the property change listeners? Thanks!
Regards,
Ellen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064550#4064550
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4064550
19Â years
[JBoss Seam] - MDB or MD Pojo.
by garypinkham
What I have is a command line Pojo (either Java or .Net) that drops status messages on a queue. I want to pick up those status messages and save them to the DB and let my UI client know about them. I have this working in a different application (using Spring) but wanted to try this out with Seam. Since the rest of my app is Pojo I didn't want to use an MDB. When I read the docs for Message Driven Pojo's for JBoss I was a bit concerned as it seems that both ends know about each other.
So finally to the question. Does Seam provide any assistance with this? I've been trying to find the right place in the docs. I found stuff on publishing to a queue (not a topic) and that works great. Just trying to figure out the "Best/Recommended" way to receive the messages with Seam..
Thanks!
Gary
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064547#4064547
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4064547
19Â years