Skip Headers

# Server

Previous

Next

Example: Server Creating RMIRemoteSessionController for Client shows the code you add to your application's RMI service (`MyRMIServerManagerImpl`) to create and return an instance of an `RMIRemoteSessionController` to the client. The controller sits between the remote client and the local TopLink session.

The `RMIRemoteSessionController` you create on the server is based on a TopLink server session. You create and configure this server session as described in "Creating a Server Session" and "Configuring Server Sessions".

Server Creating RMIRemoteSessionController for Client

    RMIRemoteSessionController controller = null;
    try {
        // Create instance of RMIRemoteSessionControllerDispatcher which implements
        // RMIRemoteSessionController. The constructor takes a TopLink session as a parameter
        controller = new RMIRemoteSessionControllerDispatcher (localTopLinkSession);
    } catch (RemoteException exception) {
        System.out.println("Error in invocation " + exception.toString());
    }
    return controller;