[Previous] [Contents] [Next] [IONA Technologies]


Chapter 1
The OrbixWeb Utilities


Contents

1.1 Activation Modes
1.2 The putit Utility
1.2.1 Switches to putit
1.2.2 Examples of using putit
1.2.3 Advanced Use of putit, Pattern Matching
1.2.4 Advanced putit Examples
1.2.5 Markers, Methods and Patterns
1.2.6 Using the Orbix putit Utility to Register OrbixWeb Servers



This chapter describes the command line interface to the OrbixWeb Implementation Repository. This interface allows Implementation Repository entries describing the details of a server registration to be obtained and modified.

1.1 Activation Modes

Chapter 11, "Registration and Activation of Servers" of the OrbixWeb Programming Guide describes the various activation modes by which OrbixWeb servers can be launched. These activation modes give the server programmer control over how servers are implemented as processes by the underlying operating system. For convenience the available activation modes are summarised here since they are relevant to the OrbixWeb utilities that are described in this chapter.

The primary activation modes are shared, unshared, and per-method. In shared mode, all1 of the objects with the same server name on a given machine are managed by one process on that machine. In unshared mode, individual objects are registered with the Implementation Repository, and a process is launched for each such object. In per-method mode, individual operations are registered with the Implementation Repository, and each invocation on an operation results in a separate process. If a server is registered in shared mode, then it can be launched manually prior to any invocation on its objects. Such servers are referred to as persistent servers in the CORBA specification.

Note that:


Note that per-method servers are activated for a single IDL operation call. As a result, the per-client flag is ignored for per-method servers.

1.2 The putit Utility

The general form of the putit command is:

where <command line> is usually an absolute pathname specifying an executable file that implements the server. It could also be a shell command or a shell script.

OrbixWeb servers are implemented as Java classes and should be registered using the putit -java switch. This switch allows a class name (and an optional class path) to be specified as follows:

This command specifies that the OrbixWeb daemon, when required to launch the server, should invoke the Java interpreter on the specified bytecode. Any command line parameters to be given to the target class are appended after the class name in the putit command. These parameters are given to the server every time it is run by OrbixWeb (however, they must be given explicitly if the server is launched manually).

