Netscape Internet Service Broker for Java: Reference Guide, Version 1.0

[Contents] [Previous] [Next]

Chapter 5
Dynamic Interfaces and Classes

This chapter describes the dynamic interfaces and classes in the org.omg.CORBA package. InputStream and OutputStream are in the org.omg.CORBA.portable package. All of these interfaces and classes are used in the creation of client requests and object implementations at run time.

Any

abstract public class Any
The Any class is used to store a value of any type in a type-safe manner and is used in the Dynamic Invocation Interface. The type stored in an Any is defined by a TypeCode. An Any can store a String, an interface object, or even another Any. Methods are provided to set and retrieve the contained value. By default, an Any contains a NULL until it is initialized.

To create an Any, use ORB.create_any.

A Holder version of this class is also provided.

Methods

create_input_stream
create_output_stream
equal
read_value
type
write_value
Extraction Methods
Insertion Methods

public abstract InputStream create_input_stream()
This static method creates an input stream containing the Any's value.

public abstract OutputStream create_output_stream()
This static method creates an empty output stream.

abstract public boolean equal(Any rhs)
This method returns true if the value contained by the Any is the same as the value contained by the specified Any. Otherwise, false is returned.

Parameter Description
rhs

The Any whose value is compared with the value of this Any.

public abstract void read_value(InputStream input, Typecode type)
This method reads an Any's value from an input stream, given a type code. Only the Any's value is read. To read the complete Any definition, including the type code, use org.omg.CORBA.portable.InputStream.read_any.

Parameter Description
input

A GIOP input stream from which the specified type's value will be read.

type

The type to read from the input stream. See "TCKind" for the possible values for this parameter.

abstract public TypeCode type()
This method returns the TypeCode representing the type contained in this Any.

abstract public void type(org.omg.CORBA.TypeCode type)
This method sets the TypeCode representing the type contained in this Any.

Parameter Description
type

The type to be set for this Any object. See "TCKind" for the possible values for this parameter.

public abstract void write_value(OutputStream output)
This method writes an Any's value to an output stream. Only the Any's value is written. To write the complete Any definition, including the type code, use org.omg.CORBA.portable.OutputStream.write_any.

Parameter Description
output

A GIOP output stream into which the specified type's value will be written.

Extraction Methods

A set of methods is provided which return the type contained in this Any. The following code listing shows the name of each of the extraction methods. A BAD_PARAM exception is raised if the value contained in this Any does not match the expected return type for the extraction method used.

The extraction methods offered by the Any class.

abstract public org.omg.CORBA.Any    extract_any()
abstract public boolean              extract_boolean()
abstract public char                 extract_char()
abstract public double               extract_double()
abstract public float                extract_float()
abstract public int                  extract_long()
abstract public byte                 extract_octet()
abstract public long                 extract_longlong()
abstract public org.omg.CORBA.Object extract_Object()
abstract public byte                 extract_octet()
abstract public org.omg.CORBA.Principal extract_Principal()
abstract public short                extract_short()
abstract public String               extract_string()
abstract public org.omg.CORBA.TypeCode extract_TypeCode()
abstract public int                  extract_ulong()
abstract public long                 extract_ulonglong()
abstract public short                extract_ushort()
abstract public char                 extract_wchar()
abstract public String               extract_wstring()

Insertion Methods

A set of methods is provided that copies a particular type of value to this Any. The following code example shows the list of methods provided for inserting various types. With one exception, all of the methods accept a single parameter that represents the type to be inserted.

ContextList

public class ContextList extends Object
A ContextList maintains a modifiable list of context strings used. To create an instance of ContextList, use create_context_list() provided by org.omg.CORBA.ORB.

IDL Definition

    interface ContextList {
      void
add(in String ctx);
      readonly attribute unsigned long count;
      ::CORBA::Context item(in unsigned long index) raises(::CORBA::Bounds);
      void remove(in unsigned long index) raises(::CORBA::Bounds);
    };

Methods

public abstract void add(String ctx)
This method adds a string to the context list.

Parameter Description
ctx

