[Beepcore-java-users] SessionEventListener question
Status: Beta
Brought to you by:
huston
From: Riggio, M. <Mic...@un...> - 2002-09-27 18:34:44
|
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 |