nl.justobjects.pushlet.core
Class BrowserAdapter

java.lang.Object
  extended by nl.justobjects.pushlet.core.BrowserAdapter
All Implemented Interfaces:
ClientAdapter, Protocol

public class BrowserAdapter
extends java.lang.Object
implements ClientAdapter, Protocol

Generic implementation of ClientAdapter for browser clients.

Version:
$Id: BrowserAdapter.java,v 1.6 2007/11/09 13:15:35 justb Exp $
Author:
Just van den Broecke - Just Objects ©

Field Summary
private  int bytesSent
           
static java.lang.String END_DOCUMENT
           
private  java.io.PrintWriter servletOut
           
private  javax.servlet.http.HttpServletResponse servletRsp
           
static java.lang.String START_DOCUMENT
           
 
Fields inherited from interface nl.justobjects.pushlet.core.Protocol
DEFAULT_SERVLET_URI, E_ABORT, E_DATA, E_HEARTBEAT, E_HEARTBEAT_ACK, E_JOIN, E_JOIN_ACK, E_JOIN_LISTEN, E_JOIN_LISTEN_ACK, E_LEAVE, E_LEAVE_ACK, E_LISTEN, E_LISTEN_ACK, E_NACK, E_PUBLISH, E_PUBLISH_ACK, E_REFRESH, E_REFRESH_ACK, E_SUBSCRIBE, E_SUBSCRIBE_ACK, E_UNSUBSCRIBE, E_UNSUBSCRIBE_ACK, FORMAT_JAVASCRIPT, FORMAT_SERIALIZED_JAVA_OBJECT, FORMAT_XML, FORMAT_XML_STRICT, MODE_POLL, MODE_PULL, MODE_STREAM, P_EVENT, P_FORMAT, P_FROM, P_ID, P_MODE, P_REASON, P_SEQ, P_SUBJECT, P_SUBSCRIPTION_ID, P_SUBSCRIPTION_LABEL, P_TIME, P_TO, P_URL, P_WAIT, SUBJECT_META, SUBJECT_META_JOINS, SUBJECT_META_SUBS
 
Constructor Summary
BrowserAdapter(javax.servlet.http.HttpServletResponse aServletResponse)
          Constructor.
 
Method Summary
protected  java.lang.String event2JavaScript(Event event)
          Converts the Java Event to a JavaScript function call in browser page.
 void push(Event anEvent)
          Push Event to client.
protected  void send(java.lang.String s)
          Send any string to browser.
 void start()
          Generic init.
 void stop()
          End HTML page in client browser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START_DOCUMENT

public static final java.lang.String START_DOCUMENT
See Also:
Constant Field Values

END_DOCUMENT

public static final java.lang.String END_DOCUMENT
See Also:
Constant Field Values

servletOut

private java.io.PrintWriter servletOut

servletRsp

private javax.servlet.http.HttpServletResponse servletRsp

bytesSent

private int bytesSent
Constructor Detail

BrowserAdapter

public BrowserAdapter(javax.servlet.http.HttpServletResponse aServletResponse)
Constructor.

Method Detail

start

public void start()
           throws java.io.IOException
Generic init.

Specified by:
start in interface ClientAdapter
Throws:
java.io.IOException

push

public void push(Event anEvent)
          throws java.io.IOException
Push Event to client.

Specified by:
push in interface ClientAdapter
Throws:
java.io.IOException

stop

public void stop()
End HTML page in client browser.

Specified by:
stop in interface ClientAdapter

send

protected void send(java.lang.String s)
             throws java.io.IOException
Send any string to browser.

Throws:
java.io.IOException

event2JavaScript

protected java.lang.String event2JavaScript(Event event)
                                     throws java.io.IOException
Converts the Java Event to a JavaScript function call in browser page.

Throws:
java.io.IOException


Copyright 2000-2003 - Just Objects B.V.