Package com.esotericsoftware.kryo.util

Examples of com.esotericsoftware.kryo.util.DefaultClassResolver


*/
public class GarbageCollectionTest extends TestCase {

  public void testDefaultStreamFactory () {
    final DefaultStreamFactory strongRefToStreamFactory = new DefaultStreamFactory();
    Kryo kryo = new Kryo(new DefaultClassResolver(), new MapReferenceResolver(), strongRefToStreamFactory);
    WeakReference<Kryo> kryoWeakRef = new WeakReference<Kryo>(kryo);
    kryo = null; // remove strong ref, now kryo is only weak-reachable
    reclaim(kryoWeakRef);
  }
View Full Code Here


    reclaim(kryoWeakRef);
  }

  public void testFastestStreamFactory () {
    final FastestStreamFactory strongRefToStreamFactory = new FastestStreamFactory();
    Kryo kryo = new Kryo(new DefaultClassResolver(), new MapReferenceResolver(), strongRefToStreamFactory);
    WeakReference<Kryo> kryoWeakRef = new WeakReference<Kryo>(kryo);
    kryo = null; // remove strong ref, now kryo is only weak-reachable
    reclaim(kryoWeakRef);
  }
View Full Code Here

  private IdentityMap originalToCopy;
  private Object needsCopyReference;

  /** Creates a new Kryo with a {@link DefaultClassResolver} and a {@link MapReferenceResolver}. */
  public Kryo () {
    this(new DefaultClassResolver(), new MapReferenceResolver());
  }
View Full Code Here

  }

  /** Creates a new Kryo with a {@link DefaultClassResolver}.
   * @param referenceResolver May be null to disable references. */
  public Kryo (ReferenceResolver referenceResolver) {
    this(new DefaultClassResolver(), referenceResolver);
  }
View Full Code Here

    protected void beforeTest() {
        _kryo = createKryo();
    }

    private Kryo createKryo() {
        final DefaultClassResolver classResolver = new DefaultClassResolver() {
            @Override
            protected Class<?> getTypeByName(final String className) {
                if (className.indexOf(CGLibProxySerializer.DEFAULT_NAMING_MARKER) > 0) {
                    return CGLibProxySerializer.CGLibProxyMarker.class;
                }
View Full Code Here

  private IdentityMap originalToCopy;
  private Object needsCopyReference;

  /** Creates a new Kryo with a {@link DefaultClassResolver} and a {@link MapReferenceResolver}. */
  public Kryo () {
    this(new DefaultClassResolver(), new MapReferenceResolver());
  }
View Full Code Here

  }

  /** Creates a new Kryo with a {@link DefaultClassResolver}.
   * @param referenceResolver May be null to disable references. */
  public Kryo (ReferenceResolver referenceResolver) {
    this(new DefaultClassResolver(), referenceResolver);
  }
View Full Code Here

  private StreamFactory streamFactory;

  /** Creates a new Kryo with a {@link DefaultClassResolver} and a {@link MapReferenceResolver}. */
  public Kryo () {
    this(new DefaultClassResolver(), new MapReferenceResolver(), new DefaultStreamFactory());
  }
View Full Code Here

  }

  /** Creates a new Kryo with a {@link DefaultClassResolver}.
   * @param referenceResolver May be null to disable references. */
  public Kryo (ReferenceResolver referenceResolver) {
    this(new DefaultClassResolver(), referenceResolver, new DefaultStreamFactory());
  }
View Full Code Here

  private IdentityMap originalToCopy;
  private Object needsCopyReference;

  /** Creates a new Kryo with a {@link DefaultClassResolver} and a {@link MapReferenceResolver}. */
  public Kryo () {
    this(new DefaultClassResolver(), new MapReferenceResolver());
  }
View Full Code Here

TOP

Related Classes of com.esotericsoftware.kryo.util.DefaultClassResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.