Tabnine Logo
DefaultClassResolver.getTypeByName
Code IndexAdd Tabnine to your IDE (free)

How to use
getTypeByName
method
in
com.esotericsoftware.kryo.util.DefaultClassResolver

Best Java code snippets using com.esotericsoftware.kryo.util.DefaultClassResolver.getTypeByName (Showing top 4 results out of 315)

origin: magro/memcached-session-manager

  @Override
  protected Class<?> getTypeByName(final String className) {
    if (className.indexOf(CGLibProxySerializer.DEFAULT_NAMING_MARKER) > 0) {
      return CGLibProxyMarker.class;
    }
    return super.getTypeByName(className);
  }
}
origin: com.esotericsoftware/kryo

protected Registration readName (Input input) {
  int nameId = input.readVarInt(true);
  if (nameIdToClass == null) nameIdToClass = new IntMap();
  Class type = nameIdToClass.get(nameId);
  if (type == null) {
    // Only read the class name the first time encountered in object graph.
    String className = input.readString();
    type = getTypeByName(className);
    if (type == null) {
      try {
        type = Class.forName(className, false, kryo.getClassLoader());
      } catch (ClassNotFoundException ex) {
        if (WARN) warn("kryo", "Unable to load class " + className + " with kryo's ClassLoader. Retrying with current..");
        try {
          type = Class.forName(className);
        } catch (ClassNotFoundException e) {
          throw new KryoException("Unable to find class: " + className, ex);
        }
      }
      if (nameToClass == null) nameToClass = new ObjectMap();
      nameToClass.put(className, type);
    }
    nameIdToClass.put(nameId, type);
    if (TRACE) trace("kryo", "Read class name: " + className);
  } else {
    if (TRACE) trace("kryo", "Read class name reference " + nameId + ": " + className(type));
  }
  return kryo.getRegistration(type);
}
origin: com.esotericsoftware/kryo-shaded

protected Registration readName (Input input) {
  int nameId = input.readVarInt(true);
  if (nameIdToClass == null) nameIdToClass = new IntMap();
  Class type = nameIdToClass.get(nameId);
  if (type == null) {
    // Only read the class name the first time encountered in object graph.
    String className = input.readString();
    type = getTypeByName(className);
    if (type == null) {
      try {
        type = Class.forName(className, false, kryo.getClassLoader());
      } catch (ClassNotFoundException ex) {
        if (WARN) warn("kryo", "Unable to load class " + className + " with kryo's ClassLoader. Retrying with current..");
        try {
          type = Class.forName(className);
        } catch (ClassNotFoundException e) {
          throw new KryoException("Unable to find class: " + className, ex);
        }
      }
      if (nameToClass == null) nameToClass = new ObjectMap();
      nameToClass.put(className, type);
    }
    nameIdToClass.put(nameId, type);
    if (TRACE) trace("kryo", "Read class name: " + className);
  } else {
    if (TRACE) trace("kryo", "Read class name reference " + nameId + ": " + className(type));
  }
  return kryo.getRegistration(type);
}
origin: com.esotericsoftware.kryo/kryo

protected Registration readName (Input input) {
  int nameId = input.readVarInt(true);
  if (nameIdToClass == null) nameIdToClass = new IntMap();
  Class type = nameIdToClass.get(nameId);
  if (type == null) {
    // Only read the class name the first time encountered in object graph.
    String className = input.readString();
    type = getTypeByName(className);
    if (type == null) {
      try {
        type = Class.forName(className, false, kryo.getClassLoader());
      } catch (ClassNotFoundException ex) {
        throw new KryoException("Unable to find class: " + className, ex);
      }
      if (nameToClass == null) nameToClass = new ObjectMap();
      nameToClass.put(className, type);
    }
    nameIdToClass.put(nameId, type);
    if (TRACE) trace("kryo", "Read class name: " + className);
  } else {
    if (TRACE) trace("kryo", "Read class name reference " + nameId + ": " + className(type));
  }
  return kryo.getRegistration(type);
}
com.esotericsoftware.kryo.utilDefaultClassResolvergetTypeByName

Popular methods of DefaultClassResolver

  • <init>
  • readName
  • register
  • writeName
  • getRegistration
  • writeClass

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • startActivity (Activity)
  • compareTo (BigDecimal)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now