Package sun.misc

Examples of sun.misc.Resource


  try {
      return (Class)
    AccessController.doPrivileged(new PrivilegedExceptionAction() {
        public Object run() throws ClassNotFoundException {
      String path = name.replace('.', '/').concat(".class");
      Resource res = ucp.getResource(path, false);
      if (res != null) {
          try {
        return defineClass(name, res);
          } catch (IOException e) {
        throw new ClassNotFoundException(name, e);
View Full Code Here


            // isn't accessible when this code is first invoked.  It isn't an
            // issue, as if we can't find DownloadManager, we can safely assume
            // that additional code is not available for download.
        }
  URLClassPath ucp = getBootstrapClassPath();
  Resource res = ucp.getResource(name);
  return res != null ? res.getURL() : null;
    }
View Full Code Here

            AccessController.doPrivileged(new PrivilegedExceptionAction() {
                public Object run() throws ClassNotFoundException
                {
                    String path = name.replace('.', '/').concat(".class");
                    //message("path=" + path);
                    Resource res = ucp.getResource(path, false);
                    if (res != null) {
                        try {
                            return defineClass(name, res);
                        } catch (IOException e) {
                            final String msg
View Full Code Here

            AccessController.doPrivileged(new PrivilegedExceptionAction() {
                public Object run() throws ClassNotFoundException
                {
                    String path = name.replace('.', '/').concat(".class");
                    //message("path=" + path);
                    Resource res = ucp.getResource(path, false);
                    if (res != null) {
                        try {
                            return defineClass(name, res);
                        } catch (IOException e) {
                            final String msg
View Full Code Here

    /**
     * Find resources from the VM's built-in classloader.
     */
    private static URL getBootstrapResource(String name) {
        URLClassPath ucp = getBootstrapClassPath();
        Resource res = ucp.getResource(name);
        return res != null ? res.getURL() : null;
    }
View Full Code Here

        try {
            return AccessController.doPrivileged(
                new PrivilegedExceptionAction<Class<?>>() {
                    public Class<?> run() throws ClassNotFoundException {
                        String path = name.replace('.', '/').concat(".class");
                        Resource res = ucp.getResource(path, false);
                        if (res != null) {
                            try {
                                return defineClass(name, res);
                            } catch (IOException e) {
                                throw new ClassNotFoundException(name, e);
View Full Code Here

    /**
     * Find resources from the VM's built-in classloader.
     */
    private static URL getBootstrapResource(String name) {
        URLClassPath ucp = getBootstrapClassPath();
        Resource res = ucp.getResource(name);
        return res != null ? res.getURL() : null;
    }
View Full Code Here

    }

    @Override
    public boolean tryLoadType(final String internalName, final Buffer buffer) {
        final String path = internalName.concat(".class");
        final Resource resource = _classPath.getResource(path, false);

        if (resource == null) {
            return false;
        }

//        System.out.println("Loading " + internalName + "...");

        final byte[] data;

        try {
            data = resource.getBytes();
            assert data.length == resource.getContentLength();
        }
        catch (IOException e) {
            return false;
        }
View Full Code Here

        try {
            return AccessController.doPrivileged(
                new PrivilegedExceptionAction<Class>() {
                    public Class run() throws ClassNotFoundException {
                        String path = name.replace('.', '/').concat(".class");
                        Resource res = ucp.getResource(path, false);
                        if (res != null) {
                            try {
                                return defineClass(name, res);
                            } catch (IOException e) {
                                throw new ClassNotFoundException(name, e);
View Full Code Here

        super(urls, parent);
    }

    protected Class findClass(String name) throws ClassNotFoundException {
        String path = name.replace('.', '/').concat(".class");
        Resource res = new URLClassPath(getURLs()).getResource(path, false);
        if (res != null) {
            //definePackage(name.substring(0, name.lastIndexOf(".")), null, null);
            try {
                byte[] b = res.getBytes();
                byte[] transformed = ClassPreProcessorHelper.defineClass0Pre(this, name, b, 0, b.length, null);
                return defineClass(name, transformed, 0, transformed.length);
            }
            catch (IOException e) {
                throw new ClassNotFoundException(e.getMessage());
View Full Code Here

TOP

Related Classes of sun.misc.Resource

Copyright © 2018 www.massapicom. 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.