URLClassLoader.java: Removed.
2007-01-15 Gary Benson <gbenson@redhat.com> * java/net/URLClassLoader.java: Removed. * gnu/java/net/loader/Load_gcjlib.java: New file. * gnu/gcj/runtime/BootClassLoader.java: Ensure core URL handler is present in static executables. * sources.am, Makefile.in: Rebuilt. From-SVN: r120791
This commit is contained in:
parent
9ebe2d22e7
commit
a5c0f6fe87
28 changed files with 224 additions and 1459 deletions
50
libjava/gnu/java/net/loader/Load_gcjlib$SoResource.h
Normal file
50
libjava/gnu/java/net/loader/Load_gcjlib$SoResource.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
|
||||
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
|
||||
|
||||
#ifndef __gnu_java_net_loader_Load_gcjlib$SoResource__
|
||||
#define __gnu_java_net_loader_Load_gcjlib$SoResource__
|
||||
|
||||
#pragma interface
|
||||
|
||||
#include <gnu/java/net/loader/Resource.h>
|
||||
extern "Java"
|
||||
{
|
||||
namespace gnu
|
||||
{
|
||||
namespace java
|
||||
{
|
||||
namespace net
|
||||
{
|
||||
namespace loader
|
||||
{
|
||||
class Load_gcjlib;
|
||||
class Load_gcjlib$SoResource;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace java
|
||||
{
|
||||
namespace net
|
||||
{
|
||||
class URL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class gnu::java::net::loader::Load_gcjlib$SoResource : public ::gnu::java::net::loader::Resource
|
||||
{
|
||||
|
||||
public: // actually package-private
|
||||
Load_gcjlib$SoResource(::gnu::java::net::loader::Load_gcjlib *, ::java::net::URL *);
|
||||
public:
|
||||
::java::io::InputStream * getInputStream();
|
||||
jint getLength();
|
||||
::java::net::URL * getURL();
|
||||
private:
|
||||
::java::net::URL * __attribute__((aligned(__alignof__( ::gnu::java::net::loader::Resource)))) url;
|
||||
public:
|
||||
static ::java::lang::Class class$;
|
||||
};
|
||||
|
||||
#endif // __gnu_java_net_loader_Load_gcjlib$SoResource__
|
58
libjava/gnu/java/net/loader/Load_gcjlib.h
Normal file
58
libjava/gnu/java/net/loader/Load_gcjlib.h
Normal file
|
@ -0,0 +1,58 @@
|
|||
|
||||
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
|
||||
|
||||
#ifndef __gnu_java_net_loader_Load_gcjlib__
|
||||
#define __gnu_java_net_loader_Load_gcjlib__
|
||||
|
||||
#pragma interface
|
||||
|
||||
#include <gnu/java/net/loader/URLLoader.h>
|
||||
extern "Java"
|
||||
{
|
||||
namespace gnu
|
||||
{
|
||||
namespace gcj
|
||||
{
|
||||
namespace runtime
|
||||
{
|
||||
class SharedLibHelper;
|
||||
}
|
||||
}
|
||||
namespace java
|
||||
{
|
||||
namespace net
|
||||
{
|
||||
namespace loader
|
||||
{
|
||||
class Load_gcjlib;
|
||||
class Resource;
|
||||
class URLStreamHandlerCache;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace java
|
||||
{
|
||||
namespace net
|
||||
{
|
||||
class URL;
|
||||
class URLClassLoader;
|
||||
class URLStreamHandlerFactory;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class gnu::java::net::loader::Load_gcjlib : public ::gnu::java::net::loader::URLLoader
|
||||
{
|
||||
|
||||
public:
|
||||
Load_gcjlib(::java::net::URLClassLoader *, ::gnu::java::net::loader::URLStreamHandlerCache *, ::java::net::URLStreamHandlerFactory *, ::java::net::URL *, ::java::net::URL *);
|
||||
::java::lang::Class * getClass(::java::lang::String *);
|
||||
::gnu::java::net::loader::Resource * getResource(::java::lang::String *);
|
||||
private:
|
||||
::gnu::gcj::runtime::SharedLibHelper * __attribute__((aligned(__alignof__( ::gnu::java::net::loader::URLLoader)))) helper;
|
||||
public:
|
||||
static ::java::lang::Class class$;
|
||||
};
|
||||
|
||||
#endif // __gnu_java_net_loader_Load_gcjlib__
|
77
libjava/gnu/java/net/loader/Load_gcjlib.java
Normal file
77
libjava/gnu/java/net/loader/Load_gcjlib.java
Normal file
|
@ -0,0 +1,77 @@
|
|||
/* Copyright (C) 2007 Free Software Foundation
|
||||
|
||||
This file is part of libgcj.
|
||||
|
||||
This software is copyrighted work licensed under the terms of the
|
||||
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
||||
details. */
|
||||
|
||||
package gnu.java.net.loader;
|
||||
|
||||
import gnu.gcj.runtime.SharedLibHelper;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLStreamHandlerFactory;
|
||||
|
||||
/**
|
||||
* A <code>Load_gcjlib</code> is a type of <code>URLLoader</code>
|
||||
* that loads classes and resources from a shared library.
|
||||
*/
|
||||
public final class Load_gcjlib extends URLLoader
|
||||
{
|
||||
private SharedLibHelper helper;
|
||||
|
||||
public Load_gcjlib(URLClassLoader classloader,
|
||||
URLStreamHandlerCache cache,
|
||||
URLStreamHandlerFactory factory,
|
||||
URL url, URL absoluteUrl)
|
||||
{
|
||||
super(classloader, cache, factory, url, absoluteUrl);
|
||||
helper = SharedLibHelper.findHelper(classloader, url.getFile(),
|
||||
noCertCodeSource, true);
|
||||
}
|
||||
|
||||
public Class getClass(String className)
|
||||
{
|
||||
return helper.findClass(className);
|
||||
}
|
||||
|
||||
public Resource getResource(String name)
|
||||
{
|
||||
URL url = helper.findResource(name);
|
||||
if (url == null)
|
||||
return null;
|
||||
return new SoResource(this, url);
|
||||
}
|
||||
|
||||
final static class SoResource extends Resource
|
||||
{
|
||||
private final URL url;
|
||||
|
||||
SoResource(Load_gcjlib loader, URL url)
|
||||
{
|
||||
super(loader);
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public InputStream getInputStream() throws IOException
|
||||
{
|
||||
URLConnection conn = url.openConnection();
|
||||
return conn.getInputStream();
|
||||
}
|
||||
|
||||
public int getLength()
|
||||
{
|
||||
// FIXME we could find this by asking the core object.
|
||||
return -1;
|
||||
}
|
||||
|
||||
public URL getURL ()
|
||||
{
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue