net.jini.jeri.connection
Class ServerConnectionManager

java.lang.Object
  extended by net.jini.jeri.connection.ServerConnectionManager

public final class ServerConnectionManager
extends Object

Provides server-side connection management using the Jini extensible remote invocation (Jini ERI) multiplexing protocol to frame and multiplex requests and responses over connections.

A ServerConnectionManager is created by a connection-based ServerEndpoint implemention to manage connections. The handleConnection method is used to manage connections for a particular ServerConnection.

Each session of the Jini ERI multiplexing protocol is mapped to a new request. Request data is read as the data received for the session, and response data is written as the data sent for the session.

Since:
2.0
Author:
Sun Microsystems, Inc.
Implementation Specifics:
This implementation uses the Logger named net.jini.jeri.connection.ServerConnectionManager to log information at the following levels:

Level Description
HANDLED I/O exception initiating handling of a new request on a connection
HANDLED I/O exception initiating multiplexing on a new connection

This implementation uses the Logger named net.jini.jeri.connection.mux to log information at the following levels:

Level Description
WARNING unexpected exception during asynchronous I/O processing, or thread creation failure
HANDLED I/O exception during asynchronous I/O processing
FINEST detailed implementation activity

Constructor Summary
ServerConnectionManager()
          Creates a new ServerConnectionManager.
 
Method Summary
 void handleConnection(ServerConnection conn, RequestDispatcher dispatcher)
          Starts handling requests received on the specified newly accepted connection, dispatching them to the specified request dispatcher asynchronously, and returns immediately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerConnectionManager

public ServerConnectionManager()
Creates a new ServerConnectionManager.

Method Detail

handleConnection

public void handleConnection(ServerConnection conn,
                             RequestDispatcher dispatcher)
Starts handling requests received on the specified newly accepted connection, dispatching them to the specified request dispatcher asynchronously, and returns immediately.

The Jini ERI multiplexing protocol is started on the connection (as the server). As each request is received, the processRequestData method of the connection will be invoked with the request input stream and the response output stream of the InboundRequest created for the request, to obtain a handle for the request. The checkPermissions method of the connection is then invoked with that handle, and if it returns normally, dispatcher is invoked with the InboundRequest. All of this processing is performed using the same security context in force when this handleConnection method was invoked. The checkPermissions, checkConstraints, and populateContext methods of each InboundRequest created are implemented by delegating to the corresponding method of the connection passing the handle for the request and the other arguments (if any).

The implementation may close the connection if it determines that the client has closed its side of the connection, if there is an unrecoverable problem with the connection, or for other implementation-specific reasons. The caller is responsible for closing the connection when the close method of the associated ListenHandle is invoked.

Parameters:
conn - the server connection
dispatcher - the request dispatcher to use to dispatch requests received on the specified connection
Throws:
NullPointerException - if conn or dispatcher is null


Copyright 2007, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.