congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Delegators.getDelegate
Code IndexAdd Tabnine to your IDE (free)

How to use
getDelegate
method
in
co.cask.cdap.common.lang.Delegators

Best Java code snippets using co.cask.cdap.common.lang.Delegators.getDelegate (Showing top 3 results out of 315)

origin: cdapio/cdap

/**
 * Finds the {@link MapReduceClassLoader} from the {@link ClassLoader} inside the given {@link Configuration}.
 *
 * @throws IllegalArgumentException if no {@link MapReduceClassLoader} can be found from the {@link Configuration}.
 */
public static MapReduceClassLoader getFromConfiguration(Configuration configuration) {
 return Delegators.getDelegate(configuration.getClassLoader(), MapReduceClassLoader.class);
}
origin: co.cask.cdap/cdap-app-fabric

/**
 * Finds the {@link MapReduceClassLoader} from the {@link ClassLoader} inside the given {@link Configuration}.
 *
 * @throws IllegalArgumentException if no {@link MapReduceClassLoader} can be found from the {@link Configuration}.
 */
public static MapReduceClassLoader getFromConfiguration(Configuration configuration) {
 return Delegators.getDelegate(configuration.getClassLoader(), MapReduceClassLoader.class);
}
origin: cdapio/cdap

@Test
public void testWeakReferenceClassLoader() throws Exception {
 // Creates a jar that has Application class in it.
 Location jar = AppJarHelper.createDeploymentJar(new LocalLocationFactory(TMP_FOLDER.newFolder()),
                         ClassLoaderTest.class);
 // Create a class loader that load from that jar.
 File unpackDir = TMP_FOLDER.newFolder();
 BundleJarUtil.unJar(jar, unpackDir);
 ClassLoader cl = new DirectoryClassLoader(unpackDir, null, "lib");
 // Wrap it with the WeakReference ClassLoader
 ClassLoader classLoader = new WeakReferenceDelegatorClassLoader(cl);
 // Load class from the wrapped ClassLoader, should succeed and should be loaded by the delegating ClassLoader.
 Class<?> cls = classLoader.loadClass(ClassLoaderTest.class.getName());
 Assert.assertSame(cl, cls.getClassLoader());
 Assert.assertSame(cl, Delegators.getDelegate(classLoader, ClassLoader.class));
 // There is no good way to test the GC of the weak reference referent since it depends on GC.
}
co.cask.cdap.common.langDelegatorsgetDelegate

Javadoc

Returns the root delegate object that is not a Delegator in the delegation chain that is assignable to the given type.

Popular methods of Delegators

    Popular in Java

    • Parsing JSON documents to java classes using gson
    • startActivity (Activity)
    • orElseThrow (Optional)
      Return the contained value, if present, otherwise throw an exception to be created by the provided s
    • getApplicationContext (Context)
    • BorderLayout (java.awt)
      A border layout lays out a container, arranging and resizing its components to fit in five regions:
    • File (java.io)
      An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
    • FileNotFoundException (java.io)
      Thrown when a file specified by a program cannot be found.
    • SecureRandom (java.security)
      This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
    • StringTokenizer (java.util)
      Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
    • LoggerFactory (org.slf4j)
      The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
    • Best plugins for Eclipse
    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