forked from Red5/red5-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved some classes from common to server to support WS lifecycle call…
…backs
- Loading branch information
Showing
10 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
import org.red5.io.IStreamableFile; | ||
import org.red5.io.ITagReader; | ||
import org.red5.logging.Red5LoggerFactory; | ||
import org.red5.net.websocket.WebSocketConnection; | ||
import org.red5.server.api.IClient; | ||
import org.red5.server.api.IConnection; | ||
import org.red5.server.api.Red5; | ||
|
@@ -50,6 +51,7 @@ | |
import org.red5.server.api.stream.IStreamService; | ||
import org.red5.server.api.stream.IStreamableFileFactory; | ||
import org.red5.server.api.stream.ISubscriberStream; | ||
import org.red5.server.api.websocket.IWebSocketAwareHandler; | ||
import org.red5.server.exception.ClientRejectedException; | ||
import org.red5.server.jmx.mxbeans.ApplicationMXBean; | ||
import org.red5.server.messaging.AbstractPipe; | ||
|
@@ -99,7 +101,7 @@ | |
* @author Paul Gregoire ([email protected]) | ||
* @author Michael Klishin | ||
*/ | ||
public class MultiThreadedApplicationAdapter extends StatefulScopeWrappingAdapter implements ISharedObjectService, IBroadcastStreamService, IOnDemandStreamService, ISubscriberStreamService, ISchedulingService, IStreamSecurityService, ISharedObjectSecurityService, IStreamAwareScopeHandler, ApplicationMXBean { | ||
public class MultiThreadedApplicationAdapter extends StatefulScopeWrappingAdapter implements ISharedObjectService, IBroadcastStreamService, IOnDemandStreamService, ISubscriberStreamService, ISchedulingService, IStreamSecurityService, ISharedObjectSecurityService, IStreamAwareScopeHandler, IWebSocketAwareHandler, ApplicationMXBean { | ||
|
||
/** | ||
* Logger object | ||
|
@@ -626,6 +628,12 @@ public boolean appConnect(IConnection conn, Object[] params) { | |
return true; | ||
} | ||
|
||
@Override | ||
public boolean appConnect(WebSocketConnection wsConn, Object[] params) { | ||
log.debug("appConnect: {}", wsConn); | ||
return true; | ||
} | ||
|
||
/** | ||
* Handler method. Called every time new client connects (that is, new IConnection object is created after call from a SWF movie) to the | ||
* application. | ||
|
@@ -669,6 +677,12 @@ public void appDisconnect(IConnection conn) { | |
} | ||
} | ||
|
||
@Override | ||
public boolean appDisconnect(WebSocketConnection wsConn) { | ||
log.debug("appDisconnect: {}", wsConn); | ||
return true; | ||
} | ||
|
||
/** | ||
* Handler method. Called every time client disconnects from the room. | ||
* | ||
|
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
server/src/main/java/org/red5/server/api/websocket/IWebSocketAwareHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.red5.server.api.websocket; | ||
|
||
import org.red5.net.websocket.WebSocketConnection; | ||
|
||
/** | ||
* Interface for handlers that are aware of the WebSocketConnection. | ||
* | ||
* @author Paul Gregoire | ||
*/ | ||
public interface IWebSocketAwareHandler { | ||
|
||
/** | ||
* Handler method. Called when a WebSocket connects to the application. | ||
* | ||
* @param conn | ||
* WebSocket connection object | ||
* @param params | ||
* List of parameters after connection URL | ||
* @return true upon success, false otherwise | ||
*/ | ||
boolean appConnect(WebSocketConnection wsConn, Object[] params); | ||
|
||
/** | ||
* Handler method. Called when a WebSocket disconnects from the application. | ||
* | ||
* @param conn | ||
* WebSocket connection object | ||
* @return true upon success, false otherwise | ||
*/ | ||
boolean appDisconnect(WebSocketConnection conn); | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.