Interface | Description |
---|---|
Registrar |
Registrar defines the private protocol between the various client-side proxies and the registrar
server.
|
Class | Description |
---|---|
ClassMapper |
Maps Class to ServiceType/Base, Class to EntryClass/Base, and Class to Field[], with caching for
efficiency.
|
ConstrainableEventLease |
EventLease subclass that supports constraints.
|
EntryClass |
An EntryClass is a descriptor for an entry class, packaged up for transmission between
client-side proxies and the registrar server.
|
EntryClassBase |
An EntryClass annotated with a codebase.
|
EntryRep |
An EntryRep contains the fields of an Entry packaged up for transmission between client-side
proxies and the registrar server.
|
EventLease |
When a registrar (lookup service) grants a lease on an event registration on behalf of some
object (client), a proxy is employed to allow the client to interact with the lease; this class
is the implementation of that proxy.
|
GigaRegistrar |
Base server-side implementation of a lookup service, subclassed by TransientRegistrarImpl and
PersistentRegistrarImpl.
|
Item |
An Item contains the fields of a ServiceItem packaged up for transmission between client-side
proxies and the registrar server.
|
Matches |
A Matches contains the fields of a ServiceMatches packaged up for transmission between
client-side proxies and the registrar server.
|
RegistrarEvent |
Concrete implementation class for abstract ServiceEvent.
|
RegistrarPermission |
An instance contains a name (also referred to as a "target name") but no actions list; you either
have the named permission or you don't.
|
RenewResults | |
ServiceTypeBase |
A ServiceType annotated with a codebase.
|
Template |
A Template contains the fields of a ServiceTemplate packaged up for transmission between
client-side proxies and the registrar server.
|
UuidGenerator |
Class for generating
Uuid instances. |
ServiceRegistrar
.
Two implementations are available for use with the com.sun.jini.start
package:
com.sun.jini.reggie.PersistentRegistrarImpl
- a persistent
implementation which can be run either as activatable or non-activatable,
suitable for use with
SharedActivatableServiceDescriptor
or
NonActivatableServiceDescriptor
com.sun.jini.reggie.TransientRegistrarImpl
- a
non-activatable transient implementation, suitable for use with
NonActivatableServiceDescriptor
The name "Reggie" loosely refers to either implementation. The JAR file
reggie.jar
, included in the lib
subdirectory of the
Jini(TM) Technology Starter Kit (starter kit) installation, contains the
classes for both Reggie service implementations. The reggie-dl.jar
and jsk-dl.jar
files in the lib-dl
subdirectory
contain the classes needed in the codebase for its downloaded proxies.
None of the JAR files include classes from jsk-platform.jar
,
which are included by the service starter's start.jar
JAR file,
and need to be included in the codebase of clients.
The main proxy of an instance of either of the implementations above implements
the ServiceRegistrar
, Administrable
and
ReferentUuid
interfaces. The admin proxy, obtainable by
calling the getAdmin
method of
the main proxy, implements the DiscoveryAdmin
, JoinAdmin
, DestroyAdmin
and
ReferentUuid
interfaces.
This document provides the following information about Reggie:
Configuring Reggie
Both TransientRegistrarImpl
and
PersistentRegistrarImpl
service implementations obtain their
configurations by calling
ConfigurationProvider.getInstance
with the specified configOptions and
the class loader for the implementation class.
The configuration entries supported by the two implementations are listed
below. PersistentRegistrarImpl
supports all of the listed
entries. TransientRegistrarImpl
supports all listed entries
except for the following persistence/activation-specific entries:
activationIdPreparer
activationSystemPreparer
persistenceDirectory
persistenceSnapshotThreshold
persistenceSnapshotWeight
recoveredListenerPreparer
recoveredLocatorPreparer
All configuration entries listed below have com.sun.jini.reggie
as
their component.
• |
activationIdPreparer
| |
---|---|---|
  | Type: | ProxyPreparer
|
  | Default: |
new
|
  | Description: | Specifies the proxy preparer to use for the ActivationID for this service, if this service is run
