Class RioServiceDescriptor

java.lang.Object
org.jini.rio.boot.RioServiceDescriptor
All Implemented Interfaces:
ServiceDescriptor

public class RioServiceDescriptor extends Object implements ServiceDescriptor
The RioServiceDescriptor class is a utility that conforms to the Jini technology ServiceStarter framework, and will start a service using the CommonClassLoader as a shared, non-activatable, in-process service. 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.
  • Constructor Details

    • RioServiceDescriptor

      public RioServiceDescriptor(String name, String codebase, String policy, String classpath, String implClassName, String[] serverConfigArgs, LifeCycle lifeCycle)
      Create a RioServiceDescriptor, assigning 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
    • RioServiceDescriptor

      public RioServiceDescriptor(String name, String codebase, String classpath, String implClassName, String[] serverConfigArgs)
      Create a RioServiceDescriptor. Equivalent to calling the other overloaded constructor with null for the LifeCycle reference.
  • Method Details

    • getGlobalPolicy

      public static AggregatePolicyProvider getGlobalPolicy()
    • getCodebase

      public String getCodebase()
      Codebase accessor method.
      Returns:
      The codebase string associated with this service descriptor.
    • getPolicy

      public String getPolicy()
      Policy accessor method.
      Returns:
      The policy string associated with this service descriptor.
    • getLifeCycle

      public LifeCycle getLifeCycle()
      LifeCycle accessor method.
      Returns:
      The LifeCycle object associated with this service descriptor.
    • getClasspath

      public String getClasspath()
      LifCycle accessor method.
      Returns:
      The classpath string associated with this service descriptor.
    • getImplClassName

      public String getImplClassName()
      Implementation class accessor method.
      Returns:
      The implementation class string associated with this service descriptor.
    • getServerConfigArgs

      public String[] getServerConfigArgs()
      Service configuration arguments accessor method.
      Returns:
      The service configuration arguments associated with this service descriptor.
    • create

      public Object create(Configuration config) throws Exception
      Description copied from interface: ServiceDescriptor
      Creates an object described by the actual ServiceDescriptor instance.
      Specified by:
      create in interface ServiceDescriptor
      Parameters:
      config - The Configuration object used to configure the creation of the returned object.
      Returns:
      An object instance appropriate for the given service descriptor instance.
      Throws:
      Exception - Thrown if there was any problem creating the object.
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object