Transcript Cs526proj

Event Application
Using
Pushlets
by
Patricia Ferrao
December, 2002
What Is A Pushlet?
Java servlet application designed by Just
van den Broecke from Just Objects B.V
 Allows a web server to push information to
a client browser
 Pushes events to clients using javascript
 Browsers use javascript to register for
events with pushlets

What Is My Event Application?






Uses pushlets to generate a particular type of event,
called “eventapp”
Events are generated and cleared randomly every
few seconds
Up to 10 events can be active at one time
Events contain an event number, description and
severity
Browser javascript allows a client to register with
pushlets for “eventapp” events
Client-side javascript displays “eventapps” as they
come in
Advantages of using
Pushlets






Run as a standard servlet application
Don’t require any Java applets or plug-ins
Integrate well with DHTML
Use standard HTTP connection
Pushlets are simple
Can send as little information as required as
soon as it becomes available
Disadvantages of Pushlets
Cross-browser DHTML compatibility
 Hogs resources such as threads and
sockets

Can we redesign Tomcat such that for
pushlets, connection control is transferred to
one main thread??
What Can You Do With
Pushlets






Chat groups
Stock feed application
Alarm reporting for servers or embedded systems
Can have events generated by outside source (other
servers or other clients) through postlets
Servlet can do event manipulation such as filtering,
merging, etc
Can have a central server push events to multiple
edge servers who handle local clients. (Scalability)
Distributed Pushlet Architecture
Competing Technologies
HTML Refresh


Refresh is at a fixed time interval, but events
can be generated anytime. Not good for realtime response!
Forces Server to make connection even if
there is no new data available. Not good for
server load!
Competing Technologies
(Con’t)
Server Side RMI or CORBA



Requires use of client-side applets
Need to learn RMI or CORBA. Java is more
mainstream
Difficult to integrate with HTML web page
Competing Technologies
(Con’t)
Messaging



Needs client side application
Uses non-standard ports and protocols
Difficult to integrate with HTML web page
Observations
 Tomcat
does not time-out pushlet
connections, even if not frequently
used
 Pushlet
servlet does hold up
Tomcat client thread
Future Of Pushlets





The author is continuing to evolve the
technology
Use UDP to send events back to client (no
connection hold-up)
Allow events to be generated externally over
RMI or UDP/TCP
Have pushlets keep state or history
information for new clients
Use multicast to send events back to clients
References
for source code,
installation guide, demos, whitepaper

http://www.pushlet.com/

http://www.javaworld.com/javaworld/jw-03-2000/jw-03-pushlet_p.html
“Pushlets: Send events from servlets to DHTML client browsers”, Just
van den Broecke, JavaWorld, March 2000.