org.xwiki.rendering.internal.macro.script
Class DefaultAttachmentClassLoaderFactory

java.lang.Object
  extended by org.xwiki.rendering.internal.macro.script.DefaultAttachmentClassLoaderFactory
All Implemented Interfaces:
AttachmentClassLoaderFactory

@Component
public class DefaultAttachmentClassLoaderFactory
extends java.lang.Object
implements AttachmentClassLoaderFactory

Supports the following syntax for JARs attached to wiki pages: attach:(wiki):(space).(page)@(attachment).

Since:
2.0.1
Version:
$Id$

Constructor Summary
DefaultAttachmentClassLoaderFactory()
           
 
Method Summary
 ExtendedURLClassLoader createAttachmentClassLoader(java.lang.String jarURLs, java.lang.ClassLoader parent)
          
 void extendAttachmentClassLoader(java.lang.String jarURLs, ExtendedURLClassLoader source)
          Augment the passed classloader with the JARs definitions passed as parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAttachmentClassLoaderFactory

public DefaultAttachmentClassLoaderFactory()
Method Detail

createAttachmentClassLoader

public ExtendedURLClassLoader createAttachmentClassLoader(java.lang.String jarURLs,
                                                          java.lang.ClassLoader parent)
                                                   throws java.lang.Exception

Specified by:
createAttachmentClassLoader in interface AttachmentClassLoaderFactory
Parameters:
jarURLs - the comma-separated lists of URLs pointing to the JARs that should be made visible in the classloader.
parent - the parent classloader in which to look first for a resource/class
Returns:
the classloader in which the passed JARs are visible
Throws:
java.lang.Exception - in case of an error, for example if an attachment cannot be loaded
See Also:
AttachmentClassLoaderFactory.createAttachmentClassLoader(String, ClassLoader)

extendAttachmentClassLoader

public void extendAttachmentClassLoader(java.lang.String jarURLs,
                                        ExtendedURLClassLoader source)
                                 throws java.lang.Exception
Augment the passed classloader with the JARs definitions passed as parameter.

Specified by:
extendAttachmentClassLoader in interface AttachmentClassLoaderFactory
Parameters:
jarURLs - the comma-separated lists of URLs pointing to the JARs that should be made visible in the classloader.
source - the classloader to augment
Throws:
java.lang.Exception - in case of an error, for example if an attachment cannot be loaded
See Also:
AttachmentClassLoaderFactory.extendAttachmentClassLoader(String, ExtendedURLClassLoader)


Copyright © 2004-2011 XWiki. All Rights Reserved.