Package com.sun.corba.se.impl.orbutil
Class ORBUtility
java.lang.Object
com.sun.corba.se.impl.orbutil.ORBUtility
Handy class full of static functions that don't belong in util.Utility for pure ORB reasons.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intbytesToInt(byte[] array, int offset) Unmarshal a byte array to an integer.static StringclassNameOf(String repositoryId) Get the class name corresponding to a particular repository Id.static intcompareVersion(int[] v1, int[] v2) Compare two version arrays.static intcompareVersion(String v1, String v2) Compare two version strings.static String[]concatenateStringArrays(String[] arr1, String[] arr2) static IORconnectAndGetIOR(ORB orb, Object obj) Obtains an IOR for the object reference obj, first connecting it to the ORB if necessary.static ValueHandlerReturn default ValueHandlerstatic voidstatic voidvoidstatic voidstatic voiddprintTrace(Object obj, String msg) static SystemExceptionstatic Stringstatic bytegetEncodingVersion(ORB orb, IOR ior) static IORThis method obtains an IOR from a CORBA object reference.static byteReturns the maximum stream format version supported by our ValueHandler.static StringgetThreadName(Thread thr) static inthexOf(char x) Converts an Ascii Character into Hexadecimal digitstatic voidinsertSystemException(SystemException ex, Any any) Static method for writing a CORBA standard exception to an Any.static voidintToBytes(int value, byte[] array, int offset) Marshal an integer to a byte array.static booleanisForeignORB(ORB orb) Returns true if it was accurately determined that the remote ORB is a foreign (non-JavaSoft) ORB.static booleanisPrintable(char c) static booleanisSystemException(String repositoryId) Return true if this repositoryId is a SystemException.static CorbaClientDelegatemakeClientDelegate(IOR ior) static ObjectmakeObjectReference(IOR ior) This method is used to create untyped object references.static Stringstatic int[]parseVersion(String version) Parse a version string such as "1.1.6" or "jdk1.2fcs" into a version array of integers {1, 1, 6} or {1, 2}.static SystemExceptionStatic method for reading a CORBA standard exception from a stream.static StringrepositoryIdOf(String name) Get the repository id corresponding to a particular class.static voidthrowNotSerializableForCorba(String className) Throws the CORBA equivalent of a java.io.NotSerializableException Duplicated from util/Utility for Pure ORB reasons.static voidwriteSystemException(SystemException ex, OutputStream strm) Static method for writing a CORBA standard exception to a stream.
-
Method Details
-
insertSystemException
Static method for writing a CORBA standard exception to an Any.- Parameters:
any- The Any to write the SystemException into.
-
extractSystemException
-
createValueHandler
Return default ValueHandler -
isForeignORB
Returns true if it was accurately determined that the remote ORB is a foreign (non-JavaSoft) ORB. Note: If passed the ORBSingleton, this will return false. -
bytesToInt
public static int bytesToInt(byte[] array, int offset) Unmarshal a byte array to an integer. Assume the bytes are in BIGENDIAN order. i.e. array[offset] is the most-significant-byte and array[offset+3] is the least-significant-byte.- Parameters:
array- The array of bytes.offset- The offset from which to start unmarshalling.
-
intToBytes
public static void intToBytes(int value, byte[] array, int offset) Marshal an integer to a byte array. The bytes are in BIGENDIAN order. i.e. array[offset] is the most-significant-byte and array[offset+3] is the least-significant-byte.- Parameters:
array- The array of bytes.offset- The offset from which to start marshalling.
-
hexOf
public static int hexOf(char x) Converts an Ascii Character into Hexadecimal digit -
writeSystemException
Static method for writing a CORBA standard exception to a stream.- Parameters:
strm- The OutputStream to use for marshaling.
-
readSystemException
Static method for reading a CORBA standard exception from a stream.- Parameters:
strm- The InputStream to use for unmarshaling.
-
classNameOf
Get the class name corresponding to a particular repository Id. This is used by the system to unmarshal (instantiate) the appropriate exception class for an marshaled as the value of its repository Id.- Parameters:
repositoryId- The repository Id for which we want a class name.
-
isSystemException
Return true if this repositoryId is a SystemException.- Parameters:
repositoryId- The repository Id to check.
-
getEncodingVersion
- Returns:
- the Java serialization encoding version.
-
repositoryIdOf
Get the repository id corresponding to a particular class. This is used by the system to write the appropriate repository id for a system exception.- Parameters:
name- The class name of the system exception.
-
parseVersion
Parse a version string such as "1.1.6" or "jdk1.2fcs" into a version array of integers {1, 1, 6} or {1, 2}. A string of "n." or "n..m" is equivalent to "n.0" or "n.0.m" respectively. -
compareVersion
public static int compareVersion(int[] v1, int[] v2) Compare two version arrays. Return 1, 0 or -1 if v1 is greater than, equal to, or less than v2. -
compareVersion
Compare two version strings. Return 1, 0 or -1 if v1 is greater than, equal to, or less than v2. -
getThreadName
-
dprint
-
dprint
-
dprint
-
dprintTrace
-
dprint
-
concatenateStringArrays
-
throwNotSerializableForCorba
Throws the CORBA equivalent of a java.io.NotSerializableException Duplicated from util/Utility for Pure ORB reasons. There are two reasons for this: 1) We can't introduce dependencies on the util version from outside of the io/util packages since it will not exist in the pure ORB build running on JDK 1.3.x. 2) We need to pick up the correct minor code from OMGSystemException. -
getMaxStreamFormatVersion
public static byte getMaxStreamFormatVersion()Returns the maximum stream format version supported by our ValueHandler. -
makeClientDelegate
-
makeObjectReference
This method is used to create untyped object references. -
getIOR
This method obtains an IOR from a CORBA object reference. It will return null if obj is a local object, a null object, or an object implemented by a different ORB. It will throw BAD_OPERATION if obj is an unconnected RMI-IIOP object.- Returns:
- IOR the IOR that represents this objref. This will never be null.
- Throws:
BAD_OPERATION- (from oi._get_delegate) if obj is a normal objref, but does not have a delegate set.BAD_PARAM- if obj is a local object, or else was created by a foreign ORB.
-
connectAndGetIOR
Obtains an IOR for the object reference obj, first connecting it to the ORB if necessary.- Returns:
- IOR the IOR that represents this objref. This will never be null.
- Throws:
BAD_OPERATION- if the object could not be connected, if a connection attempt was needed.BAD_PARAM- if obj is a local object, or else was created by a foreign ORB.
-
operationNameAndRequestId
-
isPrintable
public static boolean isPrintable(char c) -
getClassSecurityInfo
-