[jboss-user] [JBoss Seam] - Seam component as a listener

zzzz8 do-not-reply at jboss.com
Mon May 7 17:07:41 EDT 2007

I would like to have a Seam component used as a listener.  Here's what I mean:

  | @Stateful
  | public class MyClassBean implements MyClass, PacketListener {
  | @In
  | Connection connection = null;
  | @In
  | List<MyMessageList> messageList = null;
  | @Create
  | public void createBean() {
  |     connection.addPacketListener(this);
  | }
  | public void processPacket(Packet packet) {
  |    messageList.add(Packet);
  | }
  | }

The processPacket method has its interface defined by the PacketListener interface and is thus implemented in my bean.  So I want the Seam component to be a listener - this can be seen in the statement:


This seems to work... up to a point.  So when the processPacket method is invoked, I notice messageList doesn't seem to be injected.  What am I doing wrong and is there any way around this?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043768#4043768

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043768

More information about the jboss-user mailing list