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

## com.sun.jini.start
Class NonActivatableServiceDescriptor

    java.lang.Object
      com.sun.jini.start.NonActivatableServiceDescriptor

All Implemented Interfaces:
  ServiceDescriptor

Direct Known Subclasses:
  SharedActivatableServiceDescriptor

public class NonActivatableServiceDescriptor
extends Object
implements ServiceDescriptor

Class used to launch shared, non-activatable, in-process services. Clients construct this object with the details of the service to be launched, then call `create` to launch the service in invoking object's VM.

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

Services need to implement the following "non-activatable constructor":

>     <impl>(String[] args, LifeCycle lc)

where,

- args - are the service configuration arguments
- lc - is the hosting environment's `LifeCycle` reference.

Since:
  2.0

Nested Class Summary
`static class` | `NonActivatableServiceDescriptor.Created` Object returned by `NonActivatableServiceDescriptor.create()` method that returns the proxy and implementation references for the created service.

Constructor Summary
`NonActivatableServiceDescriptor(String codebase, String policy, String classpath, String implClassName, String[] serverConfigArgs)` Trivial constructor.
`NonActivatableServiceDescriptor(String codebase, String policy, String classpath, String implClassName, String[] serverConfigArgs, LifeCycle lifeCycle)` Trivial constructor.

Method Summary
`Object` | `create(Configuration config)` Method that attempts to create a service based on the service description information provided via constructor parameters.
`String` | `getClasspath()` Classpath accessor method.
`String` | `getCodebase()` Codebase accessor method.
`String` | `getImplClassName()` Implementation class accessor method.
`LifeCycle` | `getLifeCycle()` `LifeCycle` accessor method.
`String` | `getPolicy()` Policy accessor method.
`String[]` | `getServerConfigArgs()` Service configuration arguments accessor method.
`String` | `toString()`

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

Constructor Detail

### NonActivatableServiceDescriptor

    public NonActivatableServiceDescriptor(String codebase,
                                           String policy,
                                           String classpath,
                                           String implClassName,
                                           String[] serverConfigArgs,
                                           LifeCycle lifeCycle)

  Trivial constructor. Simply assigns given parameters to their associated, internal fields.

Parameters:
  `codebase` - location where clients can download required service-related classes (for example, stubs, proxies, etc.). Codebase components must be separated by spaces in which each component is in `URL` format.
  `policy` - server policy filename or URL
  `classpath` - location where server implementation classes can be found. Classpath components must be separated by path separators.
  `implClassName` - name of server implementation class
  `serverConfigArgs` - service configuration arguments
  `lifeCycle` - `LifeCycle` reference for hosting environment

### NonActivatableServiceDescriptor

    public NonActivatableServiceDescriptor(String codebase,
                                           String policy,
                                           String classpath,
                                           String implClassName,
                                           String[] serverConfigArgs)

  Trivial constructor. Equivalent to calling the other overloaded contructor with `null` for the `LifeCycle` reference.

Method Detail

### getCodebase

    public final String getCodebase()

  Codebase accessor method.

  Returns:
    the codebase string associated with this service descriptor.

### getPolicy

    public final String getPolicy()

  Policy accessor method.

  Returns:
    the policy string associated with this service descriptor.

### getClasspath

    public final String getClasspath()

  Classpath accessor method.

  Returns:
    the classpath string associated with this service descriptor.

### getImplClassName

    public final String getImplClassName()

  Implementation class accessor method.

  Returns:
    the implementation class string associated with this service descriptor.

### getServerConfigArgs

    public final String[] getServerConfigArgs()

  Service configuration arguments accessor method.

  Returns:
    the service configuration arguments associated with this service descriptor.

### getLifeCycle

    public final LifeCycle getLifeCycle()

  `LifeCycle` accessor method.

  Returns:
    the `LifeCycle` object associated with this service descriptor.

### create

    public Object create(Configuration config)
                  throws Exception

  Method that attempts to create a service based on the service description information provided via constructor parameters.

  This method:

  - creates an `ActivateWrapper.ExportClassLoader` with the provided import and export codebases
  - associates the newly created `ExportClassLoader` and the corresponding service policy file with the `AggregatePolicyProvider`
  - sets the newly created `ExportClassLoader` as the context class loader
  - loads the service object's class and calls a constructor with the following signature:

    >     <impl>(String[], LifeCycle)

  - The service proxy is obtained by calling `ServiceProxyAccessor.getServiceProxy()` or `ProxyAccessor.getProxy()`, respectively, on the implementation instance. If neither interface is supported, the proxy reference is set to `null`
  - resets the context class loader to the original context classloader
  The first invocation of this method will also replace the VM's existing `Policy` object, if any, with an `AggregatePolicyProvider`.

  Specified by:
    `create` in interface `ServiceDescriptor`
  Parameters:
    `config` - The `Configuration` object used to configure the creation of the returned object.
  Returns:
    a `Created` instance with the service's proxy and implementation references.
  Throws:
    `Exception` - Thrown if there was any problem creating the object.

### toString

    public String toString()

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

Copyright © 2004 Sun Microsystems, Inc. All rights reserved