This project has retired. For details please refer to its Attic page.
org.apache.river.start (Apache River v3.0.0 API Documentation)
Skip navigation links

Package org.apache.river.start

Provides the utilities and APIs used to launch the contributed services provided in the Apache River release.

See: Description

Package org.apache.river.start Description

Provides the utilities and APIs used to launch the contributed services provided in the Apache River release.

This document covers the following service starter topics:

Operation Modes

The service starter package supports starting the contributed services in the following modes:
Shared, Activatable
Allows multiple servers to be started in the same activation system group, while still maintaining per-server classpath, codebase, and security policy separation. That is, servers run as independently as possible, while still sharing a single virtual machine for the Java(TM) platform (VM) environment.

Shared activatable services are created via SharedActivatableServiceDescriptor entries in service starter's configuration.

Shared, Non-Activatable
Allows multiple servers to be started in the same VM, while still maintaining per-server classpath, codebase, and security policy separation. That is, servers run as independently as possible, while still sharing a single VM environment.

Shared non-activatable services are created via NonActivatableServiceDescriptor entries in service starter's configuration.

Resource conservation is the main reason for running multiple servers per VM. In particular, the memory footprint of a "shared" VM can be significantly smaller than the combined memory footprints of the same servers running in individual VMs.

Running the Service Starter

The Service Starter uses the following command line structure to start one or more services:
% java java_options
       -jar install_dir/lib/start.jar
       config_options
where java_options includes such things as the security policy file and security manager, install_dir is the directory where the Apache River release is installed, and config_options includes any Configuration provider options.

Note: More information on the java command can be found for: Solaris, Linux, and Windows.

The command line, above, will invoke ServiceStarter.main(), which obtains a ServiceDescriptor[] from its Configuration (via the org.apache.river.start.serviceDescriptors entry) and invokes create() on each array element. The three provided implementations of ServiceDescriptor are:

NonActivatableServiceDescriptor
Used to create a server for in-process execution. That is, the server will run in a shared, non-activatable mode within the invoking VM.

SharedActivationGroupDescriptor
Used to create an activation system group (or VM), which can then be used to host shared, activatable servers. Group identification information is stored in a directory specified by the log argument to SharedActivationGroupDescriptor's constructor. This log directory can then be specified as the sharedGroupLog argument in SharedActivatableServiceDescriptor's constructor in order to associate the server with a particular activation system group.

