Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.boot
Class ActivateWrapper

    java.lang.Object
      org.jini.rio.boot.ActivateWrapper

All Implemented Interfaces:
  Serializable, Remote

    public class ActivateWrapper

extends Object
implements Remote, Serializable

A wrapper for activatable objects, providing separation of the import codebase (where the server classes are loaded from by the activation group) from the export codebase (where clients should load classes from for stubs, etc.) as well as providing an independent security policy file for each activatable object. This functionality allows multiple activatable objects to be placed in the same activation group, with each object maintaining a distinct codebase and policy.

This wrapper class is assumed to be available directly in the activation group VM; that is, it is assumed to be in the application classloader, the extension classloader, or the boot classloader, rather than being downloaded. Since this class also needs considerable permissions, the easiest thing to do is to make it an installed extension.

This wrapper class performs a security check to control what policy files can be used with a given codebase. It does this by querying the VM's (global) policy for `SharedActivationPolicyPermission` grants. The service's associated `ActivateDesc.importLocation` is used as the `CodeSource` for selecting the appropriate permission set to check against. If multiple codebases are used, then all the codebases must have the necessary `SharedActivationPolicyPermission` grants.

See Also:
  Serialized Form

Nested Class Summary
`static class` | `ActivateWrapper.ActivateDesc` Descriptor for registering a "wrapped" activatable object.

Constructor Summary
`ActivateWrapper(ActivationID id, MarshalledObject data)` Activatable constructor.

Method Summary
`static ActivationID` | `register(ActivationGroupID gid, ActivateWrapper.ActivateDesc desc, boolean restart, ActivationSystem sys)` Analog to `Activatable.register()` for activatable objects that want to use this wrapper mechanism.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ActivateWrapper

    public ActivateWrapper(ActivationID id,
                           MarshalledObject data)
                    throws Exception

  Activatable constructor. This constructor:
  - Retrieves an `ActivateDesc` from the provided `data` parameter.
  - creates a `ServiceClassLoader` using the import and export codebases obtained from the provided `ActivateDesc`,
  - checks the import codebase(s) for the required `SharedActivationPolicyPermission`
  - associates the newly created `ServiceClassLoader` and the corresponding policy file obtained from the `ActivateDesc` with the `AggregatePolicyProvider`
  - loads the "wrapped" activatable object's class and calls its activation constructor with the context classloader set to the newly created `ServiceClassLoader`.
  - resets the context class loader to the original context classloader
  The first instance of this class will also replace the VM's existing `Policy` object, if any, with a `AggregatePolicyProvider`.

  Parameters:
    `id` - The `ActivationID` of this object
    `data` - The activation data for this object
  Throws:
    `Exception` - of any errors occur
  See Also:
    `ServiceClassLoader`, `AggregatePolicyProvider`, `SharedActivationPolicyPermission`, `Policy`

Method Detail

### register

    public static ActivationID register(ActivationGroupID gid,
                                        ActivateWrapper.ActivateDesc desc,
                                        boolean restart,
                                        ActivationSystem sys)
                                 throws ActivationException,
                                        RemoteException

  Analog to `Activatable.register()` for activatable objects that want to use this wrapper mechanism.

  Returns:
    activation ID of the registered service
  Throws:
    `ActivationException` - if there was a problem registering the activatable class with the activation system
    `RemoteException` - if there was a problem communicating with the activation system

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.