public static class SystemAccessILFactory.SystemDispatcher extends BasicInvocationDispatcher
BasicInvocationDispatcher
for
ActivationSystem
instances that optionally enforces a
GroupPolicy
on calls to registerGroup
and
setActivationGroupDesc
.Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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. |
checkClientPermission, checkPermissionClass, createMarshalInputStream, createMarshalOutputStream, dispatch, getClassLoader, marshalReturn, marshalThrow, unmarshalArguments, unmarshalMethod
public SystemDispatcher(Collection methods, Remote impl, ServerCapabilities serverCaps, MethodConstraints serverConstraints, Class permClass, GroupPolicy policy, boolean localAccessCheck, ClassLoader loader) throws ExportException
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.
methods
- a collection of Method
instances for the
remote methodsimpl
- the remote objectserverCaps
- the transport capabilities of the serverserverConstraints
- 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 hostloader
- the class loader, or null
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
instanceNullPointerException
- if impl
,
methods
or serverCaps
is
null
, or if methods
contains a
null
elementExportException
- if any of the possible server constraints
cannot be satisfied according to the specified server capabilitiesprotected void checkAccess(Remote impl, Method method, InvocationConstraints constraints, Collection context)
checkAccess
in class BasicInvocationDispatcher
impl
- the remote objectmethod
- the remote methodconstraints
- the enforced constraints for the specified
method, or null
context
- the server contextAccessControlException
- if the client is not
calling from the local hostprotected Object invoke(Remote impl, Method method, Object[] args, Collection context) throws Throwable
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.invoke
in class BasicInvocationDispatcher
impl
- the remote objectmethod
- the Method
instance corresponding
to the interface method invoked on the remote objectargs
- the method argumentscontext
- the server context passed to the dispatch
method for the remote call being processedimpl
SecurityException
- if the caller is not permitted to use
the specified group descriptorNullPointerException
- if any argument is null
Throwable
- the exception thrown from the method invocation
on impl
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.