org.apache.servicemix.common.xbean
Class ClassLoaderXmlPreprocessor

java.lang.Object
  extended by org.apache.servicemix.common.xbean.ClassLoaderXmlPreprocessor
All Implemented Interfaces:
org.apache.xbean.spring.context.SpringXmlPreprocessor

public class ClassLoaderXmlPreprocessor
extends java.lang.Object
implements org.apache.xbean.spring.context.SpringXmlPreprocessor

An advanced xml preprocessor that will create a default class loader for the SU if none is configured.

Author:
gnodet, jbonofre

Field Summary
static java.lang.String CLASSPATH_XML
           
static java.lang.String LIB_DIR
           
 
Constructor Summary
ClassLoaderXmlPreprocessor(java.io.File root)
           
ClassLoaderXmlPreprocessor(java.io.File root, ServiceMixComponent component)
           
 
Method Summary
protected  java.lang.ClassLoader getClassLoader(org.apache.xbean.spring.context.SpringApplicationContext applicationContext, org.springframework.beans.factory.xml.XmlBeanDefinitionReader reader, org.w3c.dom.Document document)
           
protected  java.net.URL[] getDefaultLocations()
           
protected  java.util.List<java.net.URL> getFileResources(java.lang.String location)
           Get the URLs for a file: protocol based location.
protected  java.util.List<java.net.URL> getJarResources(java.lang.String location)
           Get the URLs for a jar: protocol based location.
protected  java.lang.ClassLoader getParentClassLoader(org.apache.xbean.spring.context.SpringApplicationContext applicationContext)
           
protected  java.util.List<java.net.URL> getResources(java.lang.String location)
           Get the URLs for a classpath location.
 void preprocess(org.apache.xbean.spring.context.SpringApplicationContext applicationContext, org.springframework.beans.factory.xml.XmlBeanDefinitionReader reader, org.w3c.dom.Document document)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSPATH_XML

public static final java.lang.String CLASSPATH_XML
See Also:
Constant Field Values

LIB_DIR

public static final java.lang.String LIB_DIR
See Also:
Constant Field Values
Constructor Detail

ClassLoaderXmlPreprocessor

public ClassLoaderXmlPreprocessor(java.io.File root)

ClassLoaderXmlPreprocessor

public ClassLoaderXmlPreprocessor(java.io.File root,
                                  ServiceMixComponent component)
Method Detail

preprocess

public void preprocess(org.apache.xbean.spring.context.SpringApplicationContext applicationContext,
                       org.springframework.beans.factory.xml.XmlBeanDefinitionReader reader,
                       org.w3c.dom.Document document)
Specified by:
preprocess in interface org.apache.xbean.spring.context.SpringXmlPreprocessor

getResources

protected java.util.List<java.net.URL> getResources(java.lang.String location)

Get the URLs for a classpath location. This method supports standard relative file location, file: URL location (including entries regexp filter support), jar: URL location (including entries regexp filter support).

Parameters:
location - the location where to get the URLs.
Returns:
the URLs list.

getJarResources

protected java.util.List<java.net.URL> getJarResources(java.lang.String location)

Get the URLs for a jar: protocol based location. This method supports regexp to add several entries.

 jar:file:/path/to/my.ear!/entry.jar
 jar:file:/path/to/my.ear!/en*.jar
 

Parameters:
location - the jar location.
Returns:
the jar location URLs.

getFileResources

protected java.util.List<java.net.URL> getFileResources(java.lang.String location)

Get the URLs for a file: protocol based location. This methods supports regexp to add several entries.

 file:/path/to/my.jar
 file:/path/to/my*.jar
 

Parameters:
location -
Returns:

getDefaultLocations

protected java.net.URL[] getDefaultLocations()

getClassLoader

protected java.lang.ClassLoader getClassLoader(org.apache.xbean.spring.context.SpringApplicationContext applicationContext,
                                               org.springframework.beans.factory.xml.XmlBeanDefinitionReader reader,
                                               org.w3c.dom.Document document)

getParentClassLoader

protected java.lang.ClassLoader getParentClassLoader(org.apache.xbean.spring.context.SpringApplicationContext applicationContext)


Copyright © 2005-2012 FuseSource. All Rights Reserved.