com.sun.jini.example.cancellation
Class Server

java.lang.Object
  extended bycom.sun.jini.example.cancellation.Server
All Implemented Interfaces:
Ping, java.rmi.Remote

public class Server
extends java.lang.Object
implements Ping

Defines an application server that provides an implementation of the Ping interface. If the server is configured to be exported with a BasicJeriExporter that uses a CancelILFactory, remote calls to the Ping.ping method can be cancelled by invoking the CallCancellation.cancelCall(Thread) method on the server's proxy.

The application uses the following system properties:

config
The argument passed to Configuration.Provider.get to create the configuration used by the application. If not set, the value null will be used.
The application uses the following configuration entries:
server (type Exporter, no default)
The object to use for exporting the server
The application registers its proxy under the name "com.sun.jini.example.cancellation.Ping" in the registry running on the local host.

Author:
Sun Microsystems, Inc.

Constructor Summary
Server()
           
 
Method Summary
static void main(java.lang.String[] args)
          Starts and registers a server that implements the Ping remote interface.
 void ping(ReceiveReady receiver)
          Notifies the given receiver callback object by invoking its ready method and polls for call cancellation status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Server

public Server()
Method Detail

ping

public void ping(ReceiveReady receiver)
          throws java.rmi.RemoteException
Notifies the given receiver callback object by invoking its ready method and polls for call cancellation status. The method will return when the method is either successfully cancelled or is interrupted or if some runtime exception occurs.

Specified by:
ping in interface Ping
Parameters:
receiver - the callback object to notify
Throws:
java.rmi.RemoteException - if a remote communication failure occurs

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Starts and registers a server that implements the Ping remote interface.

Parameters:
args - ignored
Throws:
java.lang.Exception - if something bad happens


Copyright © 2003 Sun Microsystems, Inc. All Rights Reserved.