Examples of ERXKeepAliveResponse


Examples of er.extensions.appserver.ERXKeepAliveResponse

   */
  @Override
  public WOResponse handleRequest(WORequest request) {
    String sessionID = request.sessionID();
    String name = request.requestHandlerPath();
    ERXKeepAliveResponse response = responseForSessionIDNamed(sessionID, name);
    response.reset();
    return response;
  }
View Full Code Here

Examples of er.extensions.appserver.ERXKeepAliveResponse

   * @param sessionID the session id of the response
   * @param name the name of the response
   * @return response for ID
   */
  private static ERXKeepAliveResponse responseForSessionIDNamed(String sessionID, String name) {
    ERXKeepAliveResponse response = null;
    if (sessionID != null) {
      if(name == null)  {
        name = "";
      }
      ConcurrentHashMap<String, ERXKeepAliveResponse> sessionResponses = responses.get(sessionID);
      if (sessionResponses == null) {
        ConcurrentHashMap<String, ERXKeepAliveResponse> newSessionResponses = new ConcurrentHashMap<String, ERXKeepAliveResponse>();
        ConcurrentHashMap<String, ERXKeepAliveResponse> prevSessionResponses = responses.putIfAbsent(sessionID, newSessionResponses);
        sessionResponses = (prevSessionResponses == null) ? newSessionResponses : prevSessionResponses;
      }
      response = sessionResponses.get(name);
      if (response == null) {
        ERXKeepAliveResponse newResponse = new ERXKeepAliveResponse();
        ERXKeepAliveResponse prevResponse = sessionResponses.putIfAbsent(name, newResponse);
        response = (prevResponse == null) ? newResponse : prevResponse;
      }
    }
    return response;
  }
View Full Code Here

Examples of er.extensions.appserver.ERXKeepAliveResponse

   * @param sessionID the session id of the push response
   * @param name the name of the push response
   * @return whether or not there is still a response open
   */
  public static boolean isResponseOpen(String sessionID, String name) {
    ERXKeepAliveResponse response = responseForSessionIDNamed(sessionID, name);
    return response != null;
  }
View Full Code Here

Examples of er.extensions.appserver.ERXKeepAliveResponse

   * @param name the name of the push response
   */
  public static void stop(String sessionID, String name) {
    Map<String, ERXKeepAliveResponse> sessionResponses = responses.get(sessionID);
    if (sessionResponses != null) {
      ERXKeepAliveResponse response = sessionResponses.get(name);
      if (response != null) {
        response.reset();
        sessionResponses.remove(name);
      }
      // not going to do an empty check on sessionResponses, because we'd have to synchronize on
      // the top-level responses to do it safely
    }
View Full Code Here

Examples of er.extensions.appserver.ERXKeepAliveResponse

   * @param sessionID the session id of the push response
   * @param name the name of the push response
   * @param message the message to push
   */
  public static void push(String sessionID, String name, String message) {
    ERXKeepAliveResponse response = responseForSessionIDNamed(sessionID, name);
    if (response != null) {
      StringBuilder sb = new StringBuilder();
      sb.append(message.length());
      sb.append(':');
      response.push(sb.toString());
      response.push(message);
    }
  }
View Full Code Here

Examples of er.extensions.appserver.ERXKeepAliveResponse

   * @param sessionID the session id of the push response
   * @param name the name of the push response
   * @param message the message to push
   */
  public static void push(String sessionID, String name, NSData message) {
    ERXKeepAliveResponse response = responseForSessionIDNamed(sessionID, name);
    if (response != null) {
      StringBuilder sb = new StringBuilder();
      sb.append(message.length());
      sb.append(':');
      response.push(sb.toString());
      response.push(message.bytes());
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.