home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book Home Java Enterprise in a Nutshell Search this book

Chapter 33. The org.omg.CORBA.portable Package

The org.omg.CORBA.portable package contains interfaces, classes, and exceptions used by the portability layer of the CORBA API. The portability layer provides facilities that allow code to be shared between different ORB providers. Figure 33-1 shows the class hierarchy of this package.

figure

Figure 33-1. The org.omg.CORBA.portable package

ApplicationExceptionJava 1.2
org.omg.CORBA.portableserializable checked

An exception is used by the Delegate and ObjectImpl layer of a stub to indicate that an exception was thrown during a remote method invocation. The ApplicationException provides an org.omg.CORBA.portable.InputStream that reads the marshalled exception object.

public class ApplicationException extends Exception {
// Public Constructors
public ApplicationException (String id, org.omg.CORBA.portable.InputStream ins);
// Public Instance Methods
public String getId ();
public org.omg.CORBA.portable.InputStream getInputStream ();
}

Hierarchy: Object-->Throwable(Serializable)-->Exception-->ApplicationException

Thrown By: Delegate.invoke(), ObjectImpl._invoke()

DelegateJava 1.2
org.omg.CORBA.portable

A Delegate is responsible for implementing all methods on org.omg.CORBA.Object. An Object contains a Delegate and forwards its methods to it. This allows for portability between ORB implementations, since an Object obtained from one ORB can contain a Delegate specific to that ORB, but the Object can still be used within another ORB.

public abstract class Delegate {
// Public Constructors
public Delegate ();
// Public Instance Methods
public abstract Request create_request (org.omg.CORBA.Object obj, org.omg.CORBA.Context ctx, String operation, NVList arg_list, NamedValue result);
public abstract Request create_request (org.omg.CORBA.Object obj, org.omg.CORBA.Context ctx, String operation, NVList arg_list, NamedValue result, ExceptionList exclist, ContextList ctxlist);
public abstract org.omg.CORBA.Object duplicate (org.omg.CORBA.Object obj);
public boolean equals (org.omg.CORBA.Object self, Object obj);
public DomainManager[ ] get_domain_managers (org.omg.CORBA.Object self);
public org.omg.CORBA.Object get_interface_def (org.omg.CORBA.Object self);
public org.omg.CORBA.Policy get_policy (org.omg.CORBA.Object self, int policy_type);
public abstract int hash (org.omg.CORBA.Object obj, int max);
public int hashCode (org.omg.CORBA.Object self);
public org.omg.CORBA.portable.InputStream invoke (org.omg.CORBA.Object self, org.omg.CORBA.portable.OutputStream output) throws ApplicationException, RemarshalException;
public abstract boolean is_a (org.omg.CORBA.Object obj, String repository_id);
public abstract boolean is_equivalent (org.omg.CORBA.Object obj, org.omg.CORBA.Object other);
public boolean is_local (org.omg.CORBA.Object self); constant
public abstract boolean non_existent (org.omg.CORBA.Object obj);
public ORB orb (org.omg.CORBA.Object obj);
public abstract void release (org.omg.CORBA.Object obj);
public void releaseReply (org.omg.CORBA.Object self, org.omg.CORBA.portable.InputStream input);
public abstract Request request (org.omg.CORBA.Object obj, String operation);
public org.omg.CORBA.portable.OutputStream request (org.omg.CORBA.Object self, String operation, boolean responseExpected);
public void servant_postinvoke (org.omg.CORBA.Object self, ServantObject servant); empty
public ServantObject servant_preinvoke (org.omg.CORBA.Object self, String operation, Class expectedType); constant
public org.omg.CORBA.Object set_policy_override (org.omg.CORBA.Object self, org.omg.CORBA.Policy[ ] policies, SetOverrideType set_add);
public String toString (org.omg.CORBA.Object self);
}

Passed To: ObjectImpl._set_delegate(), org.omg.CosNaming._BindingIteratorStub._BindingIteratorStub(), org.omg.CosNaming._NamingContextStub._NamingContextStub()

Returned By: ObjectImpl._get_delegate()

IDLEntityJava 1.2
org.omg.CORBA.portableserializable

This interface marks certain IDL-generated classes. The RMI/IIOP extensions to CORBA look for this marker interface, since it indicates that a Java object being marshalled or unmarshalled has a helper class that can serialize the object.

public abstract interface IDLEntity extends Serializable {
}

Hierarchy: (IDLEntity(Serializable))

Implementations: Any, CompletionStatus, DefinitionKind, IDLType, IRObject, NameValuePair, ServiceDetail, ServiceInformation, SetOverrideType, StructMember, TypeCode, UnionMember, UserException, ValueMember, org.omg.CosNaming.Binding, org.omg.CosNaming.BindingIterator, org.omg.CosNaming.BindingType, org.omg.CosNaming.NameComponent, org.omg.CosNaming.NamingContext, AlreadyBound, CannotProceed, org.omg.CosNaming.NamingContextPackage.InvalidName, NotEmpty, NotFound, NotFoundReason

