org.glassfish.pfl.dynamic.copyobject.impl
Class ClassCopierFactoryPipelineImpl

java.lang.Object
  extended by org.glassfish.pfl.dynamic.copyobject.impl.ClassCopierFactoryPipelineImpl
All Implemented Interfaces:
ClassCopierFactory, PipelineClassCopierFactory

public class ClassCopierFactoryPipelineImpl
extends Object
implements PipelineClassCopierFactory

A factory used for creating ClassCopier instances. An instance of this factory can be created and customized to handle special copying semantics for certain classes. This maintains a cache of ClassCopiers, so that a ClassCopier is never created more than once for a particular class.


Constructor Summary
ClassCopierFactoryPipelineImpl()
           
 
Method Summary
 ClassCopier getClassCopier(Class<?> cls)
          Analyze cls to determine the appropriate ClassCopier and return the ClassCopier instance.
 ClassCopier lookupInCache(Class<?> cls)
          Look for cls only in the cache; do not create a ClassCopier if there isn't one already in the cache.
 boolean reflectivelyCopyable(Class<?> cls)
          Added this method so reflective copier could check if serializable object contains a transient field of specific type.
 void registerImmutable(Class<?> cls)
          Register an immutable class, so that it will not be copied, but just passed by reference.
 void setSpecialClassCopierFactory(ClassCopierFactory ccf)
          Set a special ClassCopierFactory to handle some application specific needs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassCopierFactoryPipelineImpl

public ClassCopierFactoryPipelineImpl()
Method Detail

reflectivelyCopyable

public boolean reflectivelyCopyable(Class<?> cls)
Description copied from interface: PipelineClassCopierFactory
Added this method so reflective copier could check if serializable object contains a transient field of specific type.

Specified by:
reflectivelyCopyable in interface PipelineClassCopierFactory

lookupInCache

public ClassCopier lookupInCache(Class<?> cls)
Look for cls only in the cache; do not create a ClassCopier if there isn't one already in the cache.

Specified by:
lookupInCache in interface PipelineClassCopierFactory

registerImmutable

public final void registerImmutable(Class<?> cls)
Register an immutable class, so that it will not be copied, but just passed by reference.

Specified by:
registerImmutable in interface PipelineClassCopierFactory

setSpecialClassCopierFactory

public void setSpecialClassCopierFactory(ClassCopierFactory ccf)
Set a special ClassCopierFactory to handle some application specific needs.

Specified by:
setSpecialClassCopierFactory in interface PipelineClassCopierFactory

getClassCopier

public ClassCopier getClassCopier(Class<?> cls)
                           throws ReflectiveCopyException
Analyze cls to determine the appropriate ClassCopier and return the ClassCopier instance. Will only create a ClassCopier for a given Class once.

Specified by:
getClassCopier in interface ClassCopierFactory
Throws:
ReflectiveCopyException


Copyright © 2013 Oracle. All Rights Reserved.