Examples of ClassLoaderObjectInputStream


Examples of org.apache.james.util.io.ClassLoaderObjectInputStream

            if( inputStream == null )
                  throw new NullPointerException("Null input stream returned for key: " + key );

            try
            {
                final ObjectInputStream stream = new ClassLoaderObjectInputStream( classLoader, inputStream );

                if( stream == null )
                  throw new NullPointerException("Null stream returned for key: " + key );

                final Object object = stream.readObject();

                if( DEBUG )
                {
                    getLogger().debug( "returning object " + object + " for key " + key );
                }
View Full Code Here

Examples of org.gradle.internal.io.ClassLoaderObjectInputStream

    public SystemApplicationClassLoaderWorker(byte[] serializedWorker) {
        this.serializedWorker = serializedWorker;
    }

    public Void call() throws Exception {
        ClassLoaderObjectInputStream instr = new ClassLoaderObjectInputStream(new ByteArrayInputStream(serializedWorker), getClass().getClassLoader());
        final Action<WorkerContext> action = (Action<WorkerContext>) instr.readObject();

        action.execute(new WorkerContext() {
            public ClassLoader getApplicationClassLoader() {
                return ClassLoader.getSystemClassLoader();
            }
View Full Code Here

Examples of org.gradle.internal.io.ClassLoaderObjectInputStream

        implementationClassLoader.addURLs(implementationClassPath);

        // Deserialize the worker action
        Action<WorkerContext> action;
        try {
            ObjectInputStream instr = new ClassLoaderObjectInputStream(new ByteArrayInputStream(serializedWorkerAction),
                    implementationClassLoader);
            action = (Action<WorkerContext>) instr.readObject();
        } catch (Exception e) {
            throw UncheckedException.throwAsUncheckedException(e);
        }
        action.execute(workerContext);
    }
View Full Code Here

Examples of org.gradle.internal.io.ClassLoaderObjectInputStream

                ClassLoader workerClassLoader = new MutableURLClassLoader(filteredGroovy, ClasspathUtil.getClasspath(compiler.getClass().getClassLoader()));

                try {
                    byte[] serializedWorker = GUtil.serialize(new Worker<T>(compiler, spec));
                    ClassLoaderObjectInputStream inputStream = new ClassLoaderObjectInputStream(new ByteArrayInputStream(serializedWorker), workerClassLoader);
                    Callable<?> worker = (Callable<?>) inputStream.readObject();
                    Object result = worker.call();
                    byte[] serializedResult = GUtil.serialize(result);
                    inputStream = new ClassLoaderObjectInputStream(new ByteArrayInputStream(serializedResult), getClass().getClassLoader());
                    return (CompileResult) inputStream.readObject();
                } catch (Exception e) {
                    throw UncheckedException.throwAsUncheckedException(e);
                }
            }
        };
View Full Code Here

Examples of org.gradle.internal.io.ClassLoaderObjectInputStream

        this.classLoader = classLoader;
    }

    public T read(Decoder decoder) throws Exception {
        try {
            return (T) new ClassLoaderObjectInputStream(decoder.getInputStream(), classLoader).readObject();
        } catch (StreamCorruptedException e) {
            return null;
        }
    }
View Full Code Here

Examples of org.gradle.util.ClassLoaderObjectInputStream

    public Void call() throws Exception {
        final ClassLoader applicationClassLoader = ClassLoader.getSystemClassLoader();
        ClasspathUtil.addUrl((URLClassLoader) applicationClassLoader, GFileUtils.toURLs(applicationClassPath));
        System.setProperty("java.class.path", GUtil.join(applicationClassPath, File.pathSeparator));

        ClassLoaderObjectInputStream instr = new ClassLoaderObjectInputStream(new ByteArrayInputStream(
                serializedWorker), getClass().getClassLoader());
        final Action<WorkerContext> action = (Action<WorkerContext>) instr.readObject();

        action.execute(new WorkerContext() {
            public ClassLoader getApplicationClassLoader() {
                return applicationClassLoader;
            }
View Full Code Here

Examples of org.openbp.common.classloader.ClassLoaderObjectInputStream

        // Return the result bytes
        byte [] bytes = bos.toByteArray();

        // Setup an object input stream.
        ClassLoaderObjectInputStream ois = new ClassLoaderObjectInputStream(new ByteArrayInputStream(bytes));
        ois.setClassLoader(classLoader);

        // Create a new token context and deserialize it from the stream
        newObject = ois.readObject();
      }
      catch (IOException e)
      {
        ExceptionUtil.printTrace(e);
        throw new CloneNotSupportedException("Cannot clone object of type '" + object.getClass().getName() + "'");
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.