com.sun.jini.example.cancellation
Class CancelILFactory

java.lang.Object
  extended bynet.jini.jeri.AbstractILFactory
      extended bycom.sun.jini.example.cancellation.CancelILFactory
All Implemented Interfaces:
net.jini.jeri.InvocationLayerFactory

public class CancelILFactory
extends net.jini.jeri.AbstractILFactory

A factory for creating proxies and invocation dispatchers that support call cancellation.

Since:
davis
Author:
Sun Microsystems, Inc.
See Also:
CallCancellation

Nested Class Summary
 
Nested classes inherited from class net.jini.jeri.InvocationLayerFactory
net.jini.jeri.InvocationLayerFactory.Instances
 
Constructor Summary
CancelILFactory(java.lang.ClassLoader loader)
          Constructs a new factory with the specified class loader.
 
Method Summary
protected  net.jini.jeri.InvocationDispatcher createInvocationDispatcher(java.util.Collection methods, java.rmi.Remote impl, net.jini.jeri.ServerCapabilities caps)
          Returns an invocation dispatcher that supports call cancellation.
protected  java.lang.reflect.InvocationHandler createInvocationHandler(java.lang.Class[] interfaces, java.rmi.Remote impl, net.jini.jeri.ObjectEndpoint oe)
          Returns an invocation handler that supports call cancellation.
static boolean getCancellationStatus()
          Returns the cancellation status for the current thread: true if the call associated with the current thread should be cancelled and false otherwise.
protected  java.lang.Class[] getExtraProxyInterfaces(java.rmi.Remote impl)
          Returns an array containing the two interfaces needed to support call cancellation , CallCancellation and CancelMessage.
protected  java.util.Collection getInvocationDispatcherMethods(java.rmi.Remote impl)
          Returns a new collection of Method objects, containing all remote methods for which the the invocation dispatcher should accept incoming remote calls.
 
Methods inherited from class net.jini.jeri.AbstractILFactory
createInstances, equals, getClassLoader, getProxyInterfaces, getRemoteInterfaces, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CancelILFactory

public CancelILFactory(java.lang.ClassLoader loader)
Constructs a new factory with the specified class loader.

Method Detail

createInvocationHandler

protected java.lang.reflect.InvocationHandler createInvocationHandler(java.lang.Class[] interfaces,
                                                                      java.rmi.Remote impl,
                                                                      net.jini.jeri.ObjectEndpoint oe)
                                                               throws java.rmi.server.ExportException
Returns an invocation handler that supports call cancellation.

Parameters:
interfaces - a non-null array of proxy interfaces
impl - a non-null remote object this invocation handler is being created to handle
oe - an non-null object endpoint used to communicate with the remote object
Returns:
the invocation handler for the remote object's proxy
Throws:
java.rmi.server.ExportException - if there is a problem creating the invocation handler

createInvocationDispatcher

protected net.jini.jeri.InvocationDispatcher createInvocationDispatcher(java.util.Collection methods,
                                                                        java.rmi.Remote impl,
                                                                        net.jini.jeri.ServerCapabilities caps)
                                                                 throws java.rmi.server.ExportException
Returns an invocation dispatcher that supports call cancellation.

Throws:
java.lang.NullPointerException
java.rmi.server.ExportException

getExtraProxyInterfaces

protected java.lang.Class[] getExtraProxyInterfaces(java.rmi.Remote impl)
                                             throws java.rmi.server.ExportException
Returns an array containing the two interfaces needed to support call cancellation , CallCancellation and CancelMessage.

Throws:
java.lang.NullPointerException
java.rmi.server.ExportException

getInvocationDispatcherMethods

protected java.util.Collection getInvocationDispatcherMethods(java.rmi.Remote impl)
                                                       throws java.rmi.server.ExportException
Returns a new collection of Method objects, containing all remote methods for which the the invocation dispatcher should accept incoming remote calls. This implementation returns a collection containing all of the methods obtained by invoking the getInvocationDispatcherMethods method on super passing impl as well as the the additional cancelRequest method.

Throws:
java.lang.NullPointerException
java.lang.SecurityException
java.rmi.server.ExportException

getCancellationStatus

public static boolean getCancellationStatus()
                                     throws NoSuchCallException
Returns the cancellation status for the current thread: true if the call associated with the current thread should be cancelled and false otherwise.

Returns:
the cancellation status
Throws:
NoSuchCallException - if there is no cancellable call associated with the current thread


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