VisiBroker for Java

com.inprise.vbroker.extension
Class CreationImplDef

java.lang.Object
  extended by com.inprise.vbroker.extension.CreationImplDef
All Implemented Interfaces:
java.io.Serializable, IDLEntity

public final class CreationImplDef
extends java.lang.Object
implements IDLEntity

Describes an OAD registration. The OAD uses the information provided here to launch servers for specific object implementations Methods for querying and setting the values for these attributes are provided in this interface.

The Object Activation Daemon (OAD) clients use this interface to list, register, and unregister object implementations. The command line arguments, specified when you use oadutil, are used to set attributes defined in this interface.

The CreationImplDef interface is an IDL struct that provides a set of attributes for a specific object implementation. The attributes are _args, _env, id (for reference data), object_name, _path_name, _policy, and repository_id.

IDL definition

        struct CreationImplDef
                CORBA::RepositoryId repository_id;
                string object_name;
                CORBA::ReferenceData id;
                string path_name;
                CORBA::Policy activation_policy;
                CORBA::StringSequence args;
                CORBA::StringSequence env;
        };
        

Activation policies

The following is a discussion of how the values of a CreationImplDef are used by the OAD when activating servers in response to client requests.

CreationImplDef provides methods that set the server's activation policy. These activation policies only apply to persistent objects, not transient objects.

CreationImplDef activation policies

Policy Description
SHARED_SERVER Multiple clients of a given object share the same implementation. Only one server is activated by an OAD at a particular time.
UNSHARED_SERVER Only one client of a given implementation will ever be bound to the activated server. If multiple clients wish to bind to the same object implementation, a separate server is activated for each client. A server exits when its client application disconnects or exits.

Example

The following example shows how the OAD converts CreationImplDef attributes into executed commands.

To activate the VisiBroker Edition for Java application called com.mycompany.Server with the argument CreditUnion and the System Property DEBUG set to 1, fill out a CreationImplDef with the following attributes:

path_name = "vbj"
        args = ["com.mycompany.Server", "CreditUnion"]
        env = ["DEBUG=1"]

This would correspond to the OAD spawning the following command:

"vbj -DOAoad_uid=<uid> -DOAactivateIOR=<OAD's ior> -DDEBUG=1 \
        com.mycompany.Server CreditUnion"

In addition, the following environment variables would be propagated from the OAD's environment into that of the spawned "vbj" execution:

Environment variables

When the registered Java class is activated by executing the vbj command, the OAD's environment is not automatically passed to the spawned process. If set, the environment variables listed in "Environment variables that are propagated or passed explicitly," will be passed explicitly by the OAD.

All other environment variables must be registered using the env attribute in CreationImplDef.

For activated Java implementations, the environment settings, as recorded in the CreationImplDef env attribute, are propagated in two ways:

Therefore, for spawned Java applications, the registration maps to the following executed command:

vbj -DOAoad_uid=<uid> -DOAactivateIOR=<oad's ior> 
                { -Denv1 ... -DenvN } 
                className { args1 ... argsN }

As a result, the spawned environment contains all the specified environment variables from the implementation definition, as well as definitions for PATH, CLASSPATH, OSAGENT_PORT, and OSAGENT_ADDR, which are taken from the OAD's own environment at startup. As with any OA parameter, those added by the OAD are stripped off during BOA_init and not seen by the client program.

Environment variables that are propagated or passed explicitly

These are the environment variables that are propagated from the OAD's environment into that of the spawned server or, if set, passed explicitly by the OAD:

See Also:
Serialized Form

Field Summary
 Policy activation_policy
          The activation policy for the server.
 java.lang.String[] args
          The arguments that need to be passed to the server program when it is launched.
 java.lang.String[] env
          The environment variables, in the form of name-value pairs.
 byte[] id
          The reference data for the implementation.
 java.lang.String object_name
          The Object ID of the servant.
 java.lang.String path_name
          The path to the executable for the server.
 java.lang.String repository_id
          The repository ID of the object implemented by this server.
 
Constructor Summary
CreationImplDef()
           
CreationImplDef(java.lang.String repository_id, java.lang.String object_name, byte[] id, java.lang.String path_name, Policy activation_policy, java.lang.String[] args, java.lang.String[] env)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

repository_id

public java.lang.String repository_id
The repository ID of the object implemented by this server. This is an attribute. For POA or service registrations, use "*" for the repository ID


object_name

public java.lang.String object_name
The Object ID of the servant. This is an attribute. For POA and service registrations, the object name must be the service name or the full POA name.


id

public byte[] id
The reference data for the implementation. This is an attribute.


path_name

public java.lang.String path_name
The path to the executable for the server. For java registrations, use "vbj". This is an attribute.


activation_policy

public Policy activation_policy
The activation policy for the server. Can be SHARED_SERVER or UNSHARED_SERVER. This is an attribute.


args

public java.lang.String[] args
The arguments that need to be passed to the server program when it is launched. This is an attribute.


env

public java.lang.String[] env
The environment variables, in the form of name-value pairs. The server will be launched with all these environment variables set. Note: when path_name is "vbj", these environment variables will be passed as system properties to the vbj utility.

Constructor Detail

CreationImplDef

public CreationImplDef()

CreationImplDef

public CreationImplDef(java.lang.String repository_id,
                       java.lang.String object_name,
                       byte[] id,
                       java.lang.String path_name,
                       Policy activation_policy,
                       java.lang.String[] args,
                       java.lang.String[] env)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Borland Software Corporation
http://www.borland.com
100 Enterprise Way
Scotts Valley, CA 95066
Voice: (831) 431-1000
pubsweb@borland.com

Read the latest documentation online