congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ReloadingClassLoader
Code IndexAdd Tabnine to your IDE (free)

How to use
ReloadingClassLoader
in
org.apache.wicket.application

Best Java code snippets using org.apache.wicket.application.ReloadingClassLoader (Showing top 20 results out of 315)

origin: apache/wicket

/**
 * Instantiate the reloading class loader
 */
public ReloadingWicketFilter()
{
  // Create a reloading classloader
  reloadingClassLoader = new ReloadingClassLoader(getClass().getClassLoader());
}
origin: apache/wicket

Class<?> clazz = findLoadedClass(name);
  final ClassLoader parent = getParent();
  if (tryClassHere(name))
      clazz = findClass(name);
      watchForModifications(clazz);
  resolveClass(clazz);
origin: apache/wicket

/**
 * Gets a resource from this <code>ClassLoader</class>.  If the
 * resource does not exist in this one, we check the parent.
 * Please note that this is the exact opposite of the
 * <code>ClassLoader</code> spec. We use it to work around inconsistent class loaders from third
 * party vendors.
 * 
 * @param name
 *            of resource
 */
@Override
public final URL getResource(final String name)
{
  URL resource = findResource(name);
  ClassLoader parent = getParent();
  if (resource == null && parent != null)
  {
    resource = parent.getResource(name);
  }
  return resource;
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Create a new reloading ClassLoader from a list of URLs, and initialize the
 * ModificationWatcher to detect class file modifications
 * 
 * @param parent
 *            the parent classloader in case the class file cannot be loaded from the above
 *            locations
 */
public ReloadingClassLoader(ClassLoader parent)
{
  super(new URL[] { }, parent);
  // probably doubles from this class, but just in case
  addClassLoaderUrls(parent);
  for (Iterator<URL> iter = urls.iterator(); iter.hasNext();)
  {
    addURL(iter.next());
  }
  watcher = new ModificationWatcher(pollFrequency);
}
origin: org.ops4j.pax.wicket/pax-wicket-service

  public void onChange()
  {
    // Remove the ModificationWatcher from the current reloading class loader
    reloadingClassLoader.destroy();
    /*
     * Create a new classloader, as there is no way to clear a ClassLoader's cache. This
     * supposes that we don't share objects across application instances, this is almost
     * true, except for Wicket's Session object.
     */
    reloadingClassLoader = new ReloadingClassLoader(getClass().getClassLoader());
    try
    {
      init(filterConfig);
    }
    catch (ServletException e)
    {
      throw new RuntimeException(e);
    }
  }
});
origin: apache/wicket

