Class CopyobjectDefaults


  • public abstract class CopyobjectDefaults
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopier referenceObjectCopier  
      private static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory referenceObjectCopierFactory  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CopyobjectDefaults()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory getReferenceObjectCopierFactory()
      Obtain the reference object "copier".
      static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory makeFallbackObjectCopierFactory​(org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory f1, org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory f2)
      Create a fallback copier factory from the two ObjectCopierFactory arguments.
      static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory makeJavaStreamObjectCopierFactory​(ORB orb)  
      static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory makeOldReflectObjectCopierFactory​(ORB orb)
      Obtain the old version of the reflective copier factory.
      static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory makeORBStreamObjectCopierFactory​(ORB orb)
      Obtain the ORB stream copier factory.
      static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory makeReflectObjectCopierFactory​(ORB orb)
      Obtain the new reflective copier factory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • referenceObjectCopier

        private static final org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopier referenceObjectCopier
      • referenceObjectCopierFactory

        private static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory referenceObjectCopierFactory
    • Constructor Detail

      • CopyobjectDefaults

        private CopyobjectDefaults()
    • Method Detail

      • makeORBStreamObjectCopierFactory

        public static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory makeORBStreamObjectCopierFactory​(ORB orb)
        Obtain the ORB stream copier factory. Note that this version behaves differently than the others: each ObjectCopier produced by the factory only preserves aliasing within a single call to copy. The others copiers all preserve aliasing across all calls to copy (on the same ObjectCopier instance).
        Parameters:
        orb - ORB to use for remote instances
        Returns:
        CopierFactory
      • makeJavaStreamObjectCopierFactory

        public static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory makeJavaStreamObjectCopierFactory​(ORB orb)
      • getReferenceObjectCopierFactory

        public static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory getReferenceObjectCopierFactory()
        Obtain the reference object "copier". This does no copies: it just returns whatever is passed to it.
        Returns:
        the reference copier
      • makeFallbackObjectCopierFactory

        public static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory makeFallbackObjectCopierFactory​(org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory f1,
                                                                                                                   org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory f2)
        Create a fallback copier factory from the two ObjectCopierFactory arguments. This copier makes an ObjectCopierFactory that creates instances of a fallback copier that first tries an ObjectCopier created from f1, then tries one created from f2, if the first throws a ReflectiveCopyException.
        Parameters:
        f1 - Factory to try first
        f2 - Factory to try second
        Returns:
        CopierFactory
      • makeOldReflectObjectCopierFactory

        public static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory makeOldReflectObjectCopierFactory​(ORB orb)
        Obtain the old version of the reflective copier factory. This is provided only for benchmarking purposes.
        Parameters:
        orb - ORB to use for remote instances
        Returns:
        CopierFactory
      • makeReflectObjectCopierFactory

        public static org.glassfish.pfl.dynamic.copyobject.spi.ObjectCopierFactory makeReflectObjectCopierFactory​(ORB orb)
        Obtain the new reflective copier factory. This is 3-4 times faster than the stream copier, and about 10% faster than the old reflective copier. It should normally be used with a fallback copier, as there are some classes that simply cannot be copied reflectively.
        Parameters:
        orb - ORB to use for remote instances
        Returns:
        CopierFactory