The name of the context list.

public abstract int count()
This method returns the number of elements in the context list.

public abstract Context item(int index) throws org.omg.CORBA.Bounds
This method returns an item in the context list. Bounds is raised if index number is not valid.

Parameter Description
index

The index number of the item.

public abstract void remove(int index) throws org.omg.CORBA.Bounds
This method deletes an item from the context list. Bounds is raised if index number is not valid.

Parameter Description
index

The index number of the item.

DynamicImplementation

abstract public class DynamicImplementation extends org.omg.CORBA.portable.Skeleton
The DynamicImplementation is an abstract class that provides a way to deliver requests from an ORB to any object implementation, even object implementations that do not have compile-time knowledge of the type of the objects they are implementing. This differs with the type-specific, IDL-based skeletons; however, they both serve the same function. The DynamicImplementation implements all requests on a particular object by having the ORB invoke an upcall to the implementation via the invoke method.

The ORB upcalls to the DynamicImplementation, passing a ServerRequest object. The ServerRequest pseudo object captures the explicit state of a request for the DynamicImplementation.

Methods

DynamicImplementation
invoke

protected DynamicImplementation(String object_name, String repository_id)
This constructor assumes that the interface has no other derived interfaces. If the interface has base interfaces, use the other constructor.

Parameter Description
object_name

The name of the instance. If null, the instance is transient (anonymous).

repository_id

The interface's repository identifier.

protected DynamicImplementation(String object_name, String[] repository_ids)

Parameter Description
object_name

The name of the instance. If null, the instance is transient (anonymous).

repository_id

An array of repository identifiers, one for each interface. The most derived interface should be element zero in the array.

abstract public void invoke(ServerRequest request)
This method provides the functionality of the server.

Parameter Description
request

A description of the request which the server is to perform.

Environment

public abstract class Environment extends Object
The Environment interface encapsulates an exception. It is used in conjunction with the dynamic invocation interface to provide a place for exceptions raised by asynchronous DII requests. To create an instance of Environment, use create_environment() provided by org.omg.CORBA.ORB.

Methods

clear
exception

public abstract void clear()
This method clears any Exception that may have been raised in the current Environment. This is the same as setting the exception to null.

public abstract void exception(java.lang.Exception exception)
This method sets the current exception. When setting, any previously stored exception will be lost.

Parameter Description
exception

The exception to be set for the current Environment.

public abstract Exception exception()
This method returns the current Exception set for this Environment. If no Exception has been set, NULL is returned.

ExceptionList

public class ExceptionList extends Object
An ExceptionList is used in the DII (Dynamic Invocation Interface) to describe exceptions that can be raised by IDL operations. It maintains a modifiable list of type codes. To create an instance of ExceptionList, use create_exception_list() provided by org.omg.CORBA.ORB.

IDL definition

   interface ExceptionList {
      void
add(in CORBA::TypeCode exc);
      readonly attribute unsigned long count;
      CORBA::TypeCode item(in unsigned long index) raises(CORBA::Bounds);
      void remove(in unsigned long index) raises(CORBA::Bounds);
    };

Methods

public abstract void add(TypeCode exc)
This method adds a type code to the exception list.

Parameter Description
exc

The exception to add to the list.

public abstract int count()
This method returns the number of items in the exception list.

public abstract TypeCode item(int index) throws org.omg.CORBA.Bounds
This method returns an item from the list. Bounds is raised if the index number is not valid.

Parameter Description
index

The index number of the item to be returned.

public abstract void remove(int index) throws org.omg.CORBA.Bounds
This method removes an item from the exception list. Bounds is raised if the index number specified is not valid.

Parameter Description
index

The index number of the item to be removed from the list.

InputStream

public interface InputStream
The interface represents an Internet Inter-ORB Protocol input stream. Objects of this type are created with the ORB.create_input_stream method. All bytes written to an output stream can be read using the input stream methods. Several methods are provided for reading various data types. See also ORB.create_input_stream and ORB.create_output_stream.

Methods

