com.sun.jini.phoenix
Class SystemAccessILFactory.SystemDispatcher

java.lang.Object
  extended by net.jini.jeri.BasicInvocationDispatcher
      extended by com.sun.jini.phoenix.SystemAccessILFactory.SystemDispatcher
All Implemented Interfaces:
InvocationDispatcher
Enclosing class:
SystemAccessILFactory

public static class SystemAccessILFactory.SystemDispatcher
extends BasicInvocationDispatcher

A subclass of BasicInvocationDispatcher for ActivationSystem instances that optionally enforces a GroupPolicy on calls to registerGroup and setActivationGroupDesc.


Constructor Summary
SystemAccessILFactory.SystemDispatcher(Collection methods, Remote impl, ServerCapabilities serverCaps, MethodConstraints serverConstraints, Class permClass, GroupPolicy policy, boolean localAccessCheck, ClassLoader loader)
          Creates an invocation dispatcher to receive incoming remote calls for the specified methods, for a server and transport with the specified capabilities, enforcing the specified constraints, and performing preinvocation access control using the specified permission class and group policy.
 
Method Summary
protected  void checkAccess(Remote impl, Method method, InvocationConstraints constraints, Collection context)
          Checks that the client is calling from the local host.
protected  Object invoke(Remote impl, Method method, Object[] args, Collection context)
          Checks the group policy as necessary, and then calls the superclass invoke method with the same arguments, and returns the result.
 
Methods inherited from class net.jini.jeri.BasicInvocationDispatcher
checkClientPermission, checkPermissionClass, createMarshalInputStream, createMarshalOutputStream, dispatch, getClassLoader, marshalReturn, marshalThrow, unmarshalArguments, unmarshalMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemAccessILFactory.SystemDispatcher

public SystemAccessILFactory.SystemDispatcher(Collection methods,
                                              Remote impl,
                                              ServerCapabilities serverCaps,
                                              MethodConstraints serverConstraints,
                                              Class permClass,
                                              GroupPolicy policy,
                                              boolean localAccessCheck,
                                              ClassLoader loader)
                                       throws ExportException
Creates an invocation dispatcher to receive incoming remote calls for the specified methods, for a server and transport with the specified capabilities, enforcing the specified constraints, and performing preinvocation access control using the specified permission class and group policy. The specified class loader is used by the createMarshalInputStream method.

For each combination of constraints that might need to be enforced (obtained by calling the possibleConstraints method on the specified server constraints, or using an empty constraints instance of the specified server constraints instance is null), calling the checkConstraints method of the specified capabilities object with those constraints must return true, or an ExportException is thrown.

Parameters:
methods - a collection of Method instances for the remote methods
impl - the remote object
serverCaps - the transport capabilities of the server
serverConstraints - the server constraints, or null
permClass - the permission class, or null
policy - the group policy, or null
localAccessCheck - if true, calls are only accepted from the local host
loader - the class loader, or null
Throws:
IllegalArgumentException - if impl is not an instance of ActivationSystem or if the permission class is abstract, is not a subclass of Permission, or does not have a public constructor that has either one String parameter or one Method parameter and has no declared exceptions, or if any element of methods is not a Method instance
NullPointerException - if impl, methods or serverCaps is null, or if methods contains a null element
ExportException - if any of the possible server constraints cannot be satisfied according to the specified server capabilities
Method Detail

checkAccess

protected void checkAccess(Remote impl,
                           Method method,
                           InvocationConstraints constraints,
                           Collection context)
Checks that the client is calling from the local host.

Overrides:
checkAccess in class BasicInvocationDispatcher
Parameters:
impl - the remote object
method - the remote method
constraints - the enforced constraints for the specified method, or null
context - the server context
Throws:
AccessControlException - if the client is not calling from the local host

invoke

protected Object invoke(Remote impl,
                        Method method,
                        Object[] args,
                        Collection context)
                 throws Throwable
Checks the group policy as necessary, and then calls the superclass invoke method with the same arguments, and returns the result. If the policy is not null and the specified method is ActivationSystem.registerGroup or ActivationSystem.setActivationGroupDesc, the policy is checked by calling its checkGroup method with the ActivationGroupDesc argument.

Overrides:
invoke in class BasicInvocationDispatcher
Parameters:
impl - the remote object
method - the Method instance corresponding to the interface method invoked on the remote object
args - the method arguments
context - the server context passed to the dispatch method for the remote call being processed
Returns:
the result of the method invocation on impl
Throws:
SecurityException - if the caller is not permitted to use the specified group descriptor
NullPointerException - if any argument is null
Throwable - the exception thrown from the method invocation on impl


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