com.sun.jini.fiddler
Class StartFiddler

java.lang.Object
  |
  +--com.sun.jini.fiddler.StartFiddler

public class StartFiddler
extends java.lang.Object


Inner Class Summary
static class StartFiddler.Created
          Static class that acts as a data structure for holding the multiple return values from the create methods.
 
Method Summary
static LookupDiscoveryService create(java.rmi.activation.ActivationGroupID gid, java.lang.String logDirname, java.lang.String[] groups, LookupLocator[] locators)
          This method creates an activatable instance of the Fiddler implementation of the lookupdiscovery service and returns a proxy that provides client-side access to that instance.
static StartFiddler.Created create(java.lang.String classpath, java.lang.String codebase, java.lang.String policy, java.lang.String logdir)
          This method creates an activatable instance of the Fiddler implementation of the lookupdiscovery service and returns a proxy that provides client-side access to that instance.
static StartFiddler.Created create(java.lang.String classpath, java.lang.String codebase, java.lang.String policy, java.lang.String logdir, java.lang.String[] groups, LookupLocator[] locators, java.util.Properties props, java.lang.String cmdpath, java.lang.String[] argv)
          This method creates an activatable instance of the Fiddler implementation of the lookupdiscovery service and returns a proxy that provides client-side access to that instance.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(java.lang.String[] args)

create

public static LookupDiscoveryService create(java.rmi.activation.ActivationGroupID gid,
                                            java.lang.String logDirname,
                                            java.lang.String[] groups,
                                            LookupLocator[] locators)
                                     throws java.rmi.activation.ActivationException,
                                            java.io.IOException
This method creates an activatable instance of the Fiddler implementation of the lookupdiscovery service and returns a proxy that provides client-side access to that instance.

If no group names are entered on the command line, then the default action that the lookup discovery service takes with respect to groups is to join the un-named public group ("").

Note that when the lookup discovery service is destroyed (through the com.sun.jini.admin.DestroyAdmin interface provided by the Fiddler implementation), it will also destroy its activation group, regardless of whether or not there are other activatable objects still registered in the same group. This is due to the following reason:

When the ActivationDesc is created below, the location parameter to the constructor is not set. If it were to be set, then both the import codebase (the classpath) and the export codebase of this class would be the same; that is, the activation system would use that location to retrieve classes when activating the server-side, and would also annotate with that location all remote classes that are downloaded to the client-side. Since this class wishes to distinguish the import codebase from the export codebase, it must communicate each codebase's value to the activation system through a different mechanism than the location parameter of the constructor of ActivationDesc. That alternate mechanism consists of creating an activation group descriptor (ActivationGroupDesc) in which the properties are over-ridden to include the desired import codebase as the new classpath property ("-cp "); and the export codebase as the new java.rmi.server.codebase property. This class' activation descriptor (ActivationDesc) is the created using the same group ID (ActivationGroupID) as that generated by the creation of the activation group descriptor with the desired import and export codebases.

Because the activation group that is created and registered with the activation system is useful only to entities that have the same import and export codebases as those registered with the group, (and because such entities wishing to register with that activation group would also have to obtain the activation group ID from the service registered by this class), it is not expected that when the service is destroyed through the DestroyAdmin that any other entities will be registered in the activation group. Being the only entity registered in the activation group means that when it is destroyed, it is also the last entity registered in the group. Thus, upon destroying the service, the activation group created here is also ultimately unregistered (removed) from the activation system because once that service is destroyed, there is no way to access the activation group ID for future registrations (or even for destroying).

Parameters:
gid - ID of the activation group to use
logDirname - directory in which the state of the lookup discovery service will be recorded for persistence
groups - String array containing the names of the groups whose members are the lookup services that should be discovered and joined
locators - String array containing the names of the hosts running the specific lookup services to discover and join (these host names will eventually be used to build corresponding instances of the class net.jini.core.discovery.LookupLocator)
Returns:
an instance of the LookupDiscoveryService interface which is a proxy that provides client-side access to the created lookup discovery service
Throws:
java.rmi.activation.ActivationException - this is a general exception thrown by the activation system to indicate a a number of exceptional conditions that prevent the activation system from fulfilling a particular request.
java.io.IOException -  

create

public static StartFiddler.Created create(java.lang.String classpath,
                                          java.lang.String codebase,
                                          java.lang.String policy,
                                          java.lang.String logdir)
                                   throws java.rmi.activation.ActivationException,
                                          java.io.IOException
This method creates an activatable instance of the Fiddler implementation of the lookupdiscovery service and returns a proxy that provides client-side access to that instance.

The lookup discovery service is initially a member of no groups.

Note that when the lookup discovery service is destroyed (through the com.sun.jini.admin.DestroyAdmin interface provided by the Fiddler implementation), it will also destroy its activation group, regardless of whether or not there are other activatable objects still registered in the same group.

Parameters:
classpath - classpath for the lookup discovery service
codebase - codebase for the lookup discovery service
policy - the lookup discovery service's security policy file
logdir - directory in which the lookup discovery service's state will be recorded for persistence
Throws:
java.rmi.activation.ActivationException - this is a general exception thrown by the activation system to indicate a a number of exceptional conditions that prevent the activation system from fulfilling a particular request.
java.io.IOException -  

create

public static StartFiddler.Created create(java.lang.String classpath,
                                          java.lang.String codebase,
                                          java.lang.String policy,
                                          java.lang.String logdir,
                                          java.lang.String[] groups,
                                          LookupLocator[] locators,
                                          java.util.Properties props,
                                          java.lang.String cmdpath,
                                          java.lang.String[] argv)
                                   throws java.rmi.activation.ActivationException,
                                          java.io.IOException
This method creates an activatable instance of the Fiddler implementation of the lookupdiscovery service and returns a proxy that provides client-side access to that instance.

The lookup discovery service is initially a member of no groups.

Note that when the lookup discovery service is destroyed (through the com.sun.jini.admin.DestroyAdmin interface provided by the Fiddler implementation), it will also destroy its activation group, regardless of whether or not there are other activatable objects still registered in the same group.

Parameters:
classpath - classpath for the lookup discovery service
codebase - codebase for the lookup discovery service
policy - the lookup discovery service's security policy file
logdir - directory in which the lookup discovery service's state will be recorded for persistence
groups - String array containing the names of the groups whose members are the lookup services that should be discovered and joined
locators - String array containing the names of the hosts running the specific lookup services to discover and join (these host names will eventually be used to build corresponding instances of the class net.jini.core.discovery.LookupLocator)
props - properties for the activation group, or null
cmdpath - command program for the activation group, or null
argv - command options for the activation group, or null
Throws:
java.rmi.activation.ActivationException - this is a general exception thrown by the activation system to indicate a a number of exceptional conditions that prevent the activation system from fulfilling a particular request.
java.io.IOException -  


Copyright © 1999 Sun Microsystems, Inc. All rights reserved