InputStreamJava 1.2
org.omg.CORBA.portable

An InputStream is used for unmarshalling IDL-generated objects. The InputStream provides a series of read_XXX() methods for unmarshalling basic IDL types.

public abstract class InputStream extends java.io.InputStream {
// Public Constructors
public InputStream ();
// Public Instance Methods
public ORB orb ();
public abstract Any read_any ();
public abstract boolean read_boolean ();
public abstract void read_boolean_array (boolean[ ] value, int offset, int length);
public abstract char read_char ();
public abstract void read_char_array (char[ ] value, int offset, int length);
public org.omg.CORBA.Context read_Context ();
public abstract double read_double ();
public abstract void read_double_array (double[ ] value, int offset, int length);
public java.math.BigDecimal read_fixed ();
public abstract float read_float ();
public abstract void read_float_array (float[ ] value, int offset, int length);
public abstract int read_long ();
public abstract void read_long_array (int[ ] value, int offset, int length);
public abstract long read_longlong ();
public abstract void read_longlong_array (long[ ] value, int offset, int length);
public abstract org.omg.CORBA.Object read_Object ();
public org.omg.CORBA.Object read_Object (Class clz);
public abstract byte read_octet ();
public abstract void read_octet_array (byte[ ] value, int offset, int length);
public abstract short read_short ();
public abstract void read_short_array (short[ ] value, int offset, int length);
public abstract String read_string ();
public abstract TypeCode read_TypeCode ();
public abstract int read_ulong ();
public abstract void read_ulong_array (int[ ] value, int offset, int length);
public abstract long read_ulonglong ();
public abstract void read_ulonglong_array (long[ ] value, int offset, int length);
public abstract short read_ushort ();
public abstract void read_ushort_array (short[ ] value, int offset, int length);
public abstract char read_wchar ();
public abstract void read_wchar_array (char[ ] value, int offset, int length);
public abstract String read_wstring ();
// Public methods overriding InputStream
public int read () throws IOException;
// Deprecated Public Methods
#public abstract org.omg.CORBA.Principal read_Principal ();
}

Hierarchy: Object-->java.io.InputStream-->org.omg.CORBA.portable.InputStream

Passed To: Too many methods to list.

Returned By: Any.create_input_stream(), ApplicationException.getInputStream(), Delegate.invoke(), ObjectImpl._invoke(), org.omg.CORBA.portable.OutputStream.create_input_stream()

InvokeHandlerJava 1.2
org.omg.CORBA.portable

This interface is used during dynamic method invocations. An InvokeHandler is responsible, through its _invoke() method, for finding a named method, reading marshalled arguments from the given org.omg.CORBA.portable.InputStream, and returning the response in the form of an org.omg.CORBA.portable.OutputStream generated from the given ResponseHandler.

public abstract interface InvokeHandler {
// Public Instance Methods
public abstract org.omg.CORBA.portable.OutputStream _invoke (String method, org.omg.CORBA.portable.InputStream input, ResponseHandler handler) throws org.omg.CORBA.SystemException;
}
ObjectImplJava 1.2
org.omg.CORBA.portable

ObjectImpl is the base class for all stub classes; it provides default implementations for the methods declared in the orb.omg.CORBA.Object interface. ObjectImpl contains a Delegate object that acts as a proxy for the Object methods.

public abstract class ObjectImpl implements org.omg.CORBA.Object {
// Public Constructors
public ObjectImpl ();
// Public Instance Methods
public Delegate _get_delegate ();
public abstract String[ ] _ids ();
public org.omg.CORBA.portable.InputStream _invoke (org.omg.CORBA.portable.OutputStream output) throws ApplicationException, RemarshalException;
public boolean _is_local ();
public ORB _orb ();
public void _releaseReply (org.omg.CORBA.portable.InputStream input);
public org.omg.CORBA.portable.OutputStream _request (String operation, boolean responseExpected);
public void _servant_postinvoke (ServantObject servant);
public ServantObject _servant_preinvoke (String operation, Class expectedType);
public void _set_delegate (Delegate delegate);
// Methods implementing Object
public Request _create_request (org.omg.CORBA.Context ctx, String operation, NVList arg_list, NamedValue result);
public Request _create_request (org.omg.CORBA.Context ctx, String operation, NVList arg_list, NamedValue result, ExceptionList exceptions, ContextList contexts);
public org.omg.CORBA.Object _duplicate ();
public DomainManager[ ] _get_domain_managers ();
public org.omg.CORBA.Object _get_interface_def ();
public org.omg.CORBA.Policy _get_policy (int policy_type);
public int _hash (int maximum);
public boolean _is_a (String repository_id);
public boolean _is_equivalent (org.omg.CORBA.Object that);
public boolean _non_existent ();
public void _release ();
public Request _request (String operation);
public org.omg.CORBA.Object _set_policy_override (org.omg.CORBA.Policy[ ] policies, SetOverrideType set_add);
// Public methods overriding Object
public boolean equals (Object obj);
public int hashCode ();
public String toString ();
}

