public class RioServiceDescriptor extends Object implements ServiceDescriptor
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 and Description |
---|
RioServiceDescriptor(String name,
String codebase,
String policy,
String classpath,
String implClassName,
String[] serverConfigArgs)
Create a RioServiceDescriptor.
|
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.
|
Modifier and Type | Method and Description |
---|---|
Object |
create(Configuration config)
Creates an object described by the actual
ServiceDescriptor instance. |
String |
getClasspath()
LifCycle accessor method.
|
String |
getCodebase()
Codebase accessor method.
|
static AggregatePolicyProvider |
getGlobalPolicy() |
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() |
public RioServiceDescriptor(String name, String codebase, String policy, String classpath, String implClassName, String[] serverConfigArgs, LifeCycle lifeCycle)
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 URLclasspath
- location where server implementation classes can be found. Classpath
components must be separated by path separators.implClassName
- name of server implementation classserverConfigArgs
- service configuration argumentslifeCycle
- LifeCycle
reference for hosting environmentpublic static AggregatePolicyProvider getGlobalPolicy()
public String getCodebase()
public String getPolicy()
public LifeCycle getLifeCycle()
LifeCycle
accessor method.LifeCycle
object associated with this service descriptor.public String getClasspath()
public String getImplClassName()
public String[] getServerConfigArgs()
public Object create(Configuration config) throws Exception
ServiceDescriptor
ServiceDescriptor
instance.create
in interface ServiceDescriptor
config
- The Configuration
object used to configure the creation of the
returned object.Exception
- Thrown if there was any problem creating the object.ServiceDescriptor.create(net.jini.config.Configuration)
Copyright © GigaSpaces.