Codota Logo
Delegators.getDelegate
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
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

    • Creating JSON documents from java classes using gson
    • getSystemService (Context)
    • getSharedPreferences (Context)
    • onCreateOptionsMenu (Activity)
    • ConnectException (java.net)
      A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
    • URLEncoder (java.net)
      This class is used to encode a string using the format required by application/x-www-form-urlencoded
    • BitSet (java.util)
      This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
    • Calendar (java.util)
      Calendar is an abstract base class for converting between a Date object and a set of integer fields
    • Modifier (javassist)
      The Modifier class provides static methods and constants to decode class and member access modifiers
    • JCheckBox (javax.swing)
    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