If the arguments to the class to be interpreted include a hyphen (`-') character, then this character must be protected from being interpreted as a switch to putit. This can be done by, for example, putting the class name and its arguments in a string delineated by double-quotes:

Specifying a Class Path for an OrbixWeb Server

The OrbixWeb configuration file, Orbix.cfg, supports the specification of a default class path which will be used by the OrbixWeb daemon when launching all Java servers. As described in Chapter 3, "OrbixWeb Configuration", the configuration variable IT_DEFAULT_CLASSPATH stores the default class path value.

The putit command allows IT_DEFAULT_CLASSPATH to be overridden for a given server. To do this, the server should be registered with the -classpath switch, followed by the full class path for that server:

For example:

As an alternative, OrbixWeb also allows a partial class path to be specified during server registration. This partial class path will be appended to the value of IT_DEFAULT_CLASSPATH if the OrbixWeb daemon attempts to launch the specified server. The -addpath switch is used to specify a partial class path:

The functionality of the -classpath example given above could be achieved by setting IT_DEFAULT_CLASSPATH to the value /vol/jdk/classes and registering the server BankSrv as follows:

Specifying the Location of the Java Interpreter

Although not strictly a registration issue, it is important to be aware that the OrbixWeb daemon must be able to locate the Java interpreter in order to launch Java servers which have been registered in the Implementation Repository. This can be done by setting the value of the configuration variable value IT_JAVA_INTERPRETER in the file Orbix.cfg, as described in Chapter 3, "OrbixWeb Configuration".

Passing Parameters to the Java Interpreter

Conceptually, the class path details, class name and class arguments specified during the registration of an OrbixWeb server will be passed directly to the Java interpreter when the server is launched. If specific arguments should also be passed to the Java interpreter, then these can be added to the putit command as follows:

The string contained in double-quotes will be passed to the Java interpreter instead of the standard class name and class arguments.

Although registering a full Java interpreter command as an executable file for an OrbixWeb server would appear to achieve similar functionality, this is not an acceptable alternative. The -java switch significantly alters the internal server launch strategy of the OrbixWeb daemon and an OrbixWeb server should not be registered without this switch (unless the jrunit intermediate command is used as described in section 1.2.6).

1.2.1 Switches to putit

The syntax of the putit command is:

The switches are as follows:

-v

Outputs the program's version information without executing the command (this switch is available on all of the utility programs).

-h <host> Specifies the host name on which to execute the putit command. By default, the command is executed on the local host.

-per-client Specifies that a separate server process is to be used for each end-user. This activation mode can be used together with the shared, unshared or per-method modes.

-per-client-pid Specifies that a separate server process is to be used for each client process. This activation mode can be used together with the shared, unshared or per-method modes.

-shared Specifies that all active objects managed by a given server on a given machine will be contained in the same process. This is the default.

-unshared Specifies that as an object for a given server is invoked, an individual process is activated to handle all requests for that object. Each object managed by a server can (but does not have to) be registered with a different executable file–as specified in <command line>.

-per-method Specifies that each invocation to a server will result in a process being activated to handle that request. Each method can (but does not have to) be registered with a different executable file–as specified in <command line>.

-port <iiop port> Specifies a well known port number for a server. OrbixWeb will, if necessary, activate a server on a given TCP/IP port in response to operation invocations on an interoperable object reference (that is, in response to invocations that use IIOP).

-java Specifies that the server should be registered as a Java server; that is, a server which should be launched by invoking the Java interpreter on the specified bytecode. This option can be abbreviated as -j.

-classpath <class path> This switch can only be used in conjunction with the -java switch. Specifies a full class path to be passed to the Java interpreter when the server is launched. Overrides the default value IT_DEFAULT_CLASSPATH in Orbix.cfg.

-addpath <partial class path> This switch can only be used in conjunction with the -java switch. Specifies a partial class path to be appended to the default value IT_DEFAULT_CLASSPATH when the OrbixWeb daemon attempts to launch the server.

In the shared mode:


-n <number of servers>

This switch instructs the daemon to launch up to the specified number of servers. Each new client connection results in a new server being launched as long as the number of clients is less than the number specified to putit. When the number of clients equals the number of servers specified in putit, new clients are connected to running servers using a round robin algorithm.

The default number of servers is 1.

-persistent Specifies that the server may only be launched persistently, that is, manually. The server is never automatically launched by OrbixWeb. Note that if the -u switch is passed to the OrbixWeb daemon, such servers do not have to be registered in the Implementation Repository.

In the shared and unshared modes:


-marker <marker>

Specifies a marker value to identify a specific object, or set of objects, to which the putit applies. Note that marker names specified using putit cannot contain white space. See Chapter 7, "Publishing Object References in Servers", of the for details of how marker names may be assigned to an object.

In the per-method mode:


-method <method>

Specifies a method name to identify a specific method, or set of methods, to which the putit applies.

Executing putit without any arguments outputs a summary of its switches.

1.2.2 Examples of using putit

1. putit FirstTrust -java
-classpath /home/chris/classes:/usr/classes BankClass

Register a shared OrbixWeb server called "FirstTrust" on the local host, with the specified full class path and class name. Activation (launching) occurs when any of the objects managed by the FirstTrust server is invoked; there will be at most one server process associated with this server. All end users share the same server process.

2. putit -h alpha FirstTrust -java BankClass arg1

Register a shared server called "FirstTrust" on the host "alpha", with the specified class name and command line argument. Activation will occur as in (1).

3. putit -marker College_Green NationalBank -java BankClass

Register a shared server called "NationalBank" on the local host, with the specified class name. However activation will only occur for the object whose marker matches "College_Green". There will be at most one server process resulting from this registration request; although other -marker registrations can be issued for server NationalBank. All end users share the same server process.

4. putit -shared -marker St_Stephens_Green BankTrust -java BankClass

Similar to (3) above.

5. putit -unshared -marker College_Green FirstNational -java BankClass
putit -marker St_Stephens_Green FirstNational -java BankClass

The first command registers an unshared server called "FirstNational" on the local host with the specified class name and the second adds an activation order (marker and launch command) for the "St_Stephens_Green" marker. However activation will only occur for objects whose marker name is "College_Green" or "St_Stephens_Green" and each activation for a specific object will go to a unique server process for that particular object. All end users of a specific object share the same server process.

6. putit -per-client -unshared -marker College_Green \
NationalTrust -java BankClass

putit -marker St_Stephens_Green \
NationalTrust -java BankClass

The first command registers an unshared server called "NationalTrust" on the local host with the specified class name and the second adds an activation order for the marker "St_Stephens_Green". However activation will only occur for objects whose marker name is "College_Green" or "St_Stephens_Green", and each activation for that object will go to a unique server process for that particular object. Furthermore, each end-user will be bound to a separate server process, if two or more end-users bind to the same marker. Note that per-client activation mode results in a separate process for each end-user (principal); different clients owned by the same end-user will bind to the same process. The following examples of calls to _bind() illustrate this:
i. principal: chris
     _BankRef b1Ref = Bank._bind(
     		"College_Green:NationalTrust");
    
ii. principal: joan
     _BankRef b2Ref = Bank._bind(
     		"College_Green:NationalTrust"); 
    
iii. principal: chris
     _BankRef b3Ref = Bank._bind(
     		"College_Green:NationalTrust");
    
iv. principal: joe
     _BankRef b4Ref = Bank._bind(
     		"College_Green:NationalTrust");
    
Cases ii and iv, where different end users bind to the same marker, result in new processes being launched. Cases i and iii will share the same process.

7. putit FirstTrust -persistent

Register a shared server called "FirstTrust" on the local host. This server is to be launched persistently; it will not be activated automatically when an object managed by the FirstTrust server is invoked. No launch command is specified to putit, since the server will be manually launched.

8. putit -per-client-pid FirstTrust -java BankClass

Register a shared server called "FirstTrust" on the local host, with the specified class name. Activation (launching) occurs when any of the objects managed by the FirstTrust server is invoked; there will be a separate server process for each different client process associated with this server.

9. putit -per-client-pid -unshared -marker \
College_Green FirstNational -java BankClass

Register an unshared server called "FirstNational" on the local host with the specified class name. However activation will only occur for objects whose marker name is "College_Green" and each activation for a specific object and specific client process will go to a unique server process for that particular object and client process.

10. putit -per-method -method makeWithdrawal \
NationalTrust -java BankClass

Register a per-method server called "NationalTrust" on the local host with the specified class name. The activation is to occur only if the operation makeWithdrawal() is being called.

11. putit -method makeDeposit NationalTrust -java BankClass

Similar to (10) above. If the -method switch is specified, the server is assumed to be a per-method server.

1.2.3 Advanced Use of putit, Pattern Matching

Pattern matching can be used to specify a set of objects for the -marker switch, or a set of methods for the -method switch. The use of pattern matching allows a group of server processes to share a workload between them, whereby each server process is responsible for a range of object marker values. The pattern matching is based on regular expressions, as follows:

'*'

matches any sequence of characters.

'?' matches any single character.

[SET] matches any characters belonging to the specified set, for example, [abc].

[!SET] matches any characters not belonging to the specified set, for example, [!abc].

[^SET] equivalent to [!SET], for example, [^abc].

A SET, as presented above, is composed of characters and ranges. A range is specified using a hyphen character `-'.

Finally, since each of the characters *?!^-[]\ is special, in the sense that it is interpreted by the pattern matching algorithm; each of them can be preceded by a `\' character to suppress its interpretation.

Examples of patterns are:


hello

matches "hello".

he* matches any text beginning with "he", for example, "he", "help", "hello".

he? matches any three character text beginning with "he", for example, "hec".

[abc] matches "a", "b" or "c".

he[abc] matches "hea", "heb" or "hec".

[a-zA-Z0-9] matches any alphanumeric character.

[!a-zA-Z0-9] matches any non alphanumeric character.

_[gs]et_balance matches _get_balance and _set_balance.

make* matches makeDeposit and makeWithdrawal.

1.2.4 Advanced putit Examples

Examples of putit commands that make use of pattern matching are:

1. putit -marker '*Green' NationalBank -java BankClass

Register a shared server called "NationalBank" on the local host, with the specified class name. However activation will only occur for objects whose marker names match "*Green", for example, College_Green, and all matching activations will go to the same server process. All matching activations from different end-users share the same process.

2. putit -shared -marker '*Green' NationalBank -java BankClass

Equivalent to the (1) above.

3. putit -unshared -marker '*Green' FirstNational -java BankClass

Register an unshared server called "FirstNational" on the local host with the specified class name. However activation will only occur for objects whose marker names match "*Green", and each matching activation for a specific object will go to a unique server process for that particular object. Multiple server processes can result from this registration–one per object with a marker matching the pattern. All matching activations from different end-users share the same process.

4. putit -per-client -unshared -marker '*Green' \
NationalTrust -java BankClass

Register an unshared server called "NationalTrust" on the local host with the specified class name. However activation will only occur for objects whose marker names match "*Green", and each matching activation for a specific object will go to a separate server process for that particular object. Furthermore, each end-user will be bound to a separate server process, even if two or more end-users bind to the same marker. Contrast this to (3) above. The following examples of calls to _bind() illustrate this:

i. principal: chris
     _BankRef b1Ref = Bank._bind(
     		"College_Green:NationalTrust");
    
ii. principal: joan
     _BankRef b2Ref = Bank._bind(
     		"College_Green:NationalTrust"); 
    
iii. principal: chris
     _BankRef b3Ref = Bank._bind(
     		"College_Green:NationalTrust");
    
iv. principal: joe
     _BankRef b4Ref = Bank._bind(
     		"College_Green:NationalTrust");
    
Cases ii and iv, where different end users bind to the same marker, result in new processes being launched. Cases i and iii will share the same process.

5. putit -per-method FirstTrust -method 'make*' -java BankClass

Register a per-method server called "FirstTrust" on the local host with the specified class name. The activation is to occur only if an operation matching the pattern "make*" is being called, for example makeDeposit() or makeWithdrawal(). A separate process is activated for each method call.

6. putit FirstTrust -method 'make*' -java BankClass

Similar to 5) above. If the -method switch is specified, the server is assumed to be a per-method server.

The default settings for putit mean that the command:

is equivalent to any of the following:

If the following two commands are issued:

then server NationalBank can have up to two active processes; one launched for markers beginning with "Green" and the other for markers beginning with "Blue". Such registrations can be used as a means of sharing work between server processes (in this case, between two processes).

1.2.5 Markers, Methods and Patterns

Recall that an Implementation Repository entry may contain a number of activation orders, specifying a marker or method and a launch command associated with that marker or method. For example, each of the following putit commands adds a new activation order to the Implementation Repository entry for the server NationalBank:

Note, however, that if an activation order exists in an Implementation Repository entry for a specific object marker (or method) and another exists for an overlapping set of markers (or methods), then the particular server that is activated for a given object is non-deterministic; that is, no attempt is made to find an entry registered for best or exact match.

1.2.6 Using the Orbix putit Utility to Register OrbixWeb Servers

The standard Orbix daemon process cannot directly invoke the Java interpreter on an OrbixWeb server class. Therefore, servers implemented by Java classes cannot be directly registered using the non-OrbixWeb putit command.

However, this functionality can be imitated using an intermediate executable file which the daemon can launch and which can, in turn, invoke the Java interpreter. Each OrbixWeb installation includes a program which can be used for this purpose; this program is called jrunit and is installed by default in the OrbixWeb bin directory.

To register an OrbixWeb server in the Orbix Implementation Repository, the Orbix putit command (which currently doesn't support the -java switch) should be used as follows:

The following Orbix putit command:

is equivalent to the OrbixWeb putit command:

Note that, if the jrunit command specified in the server launch command is not prefixed by a full path name, then the location of jrunit should be in the environment path setting, as passed to the Orbix daemon at start-up.

1.3 Further Registration Commands

This section details the utility commands other than putit. The full syntax of all utility commands is given in section 1.3.7.

1.3.1 lsit, catit, rmit

The following commands are commonly used to manage Implementation Repository entries created by putit:

lsit

lists entries in an Implementation Repository directory.

catit gets full information about a given Implementation Repository entry.

rmit removes an Implementation Repository entry or activation order. An activation order is the term given to a (marker/method, command/class) pair in an Implementation Repository entry. A given entry may have several activation orders.

Examples of using these commands are:

The rmit command takes the following arguments:

The -v switch outputs the program version information; it is available on all of the utility commands. All of the utility commands also output a summary of their switches if executed without any parameters.

The -marker and -method switches can be used to remove an activation order for an individual object (in the shared or unshared activation modes) or for an individual method (in the per-method call activation mode). A command of the form:

removes all activation orders for that server.

1.3.2 mkdirit

Server names may be hierarchically structured, similar to UNIX file names:

For example, we can make a new registration directory–called banking–and make a registration within it:

Thus banking/Berliner is a valid (hierarchical) server name. It can be used in bind calls such as:

Hierarchical names are extremely useful in structuring the name space of servers in Implementation Repositories.

1.3.3 rmdirit

There is a further UNIX-like command to remove a registration directory:

This takes a -R switch to recursively delete a directory and the Implementation Repository entries and sub-directories within it. The rmdirit command returns an error if it is called without the -R switch on a non-empty registration directory. For example:

1.3.4 psit, killit, pingit

The psit command outputs a list of server processes known to an OrbixWeb daemon. It takes the following arguments:

One line is output for each server process. Each line has the format:

The fields are as follows:

The killit command kills a server process. On UNIX, it uses the SIGTERM signal. It takes the following arguments:

Where there is more than one server process, the marker parameter to killit is used to select between different processes. The marker parameter is required when killing a process in the unshared mode.

The pingit command tries to contact an OrbixWeb daemon, outputting a success or failure message. It takes the following arguments:

1.3.5 chownit

The ownership of Implementation Repository entries and directories can be changed using the chownit command.

The chownit command takes the following arguments:

The -s switch allows the user to change the ownership of an Implementation Repository entry. Only the current owner of an Implementation Repository entry has the right to change its ownership. An example is:

An Implementation Repository directory may have more than one owner. An ownership access control list (ACL) is associated with each directory in the Implementation Repository, and this ACL can be modified to give certain users or groups ownership rights on a directory. The -d switch modifies the ACL on a directory allowing the user to add or remove a user or group from the list of owners of a directory. Only a user on an ownership ACL has the right to modify the ACL. Some examples are:

Note that spaces are significant in this grammar. You cannot type:

OrbixWeb supports the fictitious group all which, when added to an ACL, grants access to all callers. The following command grants all users the ownership rights on directory
banks/commercialBanks:

1.3.6 chmodit

OrbixWeb servers must be registered in the Implementation Repository before OrbixWeb clients can invoke them. By default, only the owner of an Implementation Repository entry can launch or invoke the server registered. However, launch and invoke access control lists (ACLs) are associated with each entry in the Implementation Repository and these ACLs can be modified to give certain users or groups the right to launch or invoke a specific server, or a directory of servers. Access controls may be modified using the chmodit command. Only the current owner of an Implementation Repository entry has the right to change its access controls. The syntax is:

By specifying the l switch, a user or group can be added or removed from the launch ACL. For example, to allow chris to launch the server AIB:

The -a switch specifies that a user or group is to be added to an ACL for a directory of servers. For example, the following command grants chris rights to launch any server in the directory banks/investmentBanks:

By specifying the i switch, a user or group can be added or removed from the invoke ACL. For example, the following command revokes joe's right to invoke all servers in the Implementation Repository directory banks/commercialBanks:

The group all which, when added to an ACL, grants access to all callers. The following command grants all users the right to invoke the server banks/commercialBanks/AIB:

1.3.7 Command Syntax

The utility programs take the following switches

The common switches have the following meanings:

-v

Outputs the program version information; this is available on all of the utility commands,

-R Apply the command recursively to all contained Implementation Repository entries and sub-directories,

-h Indicates which Implementation Repository to use.

Each utility command outputs a summary of its switches if executed without any parameters.



1 Unless a pattern is specified to the -marker switch (see section 1.2.3).



[Roadmap] [Utilities] [Compiling] [Configuration]
[Class Reference] [IR Reference] [Daemon Reference] [IDL Grammar] [System Exceptions]
[Index]