Examples of CompositeClassLoader


Examples of com.thoughtworks.xstream.core.util.CompositeClassLoader

     * @param reflectionProvider the reflection provider to use or <em>null</em> for best matching Provider
     * @param hierarchicalStreamDriver the driver instance
     * @throws InitializationException in case of an initialization problem
     */
    public XStream(final ReflectionProvider reflectionProvider, final HierarchicalStreamDriver hierarchicalStreamDriver) {
        this(reflectionProvider, hierarchicalStreamDriver, new ClassLoaderReference(new CompositeClassLoader()));
    }
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.CompositeClassLoader

                ? ((com.thoughtworks.xstream.core.util.ClassLoaderReference)reference)
                    .getReference() : reference;
    }

    private Object readResolve() {
        this.reference = new CompositeClassLoader();
        return this;
    }
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.CompositeClassLoader

public class XmlFriendlyMapperTest extends TestCase {

    private Mapper mapper;

    public void testPrefixesIllegalXmlElementNamesWithValue() {
        mapper = new XmlFriendlyMapper(new DefaultMapper(new CompositeClassLoader()));
        Class proxyCls = SampleDynamicProxy.newInstance().getClass();
        String aliasedName = mapper.serializedClass(proxyCls);
        assertTrue("Does not start with 'default-Proxy' : <" + aliasedName + ">",
                aliasedName.startsWith("default-Proxy"));
        assertEquals(proxyCls, mapper.realClass(aliasedName));
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.CompositeClassLoader

public class DefaultClassMapperTest extends TestCase {
    private Mapper mapper;

    protected void setUp() throws Exception {
        super.setUp();
        mapper = new ArrayMapper(new DefaultMapper(new CompositeClassLoader()));
    }
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.CompositeClassLoader

    }

    public void testCustomConverterCanBeInstantiatedAndRegisteredWithDesiredPriority() {
        XStream xstream = new XStream(new XppDriver());
        // using default mapper instead of XStream#buildMapper()
        Mapper mapper = new DefaultMapper(new CompositeClassLoader());
        // AttributeMapper required by ReflectionConverter
        mapper = new AttributeMapper(mapper, xstream.getConverterLookup(), xstream.getReflectionProvider());
        Converter converter = new CustomReflectionConverter(mapper, new PureJavaReflectionProvider());
        xstream.registerConverter(converter, -20);
        xstream.alias("world", World.class);
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.CompositeClassLoader

    private final XStream xstream;

    public XStreamCache() {
        JVM jvm = new JVM();
        ClassLoaderReference classLoaderReference = new ClassLoaderReference(
            new CompositeClassLoader());
        DefaultConverterLookup converterLookup = new DefaultConverterLookup();
        xstream = new XStream(
            jvm.bestReflectionProvider(), new XppDriver(), classLoaderReference, buildMapper(
                getMappers(jvm), jvm, classLoaderReference, converterLookup), converterLookup, converterLookup);
        xstream.alias("one", One.class);
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.CompositeClassLoader

     *             instead
     */
    public XStream(
        ReflectionProvider reflectionProvider, Mapper mapper, HierarchicalStreamDriver driver) {
        this(
            reflectionProvider, driver, new ClassLoaderReference(new CompositeClassLoader()),
            mapper, new DefaultConverterLookup(), null);
    }
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.CompositeClassLoader

        if (reflectionProvider == null) {
            reflectionProvider = jvm.bestReflectionProvider();
        }
        this.reflectionProvider = reflectionProvider;
        this.hierarchicalStreamDriver = driver;
        this.classLoaderReference = new ClassLoaderReference(new CompositeClassLoader());
        this.mapper = mapper == null ? buildMapper(true) : mapper;
        this.converterLookup = new DefaultConverterLookup(this.mapper);

        setupMappers();
        setupAliases();
View Full Code Here

Examples of net.sf.jasperreports.engine.util.CompositeClassloader

   */
  public static void configureDigester(Digester digester) throws SAXException, ParserConfigurationException
  {
    // set a composite classloader that includes both the JR classloader
    // and the context classloader
    CompositeClassloader digesterClassLoader = new CompositeClassloader(
        JRXmlDigesterFactory.class.getClassLoader(),
        Thread.currentThread().getContextClassLoader());
    digester.setClassLoader(digesterClassLoader);
   
    digester.setErrorHandler(new ErrorHandlerImpl());
View Full Code Here

Examples of org.apache.tuscany.spi.deployer.CompositeClassLoader

    }

    protected void deployExtension(String name, URL url) {
        // FIXME for now, assume this class's ClassLoader is the Tuscany system classloader
        // FIXME we should really use the one associated with the parent composite
        CompositeClassLoader extensionCL = new CompositeClassLoader(getClass().getClassLoader());

        // see if the URL points to a composite JAR by looking for a default SCDL file inside it
        URL scdlLocation;
        try {
            scdlLocation = new URL("jar:" + url.toExternalForm() + "!/META-INF/sca/default.scdl");
        } catch (MalformedURLException e) {
            // the form of the jar: URL should be correct given url.toExternalForm() worked
            throw new AssertionError();
        }
        try {
            scdlLocation.openStream().close();
            // we connected to the SCDL so let's add the JAR file to the classloader
            extensionCL.addURL(url);
        } catch (IOException e) {
            // assume that the URL we were given is not a JAR file so just use the supplied resource
            scdlLocation = url;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.