throws ServletException
reloadingClassLoader.setListener(new IChangeListener<Class<?>>()
    reloadingClassLoader = new ReloadingClassLoader(getClass().getClassLoader());
    try
origin: org.apache.wicket/wicket-core

/**
 * Add all the url locations we can find for the provided class loader
 * 
 * @param loader
 *            class loader
 */
private static void addClassLoaderUrls(ClassLoader loader)
{
  if (loader != null)
  {
    final Enumeration<URL> resources;
    try
    {
      resources = loader.getResources("");
    }
    catch (IOException e)
    {
      throw new RuntimeException(e);
    }
    while (resources.hasMoreElements())
    {
      URL location = resources.nextElement();
      ReloadingClassLoader.addLocation(location);
    }
  }
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Create a new reloading ClassLoader from a list of URLs, and initialize the
 * ModificationWatcher to detect class file modifications
 * 
 * @param parent
 *            the parent classloader in case the class file cannot be loaded from the above
 *            locations
 */
public ReloadingClassLoader(ClassLoader parent)
{
  super(new URL[] {}, parent);
  // probably doubles from this class, but just in case
  addClassLoaderUrls(parent);
  for (Iterator i = urls.iterator(); i.hasNext();)
  {
    addURL((URL)i.next());
  }
  watcher = new ModificationWatcher(pollFrequency);
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

  public void onChange()
  {
    // Remove the ModificationWatcher from the current reloading class loader
    reloadingClassLoader.destroy();
    /*
     * Create a new classloader, as there is no way to clear a ClassLoader's cache. This
     * supposes that we don't share objects across application instances, this is almost
     * true, except for Wicket's Session object.
     */
    reloadingClassLoader = new ReloadingClassLoader(getClass().getClassLoader());
    try
    {
      init(filterConfig);
    }
    catch (ServletException e)
    {
      throw new RuntimeException(e);
    }
  }
});
origin: org.apache.wicket/com.springsource.org.apache.wicket

reloadingClassLoader.setListener(new IChangeListener()
    reloadingClassLoader = new ReloadingClassLoader(getClass().getClassLoader());
    try
origin: apache/wicket

/**
 * Add all the url locations we can find for the provided class loader
 * 
 * @param loader
 *            class loader
 */
private static void addClassLoaderUrls(ClassLoader loader)
{
  if (loader != null)
  {
    final Enumeration<URL> resources;
    try
    {
      resources = loader.getResources("");
    }
    catch (IOException e)
    {
      throw new RuntimeException(e);
    }
    while (resources.hasMoreElements())
    {
      URL location = resources.nextElement();
      ReloadingClassLoader.addLocation(location);
    }
  }
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

Class clazz = findLoadedClass(name);
  final ClassLoader parent = getParent();
  if (tryClassHere(name))
      clazz = findClass(name);
      watchForModifications(clazz);
  resolveClass(clazz);
origin: org.apache.wicket/wicket-core

/**
 * Create a new reloading ClassLoader from a list of URLs, and initialize the
 * ModificationWatcher to detect class file modifications
 * 
 * @param parent
 *            the parent classloader in case the class file cannot be loaded from the above
 *            locations
 */
public ReloadingClassLoader(ClassLoader parent)
{
  super(new URL[] { }, parent);
  // probably doubles from this class, but just in case
  addClassLoaderUrls(parent);
  for (URL url : urls)
  {
    addURL(url);
  }
  Duration pollFrequency = Duration.seconds(3);
  watcher = new ModificationWatcher(pollFrequency);
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Gets a resource from this <code>ClassLoader</class>.  If the
 * resource does not exist in this one, we check the parent.
 * Please note that this is the exact opposite of the
 * <code>ClassLoader</code> spec.  We use it to work around
 * inconsistent class loaders from third party vendors.
 *
 * @param name of resource
 */
public final URL getResource(final String name)
{
  URL resource = findResource(name);
  ClassLoader parent = getParent();
  if (resource == null && parent != null)
  {
    resource = parent.getResource(name);
  }
  return resource;
}
origin: org.apache.wicket/wicket-core

  @Override
  public void onChange(Class<?> clz)
  {
    destroy();
    // Remove the ModificationWatcher from the current reloading class loader
    reloadingClassLoader.destroy();
    /*
     * Create a new classloader, as there is no way to clear a ClassLoader's cache. This
     * supposes that we don't share objects across application instances, this is almost
     * true, except for Wicket's Session object.
     */
    reloadingClassLoader = new ReloadingClassLoader(getClass().getClassLoader());
    try
    {
      init(filterConfig);
    }
    catch (ServletException e)
    {
      throw new RuntimeException(e);
    }
  }
});
origin: org.apache.wicket/wicket-core

throws ServletException
reloadingClassLoader.setListener(new IChangeListener<Class<?>>()
    reloadingClassLoader = new ReloadingClassLoader(getClass().getClassLoader());
    try
origin: org.apache.wicket/wicket-core

/**
 * Instantiate the reloading class loader
 */
public ReloadingWicketFilter()
{
  // Create a reloading classloader
  reloadingClassLoader = new ReloadingClassLoader(getClass().getClassLoader());
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Add all the url locations we can find for the provided class loader
 * 
 * @param loader
 *            class loader
 */
private static void addClassLoaderUrls(ClassLoader loader)
{
  if (loader != null)
  {
    final Enumeration resources;
    try
    {
      resources = loader.getResources("");
    }
    catch (IOException e)
    {
      throw new RuntimeException(e);
    }
    while (resources.hasMoreElements())
    {
      URL location = (URL)resources.nextElement();
      ReloadingClassLoader.addLocation(location);
    }
  }
}
origin: org.apache.wicket/wicket-core

Class<?> clazz = findLoadedClass(name);
  final ClassLoader parent = getParent();
  if (tryClassHere(name))
      clazz = findClass(name);
      watchForModifications(clazz);
  resolveClass(clazz);
origin: apache/wicket

/**
 * Create a new reloading ClassLoader from a list of URLs, and initialize the
 * ModificationWatcher to detect class file modifications
 * 
 * @param parent
 *            the parent classloader in case the class file cannot be loaded from the above
 *            locations
 */
public ReloadingClassLoader(ClassLoader parent)
{
  super(new URL[] { }, parent);
  // probably doubles from this class, but just in case
  addClassLoaderUrls(parent);
  for (URL url : urls)
  {
    addURL(url);
  }
  Duration pollFrequency = Duration.seconds(3);
  watcher = new ModificationWatcher(pollFrequency);
}
org.apache.wicket.applicationReloadingClassLoader

Javadoc

Custom ClassLoader that reverses the classloader lookups, and that is able to notify a listener when a class file is changed.

Most used methods

  • <init>
    Create a new reloading ClassLoader from a list of URLs, and initialize the ModificationWatcher to de
  • addClassLoaderUrls
    Add all the url locations we can find for the provided class loader
  • addLocation
    Add the location of a directory containing class files
  • addURL
  • destroy
    Remove the ModificationWatcher from the current reloading class loader
  • findClass
  • findLoadedClass
  • findResource
  • getParent
  • resolveClass
  • setListener
    Sets the listener that will be notified when a class changes
  • tryClassHere
  • setListener,
  • tryClassHere,
  • watchForModifications,
  • excludePattern,
  • getLocations,
  • getPatterns,
  • includePattern

Popular in Java

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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