Codota Logo
Enhancer$EnhancerFactoryData.setThreadCallbacks
Code IndexAdd Codota to your IDE (free)

How to use
setThreadCallbacks
method
in
org.springframework.cglib.proxy.Enhancer$EnhancerFactoryData

Best Java code snippets using org.springframework.cglib.proxy.Enhancer$EnhancerFactoryData.setThreadCallbacks (Showing top 3 results out of 315)

  • Common ways to obtain Enhancer$EnhancerFactoryData
private void myMethod () {
Enhancer$EnhancerFactoryData e =
  • Codota IconClass generatedClass;Class[] primaryConstructorArgTypes;new EnhancerFactoryData(generatedClass, primaryConstructorArgTypes, classOnly)
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-framework

/**
 * Creates proxy instance for given argument types, and assigns the callbacks.
 * Ideally, for each proxy class, just one set of argument types should be used,
 * otherwise it would have to spend time on constructor lookup.
 * Technically, it is a re-implementation of {@link Enhancer#createUsingReflection(Class)},
 * with "cache {@link #setThreadCallbacks} and {@link #primaryConstructor}"
 * @param argumentTypes constructor argument types
 * @param arguments constructor arguments
 * @param callbacks callbacks to set for the new instance
 * @return newly created proxy
 * @see #createUsingReflection(Class)
 */
public Object newInstance(Class[] argumentTypes, Object[] arguments, Callback[] callbacks) {
  setThreadCallbacks(callbacks);
  try {
    // Explicit reference equality is added here just in case Arrays.equals does not have one
    if (primaryConstructorArgTypes == argumentTypes ||
        Arrays.equals(primaryConstructorArgTypes, argumentTypes)) {
      // If we have relevant Constructor instance at hand, just call it
      // This skips "get constructors" machinery
      return ReflectUtils.newInstance(primaryConstructor, arguments);
    }
    // Take a slow path if observing unexpected argument types
    return ReflectUtils.newInstance(generatedClass, argumentTypes, arguments);
  }
  finally {
    // clear thread callbacks to allow them to be gc'd
    setThreadCallbacks(null);
  }
}
origin: org.springframework/spring-core

/**
 * Creates proxy instance for given argument types, and assigns the callbacks.
 * Ideally, for each proxy class, just one set of argument types should be used,
 * otherwise it would have to spend time on constructor lookup.
 * Technically, it is a re-implementation of {@link Enhancer#createUsingReflection(Class)},
 * with "cache {@link #setThreadCallbacks} and {@link #primaryConstructor}"
 * @param argumentTypes constructor argument types
 * @param arguments constructor arguments
 * @param callbacks callbacks to set for the new instance
 * @return newly created proxy
 * @see #createUsingReflection(Class)
 */
public Object newInstance(Class[] argumentTypes, Object[] arguments, Callback[] callbacks) {
  setThreadCallbacks(callbacks);
  try {
    // Explicit reference equality is added here just in case Arrays.equals does not have one
    if (primaryConstructorArgTypes == argumentTypes ||
        Arrays.equals(primaryConstructorArgTypes, argumentTypes)) {
      // If we have relevant Constructor instance at hand, just call it
      // This skips "get constructors" machinery
      return ReflectUtils.newInstance(primaryConstructor, arguments);
    }
    // Take a slow path if observing unexpected argument types
    return ReflectUtils.newInstance(generatedClass, argumentTypes, arguments);
  }
  finally {
    // clear thread callbacks to allow them to be gc'd
    setThreadCallbacks(null);
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

/**
 * Creates proxy instance for given argument types, and assigns the callbacks.
 * Ideally, for each proxy class, just one set of argument types should be used,
 * otherwise it would have to spend time on constructor lookup.
 * Technically, it is a re-implementation of {@link Enhancer#createUsingReflection(Class)},
 * with "cache {@link #setThreadCallbacks} and {@link #primaryConstructor}"
 * @param argumentTypes constructor argument types
 * @param arguments constructor arguments
 * @param callbacks callbacks to set for the new instance
 * @return newly created proxy
 * @see #createUsingReflection(Class)
 */
public Object newInstance(Class[] argumentTypes, Object[] arguments, Callback[] callbacks) {
  setThreadCallbacks(callbacks);
  try {
    // Explicit reference equality is added here just in case Arrays.equals does not have one
    if (primaryConstructorArgTypes == argumentTypes ||
        Arrays.equals(primaryConstructorArgTypes, argumentTypes)) {
      // If we have relevant Constructor instance at hand, just call it
      // This skips "get constructors" machinery
      return ReflectUtils.newInstance(primaryConstructor, arguments);
    }
    // Take a slow path if observing unexpected argument types
    return ReflectUtils.newInstance(generatedClass, argumentTypes, arguments);
  }
  finally {
    // clear thread callbacks to allow them to be gc'd
    setThreadCallbacks(null);
  }
}
org.springframework.cglib.proxyEnhancer$EnhancerFactoryDatasetThreadCallbacks

Popular methods of Enhancer$EnhancerFactoryData

  • <init>
  • newInstance
    Creates proxy instance for given argument types, and assigns the callbacks. Ideally, for each proxy

Popular in Java

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now