|
VisiBroker for Java |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.inprise.vbroker.extension.CreationImplDef
public final class CreationImplDef
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
.
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; };
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. |
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:
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:
vbj
command's environment-D
arguments to the Java virtual machine)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.
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:
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 |
---|
public java.lang.String repository_id
public java.lang.String object_name
public byte[] id
public java.lang.String path_name
public Policy activation_policy
public java.lang.String[] args
public java.lang.String[] env
Constructor Detail |
---|
public 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 |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |