UC Berkeley Group for User Interface Research
Updated November 17, 2000

edu.berkeley.guir.lib.net
Class ServerPluginAdapter

java.lang.Object
  |
  +--edu.berkeley.guir.lib.net.ServerPluginAdapter
All Implemented Interfaces:
ServerPlugin

public class ServerPluginAdapter
extends Object
implements ServerPlugin

A sample implementation of the ServerPlugin interface. By default, does nothing.

This software is distributed under the Berkeley Software License.

 Revisions:  - GUIRLib-v1.0-1.0.0, Dec 11 1997, JH
               Created class
             - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH
               Touched for GUIRLib release
             - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH
               Touched for GUIRLib release
             - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH
               Touched for GUIRLib release
 

Since:
JDK 1.1.4
Version:
GUIRLib-v1.4-1.0.0, Aug 31 2000
Author:
Jason Hong ( jasonh@cs.berkeley.edu )

Constructor Summary
ServerPluginAdapter()
           
 
Method Summary
 void onCloseConnection()
          Called when the connection is closed.
 void onFinish()
          Called once, when the server is closed completely.
 void onOpenConnection(InetAddress addr, InputStream istream, OutputStream ostream)
          Called when the server opens a connection.
 void onReceiveData(InputStream istream, OutputStream ostream)
          Called when there is new data to be read.
 void onStart()
          Called once, when the server is started.
 void onWaitForConnection()
          Called when the server is waiting for a connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerPluginAdapter

public ServerPluginAdapter()
Method Detail

onStart

public void onStart()
Description copied from interface: ServerPlugin
Called once, when the server is started.
Specified by:
onStart in interface ServerPlugin

onWaitForConnection

public void onWaitForConnection()
Description copied from interface: ServerPlugin
Called when the server is waiting for a connection. This method is called each time the server waits for a connection.
Specified by:
onWaitForConnection in interface ServerPlugin

onOpenConnection

public void onOpenConnection(InetAddress addr,
                             InputStream istream,
                             OutputStream ostream)
Description copied from interface: ServerPlugin
Called when the server opens a connection. This method is called each time a connection is made to the server.
Specified by:
onOpenConnection in interface ServerPlugin
Following copied from interface: edu.berkeley.guir.lib.net.ServerPlugin
Parameters:
addr - is the address of the client connecting to this server.
istream - is the InputStream of the Socket, the input the client sends to the server.
ostream - is the OutputStream of the Socket, the output the server sends to the client.

onReceiveData

public void onReceiveData(InputStream istream,
                          OutputStream ostream)
                   throws IOException
Description copied from interface: ServerPlugin
Called when there is new data to be read. The Pluggable handles all of the data. This method is only called once for every connection.
Specified by:
onReceiveData in interface ServerPlugin
Following copied from interface: edu.berkeley.guir.lib.net.ServerPlugin
Parameters:
istream - is the InputStream of the Socket, the input the client sends to the server.
ostream - is the OutputStream of the Socket, the output the server sends to the client.

onCloseConnection

public void onCloseConnection()
Description copied from interface: ServerPlugin
Called when the connection is closed. This method is called once for every connection.
Specified by:
onCloseConnection in interface ServerPlugin

onFinish

public void onFinish()
Description copied from interface: ServerPlugin
Called once, when the server is closed completely.
Specified by:
onFinish in interface ServerPlugin

Copyright Information