Class Utility

java.lang.Object
com.sun.corba.se.impl.util.Utility

public final class Utility extends Object
Handy class full of static functions.
  • Field Details

  • Constructor Details

    • Utility

      public Utility()
  • Method Details

    • autoConnect

      public static Object autoConnect(Object obj, ORB orb, boolean convertToStub)
      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

      public static Tie loadTie(Remote obj)
    • 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

      public static BoxedValueHelper getHelper(Class clazz, String codebase, String repId)
      Get the helper for an IDLValue Throws MARSHAL exception if no helper found.
    • getFactory

      public static ValueFactory getFactory(Class clazz, String codebase, ORB orb, String repId)
      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

      public static Tie getAndForgetTie(Object stub)
    • purgeStubForTie

      public static void purgeStubForTie(Tie tie)
    • purgeTieAndServant

      public static void purgeTieAndServant(Tie tie)
    • stubNameFromRepID

      public static String stubNameFromRepID(String repID)
    • loadStub

      public static Object loadStub(Object narrowFrom, Class<?> narrowTo)
    • loadStubClass

      public static Class loadStubClass(String repID, String remoteCodebase, Class expectedType) throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • stubName

      public static String stubName(String className)
      Create an RMI stub name.
    • dynamicStubName

      public static String dynamicStubName(String className)
    • stubNameForCompiler

      public static String stubNameForCompiler(String className)
    • tieName

      public static String tieName(String className)
      Create an RMI tie name.
    • tieNameForCompiler

      public static String tieNameForCompiler(String className)
    • throwNotSerializableForCorba

      public static void throwNotSerializableForCorba(String className)
      Throws the CORBA equivalent of a java.io.NotSerializableException
    • idlStubName

      public static String idlStubName(String className)
      Create an IDL stub name.
    • printStackTrace

      public static void printStackTrace()
    • readObjectAndNarrow

      public static Object readObjectAndNarrow(InputStream in, Class narrowTo) throws ClassCastException
      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.