The methods shown below are provided for reading data from an InputStream object. Each method returns a particular data type. See also read_estruct and read_byte_array.

The read methods offered by the InputStream class.

   public abstract boolean read_boolean();
   public abstract char read_char();
   public abstract char read_wchar();
   public abstract byte read_octet();
   public abstract short read_short();
   public abstract short read_ushort();
   public abstract int read_long();
   public abstract int read_ulong();
   public abstract long read_longlong();
   public abstract long read_ulonglong();
   public abstract float read_float();
   public abstract double read_double();
   public abstract String read_string();
   public abstract String read_wstring();
   public abstract void read_boolean_array(boolean[] value,
                                               int offset, int length);
   public abstract void read_char_array(char[] value,
                                               int offset, int length);
   public abstract void read_wchar_array(char[] value,
                                               int offset, int length);
   public abstract void read_octet_array(byte[] value,
                                                   int offset, int length);
   public abstract void read_short_array(short[] value,
                                               int offset, int length);
   public abstract void read_ushort_array(short[] value,
                                               int offset, int length);
   public abstract void read_long_array(int[] value,
                                               int offset, int length);
   public abstract void read_ulong_array(int[] value,
                                               int offset,
public Object     read_estruct(String expected_type)
This method reads an IDL extensible struct.

Parameter Description
expected_type

The expected type of the object being read.

public byte[]     read_byte_array(int length)
This method reads an array of bytes from the stream.

Parameter Description
length

The number of bytes to be read.

NamedValue

public class NamedValue extends Object
The NamedValue interface is used by a client, alone or in conjunction with the NVList, to specify parameters and return values for a Dynamic Invocation Interface request. In Java, it includes a name, a value (such as an Any), and an integer representing a set of flags. NamedValue items can only be created using the NVList interface. To create an instance of NamedValue, use create_named_value(String name, Any value, int flags) provided by org.omg.CORBA.ORB.

IDL Definition

interface NamedValue {
      readonly attribute ::CORBA::Flags flags;
      readonly attribute ::CORBA::Identifier name;
      readonly attribute any value;
    };

Methods

public abstract int flags()
This method returns the flags for this NamedValue. See ARG_IN, ARG_INOUT, and ARG_OUT for more information.

public abstract String name()
This method returns the name set for this NamedValue. If no name has been set, NULL is returned.

public abstract org.omg.CORBA.Any value()
This method returns an Any representing the current value set for this NamedValue. If no value has been set, NULL is returned. The value may be modified in place.

NVList

public interface NVList
The NVList interface contains a set of NamedValue objects. It is used by client applications to pass the parameters associated with a Dynamic Invocation Interface request and in the context routines to describe context values. In Java, it maintains a modifiable list of NamedValues. You can create an NVList using the ORB.create_list method.

IDL Definition

interface NVList {
  void add(in CORBA::Flags flags);
  void add_item(in CORBA::Identifier name,
                in CORBA::Flags flags);
  void add_value(in CORBA::Identifier name,
                 in any value,
                 in CORBA::Flags flags);
  unsigned long count();
  CORBA::NamedValue item(in unsigned long index);
  void remove(in unsigned long index);
};

Methods

public abstract org.omg.CORBA.NamedValue add(int flags)
This method adds a NamedValue item to this list without initializing the name or the value associated with the item.

Parameter Description
flags

The mode of the parameter to be added. Allowed values are in, inout, or out.

public abstract org.omg.CORBA.NamedValue add_item(String item_name, int flags)
This method adds a NamedValue item to this list without initializing the value associated with the item.

Parameter Description
item_name

The name of the item to be added.

flags

The mode of the parameter to be added. Allowed values are in, inout, or out.

public abstract org.omg.CORBA.NamedValue add_value(String item_name,
                                org.omg.CORBA.Any value,
                                int flags)
This method adds a NamedValue item to this NVList that has the specified name, value and flags.

Parameter Description
item_name

The name of the NamedValue to be added.

value

The value of the NamedValue, represented as an Any.

flags

The mode of the parameter to be added.

public abstract int count()
This method returns the number of NamedValue items in this NVList.

public abstract org.omg.CORBA.NamedValue item(int index) throws org.omg.CORBA.Bounds
This method returns the NamedValue item from this list that has the specified index. If the index is out of range, Bounds is raised.

Parameter Description
index

The index of the NamedValue to be returned from this list.

public void remove(int index)
This method removes the NamedValue with the specified index from this list. If the index is out of range, Bounds is raised.

Parameter Description
index

The index of the NamedValue item to be removed from this list.

OutputStream

public interface OutputStream
The interface represents an Internet Inter-ORB Protocol output stream. Objects of this type are created by using the ORB.create_output_stream method. All bytes written to an output stream will be available to be read using the input stream. Several methods are provided for writing various data types.

See also ORB.create_input_stream and ORB.create_output_stream.

Methods

The methods shown below are provided to write a particular type to this OutputStream. See also write_estruct and write_byte_array.

The write methods offered by the OutputStream class.

public abstract InputStream create_input_stream();
public abstract void write_boolean  (boolean value);
public abstract void write_char     (char value);
public abstract void write_wchar    (char value);
public abstract void write_octet    (byte value);
public abstract void write_short    (short value);
public abstract void write_ushort   (short value);
public abstract void write_long     (int value);
public abstract void write_ulong    (int value);
public abstract void write_longlong (long value);
public abstract void write_ulonglong (long value);
public abstract void write_float     (float value);
public abstract void write_double    (double value);
public abstract void write_string    (String value);
public abstract void write_wstring   (String value);
public abstract void write_boolean_array (boolean[] value, int offset, int length);
public abstract void write_char_array    (char[] value, int offset, int length);
public abstract void write_wchar_array   (char[] value, int offset, int length);
public abstract void write_octet_array   (byte[] value, int offset, int length);
public abstract void write_short_array   (short[] value, int offset, int length);
public abstract void write_ushort_array  (short[] value, int offset, int length);
public abstract void write_long_array    (int[] value, int offset, int length);
public abstract void write_ulong_array   (int[] value, int offset, int length);
public abstract void write_longlong_array (long[] value, int offset, int length);
public abstract void write_ulonglong_array (long[] value, int offset, int length);
public abstract void write_float_array   (float[] value, int offset, int length);
public abstract void write_double_array  (double[] value, int offset, int length);
public abstract void write_Object        (org.omg.CORBA.Object value);
public abstract void write_TypeCode      (org.omg.CORBA.TypeCode value);
public abstract void write_any           (org.omg.CORBA.Any value);
public abstract void write_Principal     (org.omg.CORBA.Principal value);
The write methods offered by the OutputStream class.

public org.omg.CORBA.Object write_estruct(org.omg.CORBA.Object value, String expected_type)
This method writes an Object to the stream as an IDL extensible struct. Extensible structures are used to represent objects that are passed as operation request parameters.

Parameter Description
value

The extensible struct to be written to the stream.

expected_type

The type of object to be written.

public byte[]     write_byte_array(byte value[], int offset, int length)
This method writes an array of bytes to the stream.

Parameter Description
value

The array of bytes to be written.

offset

The position within the stream where the bytes are to be written. This value is usually set to zero.

length

The number of bytes to be written.

Request

public interface Request
The Request interface represents a dynamic invocation request and provides methods for initializing and sending the request as well as receiving the response. An operation request may be sent synchronously, asynchronously, or as a oneway request for which no response is expected. Replies to invocations can be polled or obtained synchronously. The ORB interface can also be used to perform multiple simultaneous invocations, allowing for higher parallelism and reduced latency.

This object includes the following state information:

See the Object methods _create_request and _request for information on creating a Request.

IDL Definition

interface Request {
      readonly attribute CORBA::NVList arguments;
      readonly attribute CORBA::ContextList contexts;
      attribute CORBA::Context ctx;
      readonly attribute CORBA::Environment env;
      readonly attribute CORBA::ExceptionList exceptions;
      readonly attribute CORBA::Identifier operation;
      readonly attribute CORBA::NamedValue result;
      readonly attribute CORBA::Object target;
      any add_in_arg();
      any add_inout_arg();
      any add_out_arg();
      any add_named_in_arg(in string name);
      any add_named_inout_arg(in string name);
      any add_named_out_arg(in string name);
      void get_response();
      void invoke();
      boolean poll_response();
      any return_value();
      void send_oneway();
      void send_deferred();
      void set_return_type(in ::CORBA::TypeCode tc);
};

Methods

public abstract Any add_in_arg()
Adds an IN argument to the request.

public abstract Any add_inout_arg()
Adds an INOUT argument to the request.

public abstract Any add_named_in_arg(String name)
Adds a named IN argument to the request.

Parameter Description
name

The name of the argument associated with this request.

public abstract Any add_named_inout_arg(String name)
Adds a named INOUT argument to the request.

Parameter Description
name

The name of the argument associated with this request.

public abstract Any add_named_out_arg(String name)
Adds a named OUT argument to the request.

Parameter Description
name

The name of the argument associated with this request.

public abstract Any add_out_arg()
Adds a OUT argument to the request.

public abstract org.omg.CORBA.NVList arguments()
This method returns the list of arguments for this request. These arguments must be initialized prior to sending the request.

public abstract String[] contexts()
This method returns the context list. The list will be empty if the operation does not specify any contexts.

public abstract org.omg.CORBA.Context ctx()
This method returns the context list associated with this request. See "ContextList" for more information.

public abstract void ctx(org.omg.CORBA.Context ctx)
This method sets the context for this request. See also: ORB.get_default_context.

Parameter Description
ctx

The Context.

public abstract org.omg.CORBA.Environment env()
This method returns the Environment in which the request is invoked. Exceptions raised by the server will be put into the request's Environment. For more information, see "Environment."

public abstract org.omg.CORBA.ExceptionList exceptions()
This method returns the list of user exception type codes. The list will be empty if no user exceptions can be raised by the operation.

public abstract void get_response()
This blocking method waits for the results of a dynamic invocation request that was sent with the send_deferred method. All inout, out, and return values are updated by this method.

The nonblocking poll_response method can be used to determine if a response is available prior to invoking this method.

public abstract void invoke()
This method sends the request and blocks waiting for a response. If the client does not wish to block waiting for a response, the send_deferred method may be used instead.

public abstract String operation()
This method returns the name of the operation, or method name, associated with this request.

public abstract boolean poll_response()
This method returns true if a response for an request is currently available. Otherwise, false is returned. This method is used after the send_deferred method has been invoked and prior to invoking the get_response method, which actually reads in the result values. See also: poll_next_response.

public abstract org.omg.CORBA.NamedValue result()
This method returns the results, or return value, of the request. If the type of the result is not specified, the type defaults to void. If the return type is not void, the type must be initialized prior to sending the request.

public abstract Any return_value()
This method gets the return value of the operation as an Any.

public abstract void send_deferred()
This method sends this request, but does not block awaiting a response. The poll_response and get_response methods are then used to determine when a response is available and to receive the results. See also: send_multiple_requests_deferred.

public abstract void send_oneway()
This nonblocking method sends this request as a oneway request. Oneway requests do not result in a response from the server to which they are sent. See also: send_multiple_requests_oneway.

public abstract void set_return_type(TypeCode tc)
This method sets the type expected to be returned prior to invoking the operation.

Parameter Description
tc

The type code to set.

public abstract org.omg.CORBA.Object target()
This method returns the target Object to which this request will be sent. The target Object is specified when the Request is created, using the Object method _create_request.

ServerRequest

abstract public interface ServerRequest
The ServerRequest interface, an important element when using dynamic skeletons, represents a request received by a server from a client. It provides methods for obtaining the Context, operation name, and operation parameters as well as a method for reflecting any Exception that may be raised during the processing of the request. This interface works with DynamicImplementation to provide dynamic skeletons. For more information about using dynamic skeletons, see "The Dynamic Skeleton Interface" chapter in the Netscape Internet Service Broker for Java Programmer's Guide.

IDL definition

    interface ServerRequest {
      readonly attribute ::CORBA::Context ctx;
      readonly attribute ::CORBA::Identifier op_name;
      void except(in any except);
      void params(in ::CORBA::NVList params);
      void result(in any result);
    };

Methods

abstract public org.omg.CORBA.Context ctx()
This method returns the current Context associated with this ServerRequest.

abstract public void except(org.omg.CORBA.Any except)
This method is used by the server to set an Exception that occurred during the processing of the request so that it may be reflected to the client.

Parameter Description
exception

The Exception that was raised.

abstract public String op_name()
This method returns the operation name associated with this request.

abstract public void params(org.omg.CORBA.NVList params)
This method sets the parameters for this operation request. For more information about using this method, see "The Dynamic Skeleton Interface" chapter in the Netscape Internet Service Broker for Java Programmer's Guide.

Parameter Description
params

The NVList where the parameters are to be stored.

abstract public void result(org.omg.CORBA.Any result)
This method sets the result for this operation request.

Parameter Description
result

The result to be set for the operation request.

TCKind

public class TCKind extends Object
The TCKind class contains the constants used in conjunction with TypeCode objects, which define an object's type. There are a set of integer constants, prefixed with tk_, that correspond to all the possible type codes. For example, the type code for float is TCKind.tk_float.

There is also a set of TypeCode globals, prefixed with tc_, that correspond to the built-in type codes. The TypeCode constant for float, for example, is TCKind.tc_float. A complete list of the enums for TCKind can be found in the IDL definition. For each enum, an equivalent TypeCode and TCKind constant exists. See also the methods value and from_int.

Helper and Holder versions of this class are also provided.

See also ORB.create_list.

IDL Definition

enum TCKind {
    tk_null, tk_void,
    tk_short, tk_long, tk_ushort, tk_ulong,
    tk_float, tk_double, tk_boolean, tk_char,
    tk_octet, tk_any, tk_TypeCode, tk_Principal, tk_objref,
    tk_struct, tk_union, tk_enum, tk_string,
    tk_sequence, tk_array, tk_alias, tk_except,
    tk_longlong, tk_ulonglong, tk_longdouble,
    tk_wchar, tk_wstring, tk_fixed
};

Methods

from_int
value

public static TCKind from_int(int value)
This method returns an enum instance for the value you specify. For more information about enum mapping, see "Enum."

Parameter Description
value

The enum value.

public int value()
This method returns an integral value representing the constant.

TypeCode

public interface TypeCode
The TypeCode interface describes the various types that are defined in IDL and allows them to be created and examined at run time. Type codes are most often used to describe the type of value being stored in an Any object. Type codes may also be passed as parameters to method invocations.

Type codes are created using the various ORB.create_<type>_tc methods. Type codes for all built-in types are provided by the TCKind class.

A Holder version of this class is also provided.

IDL Definition

interface TypeCode {
      exception Bounds {};
      exception BadKind {};

      CORBA::TypeCode
content_type() raises(CORBA::TypeCode::BadKind);
      long default_index() raises(CORBA::TypeCode::BadKind);
      CORBA::TypeCode discriminator_type() raises(CORBA::TypeCode::BadKind);
      boolean equal(in CORBA::TypeCode tc);
      CORBA::RepositoryId id() raises(CORBA::TypeCode::BadKind);
      CORBA::TCKind kind();
      unsigned long length() raises(CORBA::TypeCode::BadKind);
      unsigned long member_count()  raises(CORBA::TypeCode::BadKind);
      any member_label(in unsigned long index) 
                        raises(CORBA::TypeCode::BadKind, CORBA::TypeCode::Bounds);
      CORBA::Identifier member_name(in unsigned long index)
                        raises(CORBA::TypeCode::BadKind, CORBA::TypeCode::Bounds);
      CORBA::TypeCode member_type(in unsigned long index) 
                        raises(CORBA::TypeCode::BadKind, CORBA::TypeCode::Bounds);
      CORBA::Identifier name() raises(CORBA::TypeCode::BadKind);
      long param_count();
      any parameter(in long index) raises(CORBA::TypeCode::Bounds);
};

Methods

public org.omg.CORBA.TypeCode content_type()
                throws org.omg.CORBA._TypeCode.BadKind
This method returns the type code of the element contained in container types or an aliased type. This method is only valid for the following type codes.

A BAD_PARAM exception will be raised if the type code is not one of these types.

public int default_index() throws org.omg.CORBA._TypeCode.BadKind
This method returns the default index of a union. This method is only valid for type codes tk_union, otherwise a BAD_PARAM exception will be raised.

public TypeCode discriminator_type() throws org.omg.CORBA._TypeCode.BadKind
This method returns the type code of the discriminator of a union. This method is only valid when invoked on object with the type code of tk_union, otherwise a BAD_PARAM exception will be raised.

public boolean equal(org.omg.CORBA.TypeCode tc)
This method returns true if this object is equivalent to tc. Otherwise, false is returned. Type equivalence is determined by the structure of the types, not by their names. Two structures with the same fields, declared in the same order, are considered type equivalent.

Parameter Description
tc

The TypeCode to be compared to this object's type.

public String id() throws org.omg.CORBA._TypeCode.BadKind
This method returns the repository identifier of the type code. This string is used by IDL to define the type.

public TCKind kind()
This method returns the kind of type associated with this type code. Type codes kind constants are defined by TCKind.

public int length() throws org.omg.CORBA._TypeCode.BadKind
This method returns the number of elements contained by the type. Zero is returned if the number of elements is unbounded, such as for strings and sequences. This method is only valid for the following type codes.

A BAD_PARAM exception will be raised if the type code is not one of these types.

public int member_count() throws org.omg.CORBA._TypeCode.BadKind
This method returns the number of members contained by the type. This method is only valid for the following type codes.

A BAD_PARAM exception will be raised if the type code is not one of these types.

public Any member_label(int index)
                    throws org.omg.CORBA._TypeCode.BadKind,
                           org.omg.CORBA._TypeCode.Bounds
This method returns the label of the case statement associated with the member that has the specified index. This method is only valid for the type code tk_union, otherwise a BAD_PARAM exception will be raised. If the index is out of the bounds of the String, a Bounds exception will be raised.

Parameter Description
index

The index of the member whose label is to be returned.

public String member_name(int index)
                    throws org.omg.CORBA._TypeCode.BadKind,
                           org.omg.CORBA._TypeCode.Bounds
This method returns the name of the member that has the specified index. This method is only valid for the following type codes:

A BAD_PARAM exception will be raised if the type code is not one of these types. If the index is out of the bounds of the String, a Bounds exception will be raised.

Parameter Description
index

The index of the member whose name is to be returned.

public org.omg.CORBA.TypeCode member_type(int index)
                     throws org.omg.CORBA._TypeCode.BadKind,
                            org.omg.CORBA._TypeCode.Bounds
This method returns the type code of the member that has the specified index. This method is only valid for the following type codes:

A BAD_PARAM exception will be raised if the type code is not one of these types. If the index is out of the bounds of the String, a Bounds exception will be raised.

Parameter Description
index

The index of the member whose type code is to be returned.

public String name() throws org.omg.CORBA._TypeCode.BadKind
This method returns the unscoped type name. This method is only valid for the following type codes.

A BAD_PARAM exception will be raised if the type code is not one of these types.

public long param_count()
This method returns the number of parameters for the method.

public any parameter(in long index) raises(CORBA::TypeCode::Bounds)
This method returns the parameter at the specified index. An exception is raised if the index is out of bounds.

UnknownUserException

public class UnknownUserException extends org.omg.CORBA.UserException
When a client issues a DII request and a user exception is raised, the specific exception cannot be reflected to the client. This exception is used instead.


[Contents] [Previous] [Next]

Last Updated: 02/04/98 14:19:37


Copyright © 1997 Netscape Communications Corporation

Any sample code included above is provided for your use on an "AS IS" basis, under the Netscape License Agreement - Terms of Use