com.sun.grizzly.filter
Interface Server

All Known Implementing Classes:
CustomProtocolServer

public interface Server

Server API for communicating with Client.

Version:
1.0
Author:
John Vieten 16.09.2008

Method Summary
 OutputStream getOutputStream(Context connection)
          If a server wants to write to a specific connection.
 OutputStream getOutputStream(SelectionKey connection)
          If a server wants to write to a specific connection.
 void service(InputStream inputStream, ProtocolOutputStream outputStream, Integer SessionId, Object serverContext)
          Gets called when Client calls this server.
 void start()
          Inits and starts Server
 void stop()
          Stops Server
 

Method Detail

getOutputStream

OutputStream getOutputStream(Context connection)
If a server wants to write to a specific connection.

Parameters:
connection - in the momment should be a Context
Returns:
OutputStream for writing to client

getOutputStream

OutputStream getOutputStream(SelectionKey connection)
If a server wants to write to a specific connection.

Parameters:
connection - in the momment should be a SelectionKey
Returns:
OutputStream for writing to client

service

void service(InputStream inputStream,
             ProtocolOutputStream outputStream,
             Integer SessionId,
             Object serverContext)
Gets called when Client calls this server. This may be done by Client.callRemote() or Client.getOutputStream()

Parameters:
inputStream - bytes received from client
outputStream - bytes that server wants to reply
SessionId - (can be null) if client has added an session id
serverContext - Probably Context gives Server access to Transport framework

start

void start()
Inits and starts Server


stop

void stop()
Stops Server



Copyright © 2013 Oracle Corporation. All Rights Reserved.