Hierarchy: Object-->ObjectImpl(org.omg.CORBA.Object)

Subclasses: DynamicImplementation, org.omg.CosNaming._BindingIteratorStub, org.omg.CosNaming._NamingContextStub

OutputStreamJava 1.2
org.omg.CORBA.portable

An OutputStream marshals IDL-generated objects. The OutputStream provides a series of write_XXX() methods for marshalling basic IDL types.

public abstract class OutputStream extends java.io.OutputStream {
// Public Constructors
public OutputStream ();
// Public Instance Methods
public abstract org.omg.CORBA.portable.InputStream create_input_stream ();
public ORB orb ();
public abstract void write_any (Any value);
public abstract void write_boolean (boolean value);
public abstract void write_boolean_array (boolean[ ] value, int offset, int length);
public abstract void write_char (char value);
public abstract void write_char_array (char[ ] value, int offset, int length);
public void write_Context (org.omg.CORBA.Context ctx, ContextList contexts);
public abstract void write_double (double value);
public abstract void write_double_array (double[ ] value, int offset, int length);
public void write_fixed (java.math.BigDecimal value);
public abstract void write_float (float value);
public abstract void write_float_array (float[ ] value, int offset, int length);
public abstract void write_long (int value);
public abstract void write_long_array (int[ ] value, int offset, int length);
public abstract void write_longlong (long value);
public abstract void write_longlong_array (long[ ] value, int offset, int length);
public abstract void write_Object (org.omg.CORBA.Object value);
public abstract void write_octet (byte value);
public abstract void write_octet_array (byte[ ] value, int offset, int length);
public abstract void write_short (short value);
public abstract void write_short_array (short[ ] value, int offset, int length);
public abstract void write_string (String value);
public abstract void write_TypeCode (TypeCode value);
public abstract void write_ulong (int value);
public abstract void write_ulong_array (int[ ] value, int offset, int length);
public abstract void write_ulonglong (long value);
public abstract void write_ulonglong_array (long[ ] value, int offset, int length);
public abstract void write_ushort (short value);
public abstract void write_ushort_array (short[ ] value, int offset, int length);
public abstract void write_wchar (char value);
public abstract void write_wchar_array (char[ ] value, int offset, int length);
public abstract void write_wstring (String value);
// Public methods overriding OutputStream
public void write (int b) throws IOException;
// Deprecated Public Methods
#public abstract void write_Principal (org.omg.CORBA.Principal value);
}

Hierarchy: Object-->java.io.OutputStream-->org.omg.CORBA.portable.OutputStream

Passed To: Too many methods to list.

Returned By: Any.create_output_stream(), ORB.create_output_stream(), Delegate.request(), InvokeHandler._invoke(), ObjectImpl._request(), ResponseHandler.{createExceptionReply(), createReply()}

RemarshalExceptionJava 1.2
org.omg.CORBA.portableserializable checked

An exception thrown by the Delegate._invoke() and ObjectImpl.invoke() methods when a marshalling error occurs during the method invocation.

public final class RemarshalException extends Exception {
// Public Constructors
public RemarshalException ();
}

Hierarchy: Object-->Throwable(Serializable)-->Exception-->RemarshalException

Thrown By: Delegate.invoke(), ObjectImpl._invoke()

ResponseHandlerJava 1.2
org.omg.CORBA.portable

A ResponseHandler is responsible for generating an org.omg.CORBA.portable.OutputStream that is used by an object servant to write marshalled method responses (return value or exception).

public abstract interface ResponseHandler {
// Public Instance Methods
public abstract org.omg.CORBA.portable.OutputStream createExceptionReply ();
public abstract org.omg.CORBA.portable.OutputStream createReply ();
}

Passed To: InvokeHandler._invoke()

ServantObjectJava 1.2
org.omg.CORBA.portable

ServantObject is a wrapper for an object that can handle method requests for a remote object. The ObjectImpl class defers method requests to a ServantObject acquired from its internal Delegate.

public class ServantObject {
// Public Constructors
public ServantObject ();
// Public Instance Fields
public Object servant ;
}

Passed To: Delegate.servant_postinvoke(), ObjectImpl._servant_postinvoke()

Returned By: Delegate.servant_preinvoke(), ObjectImpl._servant_preinvoke()

StreamableJava 1.2
org.omg.CORBA.portable

All holder classes extend this interface, which defines methods for marshalling and unmarshalling objects of the type corresponding to the holder class.

public abstract interface Streamable {
// Public Instance Methods
public abstract void _read (org.omg.CORBA.portable.InputStream istream);
public abstract TypeCode _type ();
public abstract void _write (org.omg.CORBA.portable.OutputStream ostream);
}

Implementations: Too many classes to list.

Passed To: Any.insert_Streamable()



Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.