as activatable. This service does not invoke any methods on the prepared
ActivationID directly; however, it passes it to clients which
may call its activate
method if they need to reactivate this service. This entry is obtained at
service start and restart if the service is running as activatable, and is
only supported by PersistentRegistrarImpl .
|
• |
activationSystemPreparer
| |
---|---|---|
  | Type: | ProxyPreparer
|
  | Default: |
new
|
  | Description: | Specifies the proxy preparer to use for the ActivationSystem proxy. During shutdown, this service
calls the unregisterObject method on the ActivationSystem instance
returned from this preparer. This entry is obtained at service start and
restart if the service is running as activatable, and is only supported by
PersistentRegistrarImpl .
|
• |
discoveryConstraints
| |
---|---|---|
  | Type: | MethodConstraints
|
  | Default: | null
|
  | Description: | Specifies constraints to apply to the multicast request,
multicast announcement and unicast discovery protocols. Multicast request
constraints are derived by calling getConstraints
on the obtained MethodConstraints instance with a
Method object for the DiscoveryConstraints.multicastRequest() method;
multicast announcement and unicast discovery constraints are similarly
obtained by passing Method objects for the DiscoveryConstraints.multicastAnnouncement() and
DiscoveryConstraints.unicastDiscovery()
methods, respectively. A null value is interpreted as mapping
all methods to empty constraints.
Reggie supports use of the following constraint types to control discovery behavior:
|
• |
discoveryManager
| |
---|---|---|
  | Type: | DiscoveryManagement
|
  | Default: |
new |
  | Description: | Specifies DiscoveryManagement instance to
use to discover other lookup services with which this service should
register. The object returned must also implement DiscoveryGroupManagement and DiscoveryLocatorManagement , and should be configured
initially to discover no groups or specific lookup services. This entry is
obtained at service start and restart.
|
• |
initialLookupAttributes
| |
---|---|---|
  | Type: |
|
  | Default: | new Entry[0]
|
  | Description: | Specifies initial attributes to use when registering with