Note:A SharedActivationGroupDescriptor entry (and it's associated log information) must be created before it can be referenced by subsequent SharedActivatableServiceDescriptor entries.

SharedActivatableServiceDescriptor
Used to create a server for shared, activation execution. That is, the service will be hosted in an activation system group identified by the sharedGroupLog constructor argument.

The Service Starter uses the following command line structure to destroy one or more shared groups:

% java java_options
       -jar install_dir/lib/destroy.jar
       config_options

The command line, above, will invoke DestroySharedGroup.main(), which obtains a ServiceDescriptor[] from its Configuration (via the org.apache.river.start.serviceDestructors entry) and invokes create() on each array element. All the array elements are assumed to be SharedActivatableServiceDescriptors that are configured to run SharedGroup implementations (see provided implementation: SharedGroupImpl). Once created, each element's destroyVM() method will be invoked and its associated group log will be deleted.

Notes: Group destruction:

  1. unregisters the group and any registered server objects with the activation system (so the group and servers aren't restarted)
  2. deletes the associated group log and
  3. exits the associated VM.
It does not individually destroy any of the servers associated with the group being destroyed. Users need to explicity destroy the individual servers prior to destroying the group, if desired. This can be done for the provided services by invoking the DestroyAdmin.destroy() method on the server's Administrable object (obtained by invoking Administrable.getAdmin() on the service proxy).

Examples for Running Contributed Services

This section provides examples of running the contributed services in various configurations.

Assumptions for Running the Examples

The examples below make the following assumptions:

Throughout the examples, items in bold need to be customized for your local environment.

Shared, non-activatable, transient configurations

To run transient versions of the contributed services, which do not store any information persistently or use the activation system to restart itself, using Jini extensible remote invocation (Jini ERI) for remote communication, run the following command:


java -Djava.security.policy=config_dir/jsk-all.policy \
     -jar install_dir/lib/start.jar \
     config_dir/start-transient-jeri-services.config

This configuration uses the following files.

File config_dir/jsk-all.policy

Use this security policy file for starting and running all service configurations. This file grants all permissions to local code included in the lib subdirectory of the Apache River release installation.


grant codebase "file:install_dir/lib/*" {
    permission java.security.AllPermission;
};

File config_dir/start-transient-jeri-services.config

Use this configuration source file to start transient versions of all the provided services using Jini ERI in the VM started by the command line above.


import org.apache.river.start.NonActivatableServiceDescriptor;
import org.apache.river.start.ServiceDescriptor;

org.apache.river.start {

    //
    // HTTPD Service
    //
    private static httpd_codebase = "";
    private static httpd_policy = "config_dir/jsk-all.policy";
    private static httpd_classpath = "install_dir/lib/classserver.jar";
    private static httpd_impl = "org.apache.river.tool.ClassServer";
    private static httpd_service = 
        new NonActivatableServiceDescriptor(
            httpd_codebase, httpd_policy, httpd_classpath, httpd_impl,
            new String[]{"-port", "8080", "-dir", "install_dir/lib-dl", "-verbose"});
           
    //     
    // Fiddler (Lookup Discovery Service)
    //
    private static fiddler_codebase = "http://your_host:http_port/fiddler-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static fiddler_policy = "config_dir/jsk-all.policy";
    private static fiddler_classpath = "install_dir/lib/fiddler.jar";
    private static fiddler_config = "config_dir/transient-fiddler.config";
    private static fiddler_impl = "org.apache.river.fiddler.TransientFiddlerImpl";
    private static fiddler_service = 
        new NonActivatableServiceDescriptor(
            fiddler_codebase, fiddler_policy, fiddler_classpath, 
            fiddler_impl, new String[] { fiddler_config });
            
    //     
    // Mahalo (Transaction Service)
    //
    private static mahalo_codebase = "http://your_host:http_port/mahalo-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static mahalo_policy = "config_dir/jsk-all.policy";
    private static mahalo_classpath = "install_dir/lib/mahalo.jar";
    private static mahalo_config = "config_dir/transient-mahalo.config";
    private static mahalo_impl = "org.apache.river.mahalo.TransientMahaloImpl";
    private static mahalo_service = 
        new NonActivatableServiceDescriptor(
            mahalo_codebase, mahalo_policy, mahalo_classpath, 
            mahalo_impl, new String[] { mahalo_config });
            
    //     
    // Mercury (Event Mailbox Service)
    //
    private static mercury_codebase = "http://your_host:http_port/mercury-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static mercury_policy = "config_dir/jsk-all.policy";
    private static mercury_classpath = "install_dir/lib/mercury.jar";
    private static mercury_config = "config_dir/transient-mercury.config";
    private static mercury_impl = "org.apache.river.mercury.TransientMercuryImpl";
    private static mercury_service = 
        new NonActivatableServiceDescriptor(
            mercury_codebase, mercury_policy, mercury_classpath, 
            mercury_impl, new String[] { mercury_config });

    //     
    // Norm (Lease Renewal Service)
    //
    private static norm_codebase = "http://your_host:http_port/norm-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static norm_policy = "config_dir/jsk-all.policy";
    private static norm_classpath = "install_dir/lib/norm.jar";
    private static norm_config = "config_dir/transient-norm.config";
    private static norm_impl = "org.apache.river.norm.TransientNormServerImpl";
    private static norm_service = 
        new NonActivatableServiceDescriptor(
            norm_codebase, norm_policy, norm_classpath, 
            norm_impl, new String[] { norm_config });

    //     
    // Outrigger (JavaSpaces Service)
    //
    private static outrigger_codebase = "http://your_host:http_port/outrigger-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static outrigger_policy = "config_dir/jsk-all.policy";
    private static outrigger_classpath = "install_dir/lib/outrigger.jar";
    private static outrigger_config = "config_dir/transient-outrigger.config";
    private static outrigger_impl = "org.apache.river.outrigger.TransientOutriggerImpl";
    private static outrigger_service = 
        new NonActivatableServiceDescriptor(
            outrigger_codebase, outrigger_policy, outrigger_classpath, 
            outrigger_impl, new String[] { outrigger_config });

    //     
    // Reggie (Lookup Service)
    //
    private static reggie_codebase = "http://your_host:http_port/reggie-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static reggie_policy = "config_dir/jsk-all.policy";
    private static reggie_classpath = "install_dir/lib/reggie.jar";
    private static reggie_config = "config_dir/transient-reggie.config";
    private static reggie_impl = "org.apache.river.reggie.TransientRegistrarImpl";
    private static reggie_service = 
        new NonActivatableServiceDescriptor(
            reggie_codebase, reggie_policy, reggie_classpath, 
            reggie_impl, new String[] { reggie_config });

    static serviceDescriptors = new ServiceDescriptor[] {
        httpd_service,
        fiddler_service,
        mahalo_service,
        mercury_service,
        norm_service,
        outrigger_service,
        reggie_service
    };
}

File config_dir/transient-fiddler.config

Use this configuration source file to run a transient Fiddler using Jini ERI.


org.apache.river.fiddler {
    initialLookupGroups = new String[] { "your.group" };
}

File config_dir/transient-mahalo.config

Use this configuration source file to run a transient Mahalo using the Jini ERI protocol.


org.apache.river.mahalo {
    initialLookupGroups = new String[] { "your.group" };
}

File config_dir/transient-mercury.config

Use this configuration source file to run a transient Mercury using Jini ERI.


org.apache.river.mercury {
    initialLookupGroups = new String[] { "your.group" };
}

File config_dir/transient-norm.config

Use this configuration source file to run a transient Norm using Jini ERI.


org.apache.river.norm {
    initialLookupGroups = new String[] { "your.group" };
}

File config_dir/transient-outrigger.config

Use this configuration source file to run a transient Outrigger using Jini ERI.


org.apache.river.outrigger {
    initialLookupGroups = new String[] { "your.group" };
}

File config_dir/transient-reggie.config

Use this configuration source file to a run transient Reggie using Jini ERI.


org.apache.river.reggie {
    initialMemberGroups = new String[] { "your.group" };
}

Shared, non-activatable, persistent configurations

To run persistent versions of the contributed services, which do not use the activation system to restart themselves and which use Jini ERI, run the following command:


java -Djava.security.policy=config_dir/jsk-all.policy \
     -jar install_dir/lib/start.jar \
     config_dir/start-persistent-jeri-services.config

This configuration uses the following files:

File config_dir/start-persistent-jeri-services.config

Use this configuration source file to start persistent services using Jini ERI.


import org.apache.river.start.NonActivatableServiceDescriptor;
import org.apache.river.start.ServiceDescriptor;

org.apache.river.start {

    //
    // HTTPD Service
    //
    private static httpd_codebase = "";
    private static httpd_policy = "config_dir/jsk-all.policy";
    private static httpd_classpath = "install_dir/lib/classserver.jar";
    private static httpd_impl = "org.apache.river.tool.ClassServer";
    private static httpd_service = 
        new NonActivatableServiceDescriptor(
            httpd_codebase, httpd_policy, httpd_classpath, httpd_impl, 
            new String[]{"-port", "8080", "-dir", "install_dir/lib-dl", "-verbose"});
           
    //     
    // Fiddler (Lookup Discovery Service)
    //
    private static fiddler_codebase = "http://your_host:http_port/fiddler-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static fiddler_policy = "config_dir/jsk-all.policy";
    private static fiddler_classpath = "install_dir/lib/fiddler.jar";
    private static fiddler_config = "config_dir/persistent-fiddler.config";
    private static fiddler_impl = "org.apache.river.fiddler.NonActivatableFiddlerImpl";
    private static fiddler_service = 
        new NonActivatableServiceDescriptor(
            fiddler_codebase, fiddler_policy, fiddler_classpath, 
            fiddler_impl, new String[] { fiddler_config });
            
    //     
    // Mahalo (Transaction Service)
    //
    private static mahalo_codebase = "http://your_host:http_port/mahalo-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static mahalo_policy = "config_dir/jsk-all.policy";
    private static mahalo_classpath = "install_dir/lib/mahalo.jar";
    private static mahalo_config = "config_dir/persistent-mahalo.config";
    private static mahalo_impl = "org.apache.river.mahalo.NonActivatableMahaloImpl";
    private static mahalo_service = 
        new NonActivatableServiceDescriptor(
            mahalo_codebase, mahalo_policy, mahalo_classpath, 
            mahalo_impl, new String[] { mahalo_config });
            
    //     
    // Mercury (Event Mailbox Service)
    //
    private static mercury_codebase = "http://your_host:http_port/mercury-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static mercury_policy = "config_dir/jsk-all.policy";
    private static mercury_classpath = "install_dir/lib/mercury.jar";
    private static mercury_config = "config_dir/persistent-mercury.config";
    private static mercury_impl = "org.apache.river.mercury.NonActivatableMercuryImpl";
    private static mercury_service = 
        new NonActivatableServiceDescriptor(
            mercury_codebase, mercury_policy, mercury_classpath, 
            mercury_impl, new String[] { mercury_config });

    //     
    // Norm (Lease Renewal Service)
    //
    private static norm_codebase = "http://your_host:http_port/norm-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static norm_policy = "config_dir/jsk-all.policy";
    private static norm_classpath = "install_dir/lib/norm.jar";
    private static norm_config = "config_dir/persistent-norm.config";
    private static norm_impl = "org.apache.river.norm.PersistentNormServerImpl";
    private static norm_service = 
        new NonActivatableServiceDescriptor(
            norm_codebase, norm_policy, norm_classpath, 
            norm_impl, new String[] { norm_config });

    //     
    // Outrigger (JavaSpaces Service)
    //
    private static outrigger_codebase = "http://your_host:http_port/outrigger-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static outrigger_policy = "config_dir/jsk-all.policy";
    private static outrigger_classpath = "install_dir/lib/outrigger.jar";
    private static outrigger_config = "config_dir/persistent-outrigger.config";
    private static outrigger_impl = "org.apache.river.outrigger.PersistentOutriggerImpl";
    private static outrigger_service = 
        new NonActivatableServiceDescriptor(
            outrigger_codebase, outrigger_policy, outrigger_classpath, 
            outrigger_impl, new String[] { outrigger_config });

    //     
    // Reggie (Lookup Service)
    //
    private static reggie_codebase = "http://your_host:http_port/reggie-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static reggie_policy = "config_dir/jsk-all.policy";
    private static reggie_classpath = "install_dir/lib/reggie.jar";
    private static reggie_config = "config_dir/persistent-reggie.config";
    private static reggie_impl = "org.apache.river.reggie.PersistentRegistrarImpl";
    private static reggie_service = 
        new NonActivatableServiceDescriptor(
            reggie_codebase, reggie_policy, reggie_classpath, 
            reggie_impl, new String[] { reggie_config });

    static serviceDescriptors = new ServiceDescriptor[] {
        httpd_service,
        fiddler_service,
        mahalo_service,
        mercury_service,
        norm_service,
        outrigger_service,
        reggie_service
    };
}

File config_dir/persistent-fiddler.config

Use this configuration source file to run a persistent Fiddler using Jini ERI.


import net.jini.id.UuidFactory;
import net.jini.jeri.BasicILFactory;
import net.jini.jeri.BasicJeriExporter;
import net.jini.jeri.tcp.TcpServerEndpoint;

org.apache.river.fiddler {
    initialLookupGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/persistent-fiddler.log";
    serverExporter = 
        new BasicJeriExporter(
            TcpServerEndpoint.getInstance(fiddler_obj_port),
            new BasicILFactory(),
            false, 
            true,
            UuidFactory.create("fiddler_obj_UUID_string"));
}

File config_dir/persistent-mahalo.config

Use this configuration source file to run a persistent Mahalo using Jini ERI.


import net.jini.id.UuidFactory;
import net.jini.jeri.BasicILFactory;
import net.jini.jeri.BasicJeriExporter;
import net.jini.jeri.tcp.TcpServerEndpoint;

org.apache.river.mahalo {
    initialLookupGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/persistent-mahalo.log";
    serverExporter = 
        new BasicJeriExporter(
            TcpServerEndpoint.getInstance(mahalo_obj_port),
            new BasicILFactory(),
            false, 
            true,
            UuidFactory.create("mahalo_obj_UUID_string"));
}

File config_dir/persistent-mercury.config

Use this configuration source file to run a persistent Mercury using Jini ERI.


import net.jini.id.UuidFactory;
import net.jini.jeri.BasicILFactory;
import net.jini.jeri.BasicJeriExporter;
import net.jini.jeri.tcp.TcpServerEndpoint;

org.apache.river.mercury {
    initialLookupGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/persistent-mercury.log";
    serverExporter = 
        new BasicJeriExporter(
            TcpServerEndpoint.getInstance(mercury_obj_port),
            new BasicILFactory(),
            false, 
            true,
            UuidFactory.create("mercury_obj_UUID_string"));
}

File config_dir/persistent-norm.config

Use this configuration source file to run a persistent Norm using Jini ERI.


import net.jini.id.UuidFactory;
import net.jini.jeri.BasicILFactory;
import net.jini.jeri.BasicJeriExporter;
import net.jini.jeri.tcp.TcpServerEndpoint;

org.apache.river.norm {
    initialLookupGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/persistent-norm.log";
    serverExporter = 
        new BasicJeriExporter(
            TcpServerEndpoint.getInstance(norm_obj_port),
            new BasicILFactory(),
            false, 
            true,
            UuidFactory.create("norm_obj_UUID_string"));
}

File config_dir/persistent-outrigger.config

Use this configuration source file to run a persistent Outrigger using Jini ERI.


import net.jini.id.UuidFactory;
import net.jini.jeri.BasicILFactory;
import net.jini.jeri.BasicJeriExporter;
import net.jini.jeri.tcp.TcpServerEndpoint;

org.apache.river.outrigger {
    initialLookupGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/persistent-outrigger.log";
    serverExporter = 
        new BasicJeriExporter(
            TcpServerEndpoint.getInstance(outrigger_obj_port),
            new BasicILFactory(),
            false, 
            true,
            UuidFactory.create("outrigger_obj_UUID_string"));
    store = new org.apache.river.outrigger.snaplogstore.LogStore(this);
}

File config_dir/persistent-reggie.config

Use this configuration source file to run a persistent Reggie using Jini ERI.


import net.jini.id.UuidFactory;
import net.jini.jeri.BasicILFactory;
import net.jini.jeri.BasicJeriExporter;
import net.jini.jeri.tcp.TcpServerEndpoint;

org.apache.river.reggie {
    initialMemberGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/persistent-reggie.log";
    serverExporter = 
        new BasicJeriExporter(
            TcpServerEndpoint.getInstance(reggie_obj_port),
            new BasicILFactory(),
            false, 
            true,
            UuidFactory.create("reggie_obj_UUID_string"));
}

The *obj_port variables are the fixed TCP ports used to listen for server requests. The *obj_UUID_string variables are the universally unique IDs for the exported servers. These IDs have the form: "01234567-01ab-cdef-0123-456789abcdef".

Remember to remove the config_dir/*.log directories before restarting persistent services if you don't want to keep the registrations and settings made by previous service invocations.

Shared, activatable, persistent configurations

To run persistent, activatable versions of the contributed services, which use the activation system to restart themselves, using Jini ERI for remote communication, run the following command:


java -Djava.security.policy=config_dir/jsk-all.policy \
     -jar install_dir/lib/start.jar \
     config_dir/start-activatable-jeri-services.config

This configuration uses the following files:

File config_dir/start-activatable-jeri-services.config

Use this configuration source file to start persistent services using Jini ERI.


import org.apache.river.start.NonActivatableServiceDescriptor;
import org.apache.river.start.ServiceDescriptor;
import org.apache.river.start.SharedActivatableServiceDescriptor;
import org.apache.river.start.SharedActivationGroupDescriptor;

org.apache.river.start {

    //
    // HTTPD Service
    //
    private static httpd_codebase = "";
    private static httpd_policy = "config_dir/jsk-all.policy";
    private static httpd_classpath = "install_dir/lib/classserver.jar";
    private static httpd_impl = "org.apache.river.tool.ClassServer";
    private static httpd_service = 
        new NonActivatableServiceDescriptor(
            httpd_codebase, httpd_policy, httpd_classpath,
            httpd_impl,
            new String[]{"-port", "8080", "-dir", "install_dir/lib-dl", "-verbose"});
           
    //
    // Shared Group Environment
    //
    private static sharedVM_policy = "config_dir/jsk-all.policy";
    private static sharedVM_classpath  = "install_dir/lib/sharedvm.jar";
    private static sharedVM_log = "config_dir/sharedvm.log";
    private static sharedVM_command = null;
    private static sharedVM_options = null;
    private static sharedVM_properties = null;
    private static sharedVM =
        new SharedActivationGroupDescriptor(
            sharedVM_policy,
            sharedVM_classpath,
            sharedVM_log,
            sharedVM_command,
            sharedVM_options,
            sharedVM_properties);
            
    //     
    // Fiddler (Lookup Discovery Service)
    //
    private static fiddler_codebase = "http://your_host:http_port/fiddler-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static fiddler_policy = "config_dir/jsk-all.policy";
    private static fiddler_classpath = "install_dir/lib/fiddler.jar";
    private static fiddler_config = "config_dir/activatable-fiddler.config";
    private static fiddler_impl = "org.apache.river.fiddler.ActivatableFiddlerImpl";
    private static fiddler_service = 
        new SharedActivatableServiceDescriptor(
            fiddler_codebase, fiddler_policy, fiddler_classpath, 
            fiddler_impl, sharedVM_log, new String[] { fiddler_config },
            true);
            
    //     
    // Mahalo (Transaction Service)
    //
    private static mahalo_codebase = "http://your_host:http_port/mahalo-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static mahalo_policy = "config_dir/jsk-all.policy";
    private static mahalo_classpath = "install_dir/lib/mahalo.jar";
    private static mahalo_config = "config_dir/activatable-mahalo.config";
    private static mahalo_impl = "org.apache.river.mahalo.ActivatableMahaloImpl";
    private static mahalo_service = 
        new SharedActivatableServiceDescriptor(
            mahalo_codebase, mahalo_policy, mahalo_classpath, 
            mahalo_impl, sharedVM_log, new String[] { mahalo_config },
            true);
            
    //     
    // Mercury (Event Mailbox Service)
    //
    private static mercury_codebase = "http://your_host:http_port/mercury-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static mercury_policy = "config_dir/jsk-all.policy";
    private static mercury_classpath = "install_dir/lib/mercury.jar";
    private static mercury_config = "config_dir/activatable-mercury.config";
    private static mercury_impl = "org.apache.river.mercury.ActivatableMercuryImpl";
    private static mercury_service = 
        new SharedActivatableServiceDescriptor(
            mercury_codebase, mercury_policy, mercury_classpath, 
            mercury_impl, sharedVM_log, new String[] { mercury_config },
            true);

    //     
    // Norm (Lease Renewal Service)
    //
    private static norm_codebase = "http://your_host:http_port/norm-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static norm_policy = "config_dir/jsk-all.policy";
    private static norm_classpath = "install_dir/lib/norm.jar";
    private static norm_config = "config_dir/activatable-norm.config";
    private static norm_impl = "org.apache.river.norm.ActivatableNormServerImpl";
    private static norm_service = 
        new SharedActivatableServiceDescriptor(
            norm_codebase, norm_policy, norm_classpath, 
            norm_impl, sharedVM_log, new String[] { norm_config },
            true);

    //     
    // Outrigger (JavaSpaces Service)
    //
    private static outrigger_codebase = "http://your_host:http_port/outrigger-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static outrigger_policy = "config_dir/jsk-all.policy";
    private static outrigger_classpath = "install_dir/lib/outrigger.jar";
    private static outrigger_config = "config_dir/activatable-outrigger.config";
    private static outrigger_impl = "org.apache.river.outrigger.PersistentOutriggerImpl";
    private static outrigger_service = 
        new SharedActivatableServiceDescriptor(
            outrigger_codebase, outrigger_policy, outrigger_classpath, 
            outrigger_impl, sharedVM_log, new String[] { outrigger_config },
            true);

    //     
    // Reggie (Lookup Service)
    //
    private static reggie_codebase = "http://your_host:http_port/reggie-dl.jar"
        + " http://your_host:http_port/jsk-dl.jar";
    private static reggie_policy = "config_dir/jsk-all.policy";
    private static reggie_classpath = "install_dir/lib/reggie.jar";
    private static reggie_config = "config_dir/activatable-reggie.config";
    private static reggie_impl = "org.apache.river.reggie.PersistentRegistrarImpl";
    private static reggie_service = 
        new SharedActivatableServiceDescriptor(
            reggie_codebase, reggie_policy, reggie_classpath, 
            reggie_impl, sharedVM_log, new String[] { reggie_config },
            true);

    //
    // Services to start -- used by ServiceStarter.main()
    //
    static serviceDescriptors = new ServiceDescriptor[] {
        httpd_service,
        sharedVM,
        fiddler_service,
        mahalo_service,
        mercury_service,
        norm_service,
        outrigger_service,
        reggie_service
    };
    
    
    //
    // Shared Group 
    //
    private static shared_group_codebase = "http://your_host:http_port/group-dl.jar";
    private static shared_group_policy = "config_dir/jsk-all.policy";
    private static shared_group_classpath = "install_dir/lib/group.jar";
    private static shared_group_config = "config_dir/activatable-group.config";
    private static shared_group_impl = "org.apache.river.start.SharedGroupImpl";
    private static shared_group_service =
        new SharedActivatableServiceDescriptor(
            shared_group_codebase,
            shared_group_policy,
            shared_group_classpath,
            shared_group_impl,
            sharedVM_log, // Same as above
            new String[] { shared_group_config },
            false);
    
    //
    // Groups to destroy -- used by DestroySharedGroup.main()
    //              
    static serviceDestructors =
        new ServiceDescriptor[] { shared_group_service };
}

File config_dir/activatable-fiddler.config

Use this configuration source file to run an activatable Fiddler using Jini ERI.



org.apache.river.fiddler {

  initialLookupGroups = new String[] { "your.group" };
  persistenceDirectory = "config_dir/activatable-fiddler.log";

}

File config_dir/activatable-mahalo.config

Use this configuration source file to run an activatable Mahalo using Jini ERI.



org.apache.river.mahalo {
    initialLookupGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/activatable-mahalo.log";
}

File config_dir/activatable-mercury.config

Use this configuration source file to run an activatable Mercury using Jini ERI.


org.apache.river.mercury {
    initialLookupGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/activatable-mercury.log";
}

File config_dir/activatable-norm.config

Use this configuration source file to run an activatable Norm using Jini ERI.


org.apache.river.norm {
    initialLookupGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/activatable-norm.log";
}

File config_dir/activatable-outrigger.config

Use this configuration source file to run an activatable Outrigger using Jini ERI.


org.apache.river.outrigger {
    initialLookupGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/activatable-outrigger.log";
    store = new org.apache.river.outrigger.snaplogstore.LogStore(this);    
}

File config_dir/activatable-reggie.config

Use this configuration source file to run an activatable Reggie using Jini ERI.


org.apache.river.reggie {
    initialMemberGroups = new String[] { "your.group" };
    persistenceDirectory = "config_dir/activatable-reggie.log";
}

File config_dir/activatable-group.config

Use this configuration source file to run an activatable shared group using Jini ERI.


org.apache.river.start {
    // Use defaults
}

Remember to remove the config_dir/*.log directories before recreating activatable services if you want it to forget registrations and settings made by previous service invocations.

Stopping activatable configurations

To stop the shared group hosting the contributed services created in the previous section, run the following command:


java -Djava.security.policy=config_dir/jsk-all.policy \
     -jar install_dir/lib/destroy.jar \
     config_dir/start-activatable-jeri-services.config

Note: The command, above, references config_dir/start-activatable-jeri-services.config, which was the configuration file used to start the services. This was done for the convenience of referencing the same sharedVM_log value for both group creation and destruction. The command line, above, could also have used a separate, independent configuration file.

Activation System

There are two activation daemon implementations available: rmid and Phoenix. rmid is part of the Java 2 SDK:

Phoenix is part of the Apache River release. Phoenix has better support for Jini ERI, is configurable, and supports net.jini.security, making it suitable for a much broader range of deployments than rmid.

Skip navigation links

Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.