SessionEventListener question

"Riggio, Michael" <[email protected]> Fri, 27 Sep 2002 14:34:23 -0400
Newsgroups gmane.network.beep.beepcore.java.general
Message-ID <3B10FF0A008FF6458711E6E375E83041023763F5@USTR-EXCH2.na.uis.unisys.com>
Hi,
      I have a class that listens for connections using a Profile from
another class.  After a client connects to start the session I would like to
be notified when the Profile receives a startChannel event.  I do not want
to do any hard coding in my profile that would require the name of my main
class, for obvious reasons.  So, I've done the following...

In my main class that listens for connections:
After I establish a BEEP session, I make a call to registerForEvent like so
(also, my main class implements SessionEventListener):
session.registerForEvent(this, SessionEvent.CHANNEL_OPENED_EVENT_CODE);

This compiles fine.  Now in my profile class I added the following code to
startChannel:
channel.getSession().fireEvent(SessionEvent.CHANNEL_OPENED_EVENT_CODE,
null);

My hope was that when my profile receives a startChannel event it can then
notify my main class that a channel has started.  Unfortunatly, I get a
compile error because fireEvent is protected:
fireEvent(int,java.lang.Object) has protected access in
org.beepcore.beep.core.Session
 
channel.getSession().fireEvent(SessionEvent.CHANNEL_OPENED_EVENT_CODE,
null);


Perhaps I'm going at this the wrong way?  Any suggestions/work-arounds?

Thanks for your time,
-Mike


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf