servertool


servertoolSince JDK 1.4

Synopsis

     servertool -ORBInitialPort <ns-port> [ options ] [ commands ]

Description

The servertool is used with the orbd Naming Service to provide persistent CORBA server objects. A CORBA server registered with an orbd daemon using servertool is managed as a persistent named server. If the server object dies, the next request made of that server through orbd causes orbd to reactivate the server object using information in orbd's persistent store. This information is registered with orbd using servertool's command interface.

Options


-J< javaoption>

The given option is passed directly to the underlying Java virtual machine. There is no space between the -J and the option. For example, to run the JVM in verbose mode, use:

     > servertool -J-verbose ...


-ORBInitialPort < ns-port>

Required. This is the standard CORBA property that controls the initial port used for services such as the Naming Service. Normally it's optional for CORBA servants and tools, but the servertool requires it be specified on the command line. The default port for the Naming Service is port 900, but on some Unix variants, ports less than 1024 are restricted to root access, so you need to specify a higher port number, such as 1050. The port number specified when starting servertool should match the ORBInitialPort used to start the orbd daemon.

Commands

The following commands are executed using the servertool command line or prompt. You can specify a single command from the list on the command line when you invoke servertool; servertool executes the command and exits. If you don't provide a command on startup, servertool presents a prompt, allowing you to execute the command.


getserverid -applicationName < appName>

Prints the server identifier for a server object, given its application name.


help

Prints a list of the available commands.


list

Lists details about all the persistent servers registered with the orbd daemon.


listactive

Lists details about all currently active server objects (i.e., all servers that are registered and running, not awaiting activation or reactivation).


listappnames

Lists the application names for all the persistent servers registered with the orbd daemon.


locate -serverid < serverID> [ -endpointType < type> ]


locate -applicationName < +> [ -endpointType < type> ]

Prints details of the ports used by the ORB(s) created for a particular server object. The server object can be specified using either its server identifier (obtained using the getserverid, list, or listactive commands) or using its application name (obtained using the list, listappnames, or listactive commands). If an endpoint type is specified, only ports of that type are listed. The only port type that seems to be supported in Sun's JDK is IIOP_CLEAR_TEXT.

If the specified server object isn't running when this command is invoked, it is activated.


locateperorb -serverid < serverID> [ -orbid < orbID> ]


locateperorb -applicationName < appName> [ -orbid < orbID> ]

The same as locate, except that it allows you to specify a specific ORB started by the server object and prints ports only for that ORB. If no -orbid option is used, an empty ORB name (i.e., " ") is used. The names given to ORBs that are started by a given server object are obtained using the orblist command.


orblist -serverid < serverID>


orblist -applicationName < appName>

Lists the identifiers for the ORBs created by a server object. If the specified server object isn't running, it is activated.


quit

Quits the servertool process but doesn't stop the orbd daemon.


register -server < serverClass> -classpath < pathlist> [ -applicationName < name> ] [ -args < serverArgs>] [ -vmargs < javaoptions> ]

Registers a new CORBA server object with the persistent naming services of orbd. The -server option specifies the fully qualified name of a server object that registers CORBA objects with the Naming Service. The specified class must have a main( ) method, which is executed by the daemon to activate and reactivate the CORBA server. The server object is activated automatically when this register command is invoked. If the server object also has an install( ) method with the following signature:

     public static void install(org.omg.CORBA.ORB orb)

then this method is also invoked once when this command is invoked in servertool. This provides a way for the server object to have a one-time setup of persistent resources.

The -classpath option specifies where to search for the classes required by the server object.

The -applicationName option specifies a name to associate with the server object. This name is used in the information printed by the list, listappnames, and listactive commands and can also unregister a server object using the unregister command.

The -args option specifies arguments to give to the server object when its main( ) method is invoked.

The -vmargs option specifies arguments to pass to the JVM when the server object is activated.


shutdown -serverid < serverID>


shutdown -applicationName < appName>

Shuts down (deactivates) a server object registered with the ORB. If the server class has a shutdown( ) method, it's called when this method is invoked.


startup -serverid <serverID>


startup -applicationName <appName>

Manually reactivates a server object. If the specified server is already running, the command returns an error and does nothing.


unregister -serverid < serverID>


unregister -applicationName < appName>

Removes a server object from the Naming Service's persistence services. The server object can be referenced using either its server identifier (which can be obtained using the getserverid, list, or listactive commands) or using its application name (which can be obtained using the list, listappnames, or listactive commands).

If the server object has a static uninstall( ) method with the signature:

     public static void uninstall(org.omg.CORBA.ORB orb)

then this method is invoked when unregister is called on the server object. This lets the server object clean up any persistent resources.



Java Enterprise in a Nutshell
Java Enterprise in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596101422
EAN: 2147483647
Year: 2004
Pages: 269

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net