Rio Project 4.2 API Documentation



org.rioproject.boot
Class RioActivatableServiceDescriptor

java.lang.Object
  extended by org.rioproject.boot.RioServiceDescriptor
      extended by org.rioproject.boot.RioActivatableServiceDescriptor
All Implemented Interfaces:
ServiceDescriptor

public class RioActivatableServiceDescriptor
extends RioServiceDescriptor

Class used to launch shared, activatable services. Clients construct this object with the details of the service to be launched, then call create to launch the service in the activation system group identified by the sharedGroupLog constructor parameter.

This class depends on ActivateWrapper to provide 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 activation system group, with each object maintaining a distinct codebase and policy.

Services need to implement the constructor required by ActivateWrapper. The following items are discussed below:

Configuring RioActivatableServiceDescriptor

This implementation of RioActivatableServiceDescriptor supports the following configuration entries, with component org.rioproject.boot:
activationIdPreparer
  Type: ProxyPreparer
  Default: new BasicProxyPreparer()
  Description: The proxy preparer for the service's activation ID. The value should not be null. This class calls the ActivationID.activate(boolean) method on instances of ActivationID when they need to re/activate the service.
activationSystemPreparer
  Type: ProxyPreparer
  Default: new BasicProxyPreparer()
  Description: The proxy preparer for the proxy for the activation system. The value should not be null. The service starter calls the unregisterObject method on the java.rmi.activation.ActivationSystem when there is a problem creating a service.

Loggers and Logging Levels

The implementation uses the java.util.logging.Logger, named org.rioproject.boot. The following table describes the type of information logged as well as the levels of information logged.

org.rioproject.boot
Level Description
FINER for high level service operation tracing
FINEST for low level service operation tracing

Author:
Dennis Reedy

Nested Class Summary
static class RioActivatableServiceDescriptor.Created
          Object returned by RioActivatableServiceDescriptor.create() method that returns the proxy, group identifier, and activation identifier for the created service.
 
Constructor Summary
RioActivatableServiceDescriptor(String codebase, String policy, String classpath, String implClassName, String sharedGroupLog, String[] serverConfigArgs, boolean restart)
          Create a RioActivatableServiceDescriptor, calling the other overloaded constructor with the host and port parameters set to null and 0, respectively.
RioActivatableServiceDescriptor(String codebase, String policy, String classpath, String implClassName, String sharedGroupLog, String[] serverConfigArgs, boolean restart, String host, int port)
          Create a RioActivatableServiceDescriptor, assigning given parameters to their associated, internal fields.
 
Method Summary
 Object create(Configuration config)
          Method that attempts to create a service based on the service description information provided via constructor parameters.
 String getActivationSystemHost()
          Activation system host accessor method.
 int getActivationSystemPort()
          Activation system port accessor method.
 boolean getRestart()
          Restart accessor method.
 String getSharedGroupLog()
          Shared group log accessor method.
 String toString()
           
 
Methods inherited from class org.rioproject.boot.RioServiceDescriptor
getClasspath, getCodebase, getImplClassName, getLifeCycle, getPolicy, getServerConfigArgs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RioActivatableServiceDescriptor

public RioActivatableServiceDescriptor(String codebase,
                                       String policy,
                                       String classpath,
                                       String implClassName,
                                       String sharedGroupLog,
                                       String[] serverConfigArgs,
                                       boolean restart)
Create a RioActivatableServiceDescriptor, calling the other overloaded constructor with the host and port parameters set to null and 0, respectively.

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
sharedGroupLog - The name of the log
serverConfigArgs - service configuration arguments
restart - boolean flag passed through as the restart parameter to the ActivationDesc constructor used to register the service with the activation system.

RioActivatableServiceDescriptor

public RioActivatableServiceDescriptor(String codebase,
                                       String policy,
                                       String classpath,
                                       String implClassName,
                                       String sharedGroupLog,
                                       String[] serverConfigArgs,
                                       boolean restart,
                                       String host,
                                       int port)
Create a RioActivatableServiceDescriptor, 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
sharedGroupLog - The name of the log
serverConfigArgs - service configuration arguments
restart - boolean flag passed through as the restart parameter to the ActivationDesc constructor used to register the service with the activation system.
host - hostname of desired activation system. If null, defaults to the localhost.
port - port of desired activation system. If value is <= 0, then defaults to ActivationSystem.SYSTEM_PORT.
Method Detail

getSharedGroupLog

public final String getSharedGroupLog()
Shared group log accessor method.

Returns:
The Shared group log associated with this service descriptor.

getRestart

public final boolean getRestart()
Restart accessor method.

Returns:
The restart mode associated with this service descriptor.

getActivationSystemHost

public final String getActivationSystemHost()
Activation system host accessor method.

Returns:
The activation system host associated with this service descriptor.

getActivationSystemPort

public final int getActivationSystemPort()
Activation system port accessor method.

Returns:
The activation system port 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:

Specified by:
create in interface ServiceDescriptor
Overrides:
create in class RioServiceDescriptor
Returns:
A org.rioproject.boot.RioActivatableServiceDescriptor.Created object that contains the group identifier, activation ID, and proxy associated with the newly created service instance.
Throws:
Exception
See Also:
ServiceDescriptor.create(net.jini.config.Configuration)

toString

public String toString()
Overrides:
toString in class RioServiceDescriptor

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.