Package com.sun.corba.se.impl.util
Class Utility
java.lang.Object
com.sun.corba.se.impl.util.Utility
Handy class full of static functions.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectautoConnect(Object obj, ORB orb, boolean convertToStub) Ensure that stubs, ties, and implementation objects are 'connected' to the runtime.static voidstatic StringdynamicStubName(String className) static TiegetAndForgetTie(Object stub) static ValueFactorygetFactory(Class clazz, String codebase, ORB orb, String repId) Get the factory for an IDLValue Throws MARSHAL exception if no factory found.static BoxedValueHelperGet the helper for an IDLValue Throws MARSHAL exception if no helper found.static StringidlStubName(String className) Create an IDL stub name.static ClassloadClassForClass(String className, String remoteCodebase, ClassLoader loader, Class relatedType, ClassLoader relatedTypeClassLoader) static RemoteloadStub(Tie tie, PresentationManager.StubFactory stubFactory, String remoteCodebase, boolean onlyMostDerived) static Objectstatic ClassloadStubClass(String repID, String remoteCodebase, Class expectedType) static Tiestatic voidstatic voidpurgeStubForTie(Tie tie) static voidpurgeTieAndServant(Tie tie) static ObjectreadAbstractAndNarrow(InputStream in, Class narrowTo) Read an abstract interface type from the input stream and narrow it to the desired type.static ObjectreadObjectAndNarrow(InputStream in, Class narrowTo) Read an object reference from the input stream and narrow it to the desired type.static StringCreate an RMI stub name.static StringstubNameForCompiler(String className) static StringstubNameFromRepID(String repID) static voidthrowNotSerializableForCorba(String className) Throws the CORBA equivalent of a java.io.NotSerializableExceptionstatic StringCreate an RMI tie name.static StringtieNameForCompiler(String className)
-
Field Details
-
STUB_PREFIX
- See Also:
-
RMI_STUB_SUFFIX
- See Also:
-
DYNAMIC_STUB_SUFFIX
- See Also:
-
IDL_STUB_SUFFIX
- See Also:
-
TIE_SUFIX
- See Also:
-
-
Constructor Details
-
Utility
public Utility()
-
-
Method Details
-
autoConnect
Ensure that stubs, ties, and implementation objects are 'connected' to the runtime. Converts implementation objects to a type suitable for sending on the wire.- Parameters:
obj- the object to connect.orb- the ORB to connect to if obj is exported to IIOP.convertToStub- true if implementation types should be converted to Stubs rather than just org.omg.CORBA.Object.- Returns:
- the connected object.
- Throws:
NoSuchObjectException- if obj is an implementation which has not been exported.
-
loadTie
-
clearCaches
public static void clearCaches() -
loadClassForClass
public static Class loadClassForClass(String className, String remoteCodebase, ClassLoader loader, Class relatedType, ClassLoader relatedTypeClassLoader) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
getHelper
Get the helper for an IDLValue Throws MARSHAL exception if no helper found. -
getFactory
Get the factory for an IDLValue Throws MARSHAL exception if no factory found. -
loadStub
public static Remote loadStub(Tie tie, PresentationManager.StubFactory stubFactory, String remoteCodebase, boolean onlyMostDerived) -
getAndForgetTie
-
purgeStubForTie
-
purgeTieAndServant
-
stubNameFromRepID
-
loadStub
-
loadStubClass
public static Class loadStubClass(String repID, String remoteCodebase, Class expectedType) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
stubName
Create an RMI stub name. -
dynamicStubName
-
stubNameForCompiler
-
tieName
Create an RMI tie name. -
tieNameForCompiler
-
throwNotSerializableForCorba
Throws the CORBA equivalent of a java.io.NotSerializableException -
idlStubName
Create an IDL stub name. -
printStackTrace
public static void printStackTrace() -
readObjectAndNarrow
Read an object reference from the input stream and narrow it to the desired type.- Parameters:
in- the stream to read from.- Throws:
ClassCastException- if narrowFrom cannot be cast to narrowTo.
-
readAbstractAndNarrow
public static Object readAbstractAndNarrow(InputStream in, Class narrowTo) throws ClassCastException Read an abstract interface type from the input stream and narrow it to the desired type.- Parameters:
in- the stream to read from.- Throws:
ClassCastException- if narrowFrom cannot be cast to narrowTo.
-