lookup services (including self). The null value is
equivalent to an empty Entry array. This service
implementation provides two additional hardcoded attributes--a ServiceInfo instance with name field
set to the string "Lookup" , and a BasicServiceType instance with type
field also set to "Lookup" --which are combined with the
entry-specified attributes to obtain the total set of initial attributes
with which to register. This entry is obtained once at service start; the
current set of attributes (modifiable via the JoinAdmin methods of Reggie's admin object) is persisted
across restarts.
|
• |
initialLookupGroups
| |
---|---|---|
  | Type: | String[]
|
  | Default: | DiscoveryGroupManagement.NO_GROUPS
|
  | Description: | Specifies initial groups for determining the set of
lookup services with which to register. This entry is obtained once at
service start; the current set of lookup groups (modifiable via the JoinAdmin methods of Reggie's admin object) is persisted
across restarts.
|
• |
initialLookupLocators
| |
---|---|---|
  | Type: |
|
  | Default: | new LookupLocator[0]
|
  | Description: | Specifies initial list of locators indicating other
lookup services with which to register. This entry is obtained once at
service start; the current set of lookup locators (modifiable via the
JoinAdmin methods of Reggie's admin object) is
persisted across restarts.
|
• |
initialMemberGroups
| |
---|---|---|
  | Type: | String[]
|
  | Default: | new String[]{ "" }
|
  | Description: | Specifies initial groups for this lookup service to be a
member of. The value should not be null (which is equal to
DiscoveryGroupManagement.ALL_GROUPS ). This
entry is obtained once at service start; the current set of member groups
(modifiable via the DiscoveryAdmin methods of
Reggie's admin object) is persisted across restarts.
|
• |
initialUnicastDiscoveryPort
| |
---|---|---|
  | Type: | int
|
  | Default: | 0
|
  | Description: | Specifies the initial number of the port on which to
listen for unicast discovery queries. If the port number is
0 , then an arbitrary port is selected (with preference given
to net.jini.discovery.Constants#discoveryPort , if available). This
entry is obtained once at service start; the current value (modifiable via
the DiscoveryAdmin methods of Reggie's admin
object) is persisted across restarts.
|
• |
listenerPreparer
| |
---|---|---|
  | Type: | ProxyPreparer
|
  | Default: |
new
|
  | Description: | Specifies the proxy preparer to use for RemoteEventListener s registered with this service in
calls to ServiceRegistrar.notify(net.jini.core.lookup.ServiceTemplate, int, net.jini.core.event.RemoteEventListener, java.rmi.MarshalledObject, long) . During
event notification, this service calls the notify method on
RemoteEventListener instances returned from this preparer.
This entry is obtained at service start and restart.
|
• |
locatorPreparer
| |
---|---|---|
  | Type: | ProxyPreparer
|
  | Default: |
new
|
  | Description: | Specifies the proxy preparer to use for LookupLocator s passed to this service in calls to
the addLookupLocators ,
setLookupLocators and
removeLookupLocators
methods of its admin object. When registering with other lookup services,
this service may call or use the constraints assigned to the
getRegistrar methods of LookupLocator instances
returned from this preparer. This entry is obtained at service start and
restart.
|
• |
loginContext
| |
---|---|---|
  | Type: | LoginContext
|
  | Default: | Do not perform JAAS login |
  | Description: | Specifies the JAAS login context to use for performing a
JAAS login and supplying the Subject to use
when running the service. If this entry is not specified or if it is
specified with a value of null , no JAAS login is
performed. This entry is obtained at service start and restart.
|
• |
minMaxEventLease
| |
---|---|---|
  | Type: | long
|
  | Default: | 1000 * 60 * 30L
|
  | Description: | Specifies the lower bound for the maximum value allowed
for event leases, in milliseconds. The maximum event lease granted is
never less than the specified value, but may be greater than it if the
expected average time between lease renewals (based on the current number
of service and event registrations) would be less than the value of the
minRenewalInterval configuration entry. This entry replaces
in function the setMinMaxEventLease method of the
RegistrarAdmin interface supported by previous implementations
of Reggie, and is obtained at service start and restart.
|
• |
minMaxServiceLease
| |
---|---|---|
  | Type: | long
|
  | Default: | 1000 * 60 * 5L
|
  | Description: | Specifies the lower bound for the maximum value allowed
for service leases, in milliseconds. The maximum service lease granted is
never less than the specified value, but may be greater than it if the
expected average time between lease renewals (based on the current number
of service and event registrations) would be less than the value of the
minRenewalInterval configuration entry. This entry replaces
in function the setMinMaxServiceLease method of the
RegistrarAdmin interface supported by previous implementations
of Reggie, and is obtained at service start and restart.
|
• |
minRenewalInterval
| |
---|---|---|
  | Type: | long
|
  | Default: | 100L
|
  | Description: | Specifies the minimum average time to maintain between
lease renewals, in milliseconds. This entry replaces in function the
setMinRenewalInterval method of the
RegistrarAdmin interface supported by previous implementations
of Reggie, and is obtained at service start and restart.
|
• |
multicastAnnouncementInterval
| |
---|---|---|
  | Type: | long
|
  | Default: | 1000 * 60 * 2L
|
  | Description: | Specifies the number of milliseconds to wait in between
sending multicast announcement packets. This entry is consulted instead of
the net.jini.discovery.announce system property used by
previous implementations of Reggie. This entry is obtained at service
start and restart.
|
• |
multicastInterfaceRetryInterval
| |
---|---|---|
  | Type: | int
|
  | Default: | 1000 * 60 * 5
|
  | Description: | Specifies the number of milliseconds to wait in between
retrying multicast interfaces for which initial attempts at enablement
failed. Failed interfaces are retried at the given interval until they are
successfully enabled; the overall set of multicast interfaces to use is
configurable via the multicastInterfaces configuration entry.
This entry is obtained at service start and restart.
|
• |
multicastInterfaces
| |
---|---|---|
  | Type: |
|
  | Default: | Use all network interfaces |
  | Description: | Specifies the network interfaces to use to send and
receive multicast request and announcement packets as part of multicast
discovery. If no value is specified for this entry, then all network
interfaces of the host are used. If the entry value is null ,
then the interface to which the operating system defaults is used. If the
entry value is a zero-length array, then multicast discovery is disabled.
This entry is consulted instead of the
net.jini.discovery.interface system property used by previous
implementations of Reggie, and is obtained at service start and restart.
|
• |
multicastRequestSubjectChecker
| |
---|---|---|
  | Type: | ClientSubjectChecker
|
  | Default: | Do not check Subject s of
multicast requests
|
  | Description: | Specifies the object to use for screening multicast
requests based on their authenticated Subject s. This entry is
obtained at service start and restart.
|
• |
persistenceDirectory
| |
---|---|---|
  | Type: | String
|
  | Default: | Required: no default |
  | Description: | Specifies the directory where the service's persistent
state is recorded. This entry is obtained at service start and restart,
and is only supported by PersistentRegistrarImpl , which
requires it to be set.
|
• |
persistenceSnapshotThreshold
| |
---|---|---|
  | Type: | int
|
  | Default: | 200
|
  | Description: | Specifies the minimum number of log updates before a new
snapshot can be taken. This entry replaces the
setLogToSnapshotThreshold method of the
RegistrarAdmin interface supported by previous implementations
of Reggie. It is obtained at service start and restart, and is only
supported by PersistentRegistrarImpl .
|
• |
persistenceSnapshotWeight
| |
---|---|---|
  | Type: | float
|
  | Default: | 10.0F
|
  | Description: | Specifies the weight factor by which the snapshot size is
multiplied in order to determine when to take the next snapshot--when the
number of log records exceeds the product of
persistenceSnapshotWeight and the snapshot size and is larger
than the persistenceSnapshotThreshold value, then a snapshot
is taken. This entry replaces the setSnapshotWeight method of
the RegistrarAdmin interface supported by previous
implementations of Reggie. It is obtained at service start and restart,
and is only supported by PersistentRegistrarImpl .
|
• |
recoveredListenerPreparer
| |
---|---|---|
  | Type: | ProxyPreparer
|
  | Default: |
new
|
  | Description: | Specifies the proxy preparer to use for RemoteEventListener s recovered from the service's
persistent state log. During event notification, this service calls the
notify method on
RemoteEventListener instances returned from this preparer.
This entry is obtained at service start and restart, and is only supported
by PersistentRegistrarImpl .
|
• |
recoveredLocatorPreparer
| |
---|---|---|
  | Type: | ProxyPreparer
|
  | Default: |
new
|
  | Description: | Specifies the proxy preparer to use for LookupLocator s recovered from the service's
persistent state log. When registering with other lookup services, this
service may call or use the constraints assigned to the
getRegistrar methods of LookupLocator instances
returned from this preparer. This entry is obtained at service start and
restart, and is only supported by PersistentRegistrarImpl .
|
• |
resourceIdGenerator
| |
---|---|---|
  | Type: | UuidGenerator
|
  | Default: | new UuidGenerator()
|
  | Description: | Specifies the generator for producing Uuid s assigned to resources dispensed by the service, such as
leases and service registrations. This entry is obtained at service start
and restart.
|
• |
serverExporter
| |
---|---|---|
  | Type: | Exporter
|
  | Default: |
// if non-activatable new |
  | Description: | Specifies the exporter to use to export this service.
Note that this entry, while supported by both
TransientRegistrarImpl and
PersistentRegistrarImpl , has a different default value for
PersistentRegistrarImpl in the activatable case. For the
activatable case, the activationID value is passed in as the
data argument in the call to Configuration.getEntry(String,String,Class,Object,Object) .
This entry is obtained at service start and restart.
|
• |
serviceIdGenerator
| |
---|---|---|
  | Type: | UuidGenerator
|
  | Default: | new UuidGenerator()
|
  | Description: | Specifies the generator for producing service IDs
assigned to services registering with this lookup service that do not
already have service IDs. This generator is also used to produce the
service ID for this lookup service. The Uuid s returned
by the generator are converted into ServiceID
instances by extracting their 128-bit values and using them to construct
corresponding ServiceID s. This entry is obtained at service
start and restart.
|
• |
taskManager
| |
---|---|---|
  | Type: | TaskManager
|
  | Default: | new TaskManager(50, 1000 * 15, 1.0F)
|
  | Description: | Specifies the object that pools and manages the threads used by this service to respond to discovery requests and send event notifications. This entry is obtained at service start and restart. |
• |
unexportTimeout
| |
---|---|---|
  | Type: | long
|
  | Default: | 1000 * 60 *2L
|
  | Description: | Specifies the maximum time in milliseconds to wait for in-progress calls to finish before forcibly unexporting Reggie during shutdown. |
• |
unexportWait
| |
---|---|---|
  | Type: | long
|
  | Default: | 1000L
|
  | Description: | Specifies the maximum time in milliseconds to wait
between unexport attempts during shutdown while
unexportTimeout has not expired.
|
• |
unicastDiscoveryHost
| |
---|---|---|
  | Type: | String
|
  | Default: |
|
  | Description: | Specifies the host name for unicast discovery, which is advertised in multicast announcements and (protocol 2) unicast discovery responses. This entry is obtained at service start and restart. |
• |
unicastDiscoverySubjectChecker
| |
---|---|---|
  | Type: | ClientSubjectChecker
|
  | Default: | Do not check client Subject
during unicast discovery
|
  | Description: | Specifies the object to use for screening unicast
discovery attempts based on their authenticated client
Subject s. This entry is obtained at service start and
restart.
|
LookupDiscoveryManager
, used to discover
lookup services, as specified by the
discoveryManager
configuration entry
JoinManager
, used to manage lookup service
registrations
Access Control Permission Targets
The following table lists the remote methods on Reggie's proxy objects and
the associated target names for enforcing access control using RegistrarPermission
:
Loggers and Logging Levels
Both PersistentRegistrarImpl
and
TransientRegistrarImpl
log diagnostic information to the Logger
named com.sun.jini.reggie
. The
server-side components of each implementation log information at the following
logging levels:
Level | Description |
---|---|
SEVERE | Exceptions that prevent service startup |
WARNING | Exceptions that, while non-fatal, indicate compromised service functionality, such as failures to persist or recover state, or to send multicast announcements on an explicitly configured interface |
INFO | Service start, restart, or destruction events, as well as exceptions of moderate severity, such as failures to send event notifications or multicast announcements, or to establish a unicast discovery connection |
CONFIG | Changes made to the service through administrative interfaces, as well as high-level service configuration information, such as the persistence directory (if any) and multicast interfaces (if any) used |
HANDLED | Minor exceptions involving activation, discovery, event handling, and shutdown that are handled internally by the service, and not reflected to callers |
FINE | Changes in service state, such as the establishment, expiration, and cancellation of service and event listener registrations, as well as invalid service ID values |
FINER | Persistent state log operations |
The service proxies for PersistentRegistrarImpl
and
TransientRegistrarImpl
log information at the following logging
levels:
Level | Description |
---|---|
WARNING | Invalid service IDs used for registration |
INFO | Service item unmarshalling exceptions |
System Properties
Both TransientRegistrarImpl
and
PersistentRegistrarImpl
service implementations support the
following system property:
• |
com.sun.jini.reggie.enableImplToStubReplacement
| |
---|---|---|
  | Description: | This system property is interpreted as a
boolean value (see Boolean.getBoolean ). If true , then JRMP impl-to-stub
replacement will be attempted on the service proxy objects contained in
ServiceItem s passed to the register method of Reggie's
proxy. By default, this behavior is not enabled--it is provided as a
transitional measure for services that depend on JRMP impl-to-stub
replacement when registering with Reggie.
|
Examples for Running Reggie
This section provides examples of running Reggie in various configurations.
Assumptions for Running the Examples
The examples below make the following assumptions:
com.sun.jini.tool.ClassServer
class for this purpose.
com.sun.jini.phoenix
implementation for this purpose.
Throughout the example, items in bold need to be
customized for your local environment.
Setting Discovery Constraints
Discovery constraints for Reggie can be set by specifying a
discoveryConstraints
entry under the
com.sun.jini.reggie
component. For example, to specify that
Reggie must wait at most five seconds to connect to a client attempting
discovery and at most three minutes to read data from a connected client
attempting discovery, the following entry must be added to Reggie's
configuration source file under the com.sun.jini.reggie
component:
discoveryConstraints = new BasicMethodConstraints( new MethodDesc[] { new MethodDesc("unicastDiscovery", new InvocationConstraints( new InvocationConstraint[] { new ConnectionRelativeTime(5000), new UnicastSocketTimeout(180000) // 3*60*1000 }, null ) ) } );
As another example, to specify that Reggie must use version two of of the
multicast request, multicast announcement, and unicast discovery protocols, the
following entry must be added to Reggie's configuration source file under the
com.sun.jini.reggie
component.
discoveryConstraints = new BasicMethodConstraints( new InvocationConstraints(DiscoveryProtocolVersion.TWO, null) );
Starting Transient Reggie using JRMP
To run a transient Reggie, which does not store any information
persistently or use the activation system to restart itself, using JRMP
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-jrmp-reggie.config
This configuration uses the following files.
File config_dir/jsk-all.policy
Use this security policy file for starting and running all Reggie
configurations. This file grants all permissions to local code included
in the lib
subdirectory of the starter kit installation.
grant codebase "file:install_dir/lib/*" { permission java.security.AllPermission; };
import com.sun.jini.start.NonActivatableServiceDescriptor; import com.sun.jini.start.ServiceDescriptor; com.sun.jini.start { private static codebase = "http://your_host:http_port/reggie-dl.jar" + " http://your_host:http_port/jsk-dl.jar"; private static policy = "config_dir/jsk-all.policy"; private static classpath = "install_dir/lib/reggie.jar"; private static config = "config_dir/transient-jrmp-reggie.config"; static serviceDescriptors = new ServiceDescriptor[] { new NonActivatableServiceDescriptor( codebase, policy, classpath, "com.sun.jini.reggie.TransientRegistrarImpl", new String[] { config }) }; }
import net.jini.jrmp.JrmpExporter; com.sun.jini.reggie { initialMemberGroups = new String[] { "your.group" }; serverExporter = new JrmpExporter(); }
java -Djava.security.policy=config_dir/jsk-all.policy \ -jar install_dir/lib/start.jar \ config_dir/start-persistent-jrmp-reggie.config
Note: Because JRMP does not provide a convenient way to specify the same object ID each time a given object is exported, this configuration is only useful for debugging -- an existing service proxy cannot be used after the service is restarted.
This configuration uses the following additional files.
File config_dir/start-persistent-jrmp-reggie.config
Use this configuration source file to start persistent Reggie using
JRMP.
import com.sun.jini.start.NonActivatableServiceDescriptor; import com.sun.jini.start.ServiceDescriptor; com.sun.jini.start { private static codebase = "http://your_host:http_port/reggie-dl.jar" + " http://your_host:http_port/jsk-dl.jar"; private static policy = "config_dir/jsk-all.policy"; private static classpath = "install_dir/lib/reggie.jar"; private static config = "config_dir/persistent-jrmp-reggie.config"; static serviceDescriptors = new ServiceDescriptor[] { new NonActivatableServiceDescriptor( codebase, policy, classpath, "com.sun.jini.reggie.PersistentRegistrarImpl", new String[] { config }) }; }
import net.jini.jrmp.JrmpExporter; com.sun.jini.reggie { initialMemberGroups = new String[] { "your.group" }; persistenceDirectory = "config_dir/reggie.log"; serverExporter = new JrmpExporter(); }
java -Djava.security.policy=config_dir/jsk-all.policy \ -jar install_dir/lib/start.jar \ config_dir/start-activatable-jrmp-reggie.config
You should remove the config_dir/group.log directory before running this command. Note that the activation system will restart the activatable Reggie service as needed until Reggie is shutdown.
Remember to remove the config_dir/reggie.log directory before running this command if you want Reggie to forget registrations and settings made in previous invocations.
This configuration uses the following additional files.
File config_dir/start-activatable-jrmp-reggie.config
Use this configuration source file to start activatable Reggie using
JRMP.
import com.sun.jini.start.ServiceDescriptor; import com.sun.jini.start.SharedActivatableServiceDescriptor; import com.sun.jini.start.SharedActivationGroupDescriptor; com.sun.jini.start { private static reggieCodebase = "http://your_host:http_port/reggie-dl.jar" + " http://your_host:http_port/jsk-dl.jar"; private static reggiePolicy = "config_dir/jsk-all.policy"; private static reggieClasspath = "install_dir/lib/reggie.jar"; private static reggieConfig = "config_dir/activatable-jrmp-reggie.config"; private static groupCodebase = "http://your_host:http_port/group-dl.jar"; private static groupPolicy = "config_dir/jsk-all.policy"; private static groupClasspath = "install_dir/lib/sharedvm.jar"; private static groupPersistenceDirectory = "config_dir/group.log"; static serviceDescriptors = new ServiceDescriptor[] { new SharedActivationGroupDescriptor( groupPolicy, groupClasspath, groupPersistenceDirectory, null /* serverCommand */, null /* serverOptions */, null /* serverProperties */), new SharedActivatableServiceDescriptor( reggieCodebase, reggiePolicy, reggieClasspath, "com.sun.jini.reggie.PersistentRegistrarImpl", groupPersistenceDirectory, new String[] { reggieConfig }, true /* restart */) }; }
import java.rmi.activation.ActivationID; import net.jini.jrmp.JrmpExporter; com.sun.jini.reggie { initialMemberGroups = new String[] { "your.group" }; persistenceDirectory = "config_dir/reggie.log"; serverExporter = new JrmpExporter((ActivationID) $data, 0); }
java -Djava.security.policy=config_dir/jsk-all.policy \ -jar install_dir/lib/destroy.jar \ config_dir/stop-activatable-reggie.config
Running this command will remove the config_dir/group.log directory.
Note that this command does not actually destroy the service itself, but just destroys the activation group the service is running in. You may want to first destroy the service using Reggie's administrable interface, or to remove the config_dir/reggie.log directory after destroying the activation group.
This command uses the following additional file.
File config_dir/stop-activatable-reggie.config
Use this configuration source file to destroy the activation group for
an activatable Reggie.
import com.sun.jini.start.ServiceDescriptor; import com.sun.jini.start.SharedActivatableServiceDescriptor; com.sun.jini.start { private static codebase = "http://your_host:http_port/group-dl.jar"; private static policy = "config_dir/jsk-all.policy"; private static classpath = "install_dir/lib/group.jar"; private static persistenceDirectory = "config_dir/group.log"; static serviceDestructors = new ServiceDescriptor[] { new SharedActivatableServiceDescriptor( codebase, policy, classpath, "com.sun.jini.start.SharedGroupImpl", persistenceDirectory, null /* config */, false /* restart */) }; }
java -Djava.security.policy=config_dir/jsk-all.policy \ -jar install_dir/lib/start.jar \ config_dir/start-transient-reggie.config
This configuration uses the following additional files.
File config_dir/start-transient-reggie.config
Use this configuration source file to start transient Reggie using
Jini ERI.
import com.sun.jini.start.NonActivatableServiceDescriptor; import com.sun.jini.start.ServiceDescriptor; com.sun.jini.start { private static codebase = "http://your_host:http_port/reggie-dl.jar" + " http://your_host:http_port/jsk-dl.jar"; private static policy = "config_dir/jsk-all.policy"; private static classpath = "install_dir/lib/reggie.jar"; private static config = "config_dir/transient-reggie.config"; static serviceDescriptors = new ServiceDescriptor[] { new NonActivatableServiceDescriptor( codebase, policy, classpath, "com.sun.jini.reggie.TransientRegistrarImpl", new String[] { config }) }; }
com.sun.jini.reggie { initialMemberGroups = new String[] { "your.group" }; }
java -Djava.security.policy=config_dir/jsk-all.policy \ -jar install_dir/lib/start.jar \ config_dir/start-persistent-reggie.config
This configuration uses the following additional files.
File config_dir/start-persistent-reggie.config
Use this configuration source file to start persistent Reggie using Jini
ERI.
import com.sun.jini.start.NonActivatableServiceDescriptor; import com.sun.jini.start.ServiceDescriptor; com.sun.jini.start { private static codebase = "http://your_host:http_port/reggie-dl.jar" + " http://your_host:http_port/jsk-dl.jar"; private static policy = "config_dir/jsk-all.policy"; private static classpath = "install_dir/lib/reggie.jar"; private static config = "config_dir/persistent-reggie.config"; static serviceDescriptors = new ServiceDescriptor[] { new NonActivatableServiceDescriptor( codebase, policy, classpath, "com.sun.jini.reggie.PersistentRegistrarImpl", new String[] { config }) }; }
The obj_port is the fixed TCP port to use for listening for requests for this object. The obj_UUID_string is the universally unique ID for the exported object. These IDs have the formimport net.jini.id.UuidFactory; import net.jini.jeri.BasicILFactory; import net.jini.jeri.BasicJeriExporter; import net.jini.jeri.tcp.TcpServerEndpoint; com.sun.jini.reggie { initialMemberGroups = new String[] { "your.group" }; persistenceDirectory = "config_dir/reggie.log"; serverExporter = new BasicJeriExporter( TcpServerEndpoint.getInstance(obj_port), new BasicILFactory(), false, true, UuidFactory.create("obj_UUID_string")); }
"01234567-89ab-cdef-0123-456789abcdef"
.
Remember to remove the config_dir/reggie.log directory
before restarting persistent Reggie if you want it to forget registrations
and settings made in previous invocations.
Starting Activatable Reggie using Jini ERI
To run an activatable Reggie, which stores information persistently and
uses the activation system to restart itself, 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-reggie.config
You should remove the config_dir/group.log directory before running this command. Note that the activation system will restart the activatable Reggie service as needed until Reggie is shutdown.
Remember to remove the config_dir/reggie.log directory before running this command if you want Reggie to forget registrations and settings made in previous invocations.
This configuration uses the following additional files.
File config_dir/start-activatable-reggie.config
Use this configuration source file to start activatable Reggie using Jini
ERI.
import com.sun.jini.start.ServiceDescriptor; import com.sun.jini.start.SharedActivatableServiceDescriptor; import com.sun.jini.start.SharedActivationGroupDescriptor; com.sun.jini.start { private static reggieCodebase = "http://your_host:http_port/reggie-dl.jar" + " http://your_host:http_port/jsk-dl.jar"; private static reggiePolicy = "config_dir/jsk-all.policy"; private static reggieClasspath = "install_dir/lib/reggie.jar"; private static reggieConfig = "config_dir/activatable-reggie.config"; private static groupCodebase = "http://your_host:http_port/group-dl.jar"; private static groupPolicy = "config_dir/jsk-all.policy"; private static groupClasspath = "install_dir/lib/sharedvm.jar"; private static groupPersistenceDirectory = "config_dir/group.log"; static serviceDescriptors = new ServiceDescriptor[] { new SharedActivationGroupDescriptor( groupPolicy, groupClasspath, groupPersistenceDirectory, null /* serverCommand */, null /* serverOptions */, null /* serverProperties */), new SharedActivatableServiceDescriptor( reggieCodebase, reggiePolicy, reggieClasspath, "com.sun.jini.reggie.PersistentRegistrarImpl", groupPersistenceDirectory, new String[] { reggieConfig }, true /* restart */) }; }
com.sun.jini.reggie { initialMemberGroups = new String[] { "your.group" }; persistenceDirectory = "config_dir/reggie.log"; }
net.jini.core.lookup
,
ServiceRegistrar
Copyright © GigaSpaces.