本文整理汇总了Java中java.rmi.server.RMIClassLoader.loadProxyClass方法的典型用法代码示例。如果您正苦于以下问题:Java RMIClassLoader.loadProxyClass方法的具体用法?Java RMIClassLoader.loadProxyClass怎么用?Java RMIClassLoader.loadProxyClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.rmi.server.RMIClassLoader
的用法示例。
在下文中一共展示了RMIClassLoader.loadProxyClass方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveProxyClass
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
* resolveProxyClass is extended to acquire (if present) the location
* to determine the class loader to define the proxy class in.
*/
protected Class<?> resolveProxyClass(String[] interfaces)
throws IOException, ClassNotFoundException
{
/*
* Always read annotation written by MarshalOutputStream.
*/
Object annotation = readLocation();
ClassLoader defaultLoader =
skipDefaultResolveClass ? null : latestUserDefinedLoader();
String codebase = null;
if (!useCodebaseOnly && annotation instanceof String) {
codebase = (String) annotation;
}
return RMIClassLoader.loadProxyClass(codebase, interfaces,
defaultLoader);
}
示例2: resolveProxyClass
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
* resolveProxyClass is extended to acquire (if present) the location
* to determine the class loader to define the proxy class in.
*/
protected Class<?> resolveProxyClass(String[] interfaces)
throws IOException, ClassNotFoundException
{
StreamChecker checker = streamChecker;
if (checker != null) {
checker.checkProxyInterfaceNames(interfaces);
}
/*
* Always read annotation written by MarshalOutputStream.
*/
Object annotation = readLocation();
ClassLoader defaultLoader =
skipDefaultResolveClass ? null : latestUserDefinedLoader();
String codebase = null;
if (!useCodebaseOnly && annotation instanceof String) {
codebase = (String) annotation;
}
return RMIClassLoader.loadProxyClass(codebase, interfaces,
defaultLoader);
}
示例3: resolveProxyClass
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
* resolveProxyClass is extended to acquire (if present) the location
* to determine the class loader to define the proxy class in.
*/
protected Class resolveProxyClass(String[] interfaces)
throws IOException, ClassNotFoundException
{
/*
* Always read annotation written by MarshalOutputStream.
*/
Object annotation = readLocation();
ClassLoader defaultLoader =
skipDefaultResolveClass ? null : latestUserDefinedLoader();
String codebase = null;
if (!useCodebaseOnly && annotation instanceof String) {
codebase = (String) annotation;
}
return RMIClassLoader.loadProxyClass(codebase, interfaces,
defaultLoader);
}
示例4: resolveProxyClass
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
protected Class resolveProxyClass(String intfs[]) throws IOException,
ClassNotFoundException
{
try
{
return RMIClassLoader.loadProxyClass(
(String)getAnnotation(),
intfs,
VMStackWalker.firstNonNullClassLoader());
}
catch (MalformedURLException x)
{
throw new ClassNotFoundException(null, x);
}
}
示例5: resolveProxyClass
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
protected Class resolveProxyClass(String intfs[]) throws IOException,
ClassNotFoundException
{
try
{
return RMIClassLoader.loadProxyClass(
(String)getAnnotation(),
intfs,
VMStackWalker.firstNonNullClassLoader());
}
catch (MalformedURLException x)
{
throw new ClassNotFoundException(null, x);
}
}
示例6: resolveProxyClass
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
* Resolves annotated proxy class.
*
* @param interf array of interfaces which proxy class should implement
*
* @throws IOException if an I/O exception occurred
* @throws ClassNotFoundException if class of a serialized object
* could not be found
*/
protected Class resolveProxyClass(String[] interf)
throws IOException, ClassNotFoundException {
String annot = (locStream == null) ? null
: (String) locStream.readObject();
if (useCodebaseOnly) {
annot = null;
}
Class cl = RMIClassLoader.loadProxyClass(annot, interf,
VM.getNonBootstrapClassLoader());
return cl;
}
示例7: testLoadProxyClassInvalidCodebase
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
* Test for java.rmi.server.RMIClassLoader.loadProxyClass(String, String[], ClassLoader)
* testing invalid url as a codebase.
*/
public void testLoadProxyClassInvalidCodebase() throws Exception {
//Regression for HARMONY-1133
SecurityManager previous = System.getSecurityManager();
System.setSecurityManager(null);
try {
RMIClassLoader.loadProxyClass("zzz", new String[] {}, null);
fail("MalformedURLException expected");
} catch (MalformedURLException e) {
//expected
} finally {
System.setSecurityManager(previous);
}
}
示例8: resolveProxyClass
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
* Constructs and returns a Proxy class that implements the required
* interfaces.
*
* @param interfaces
* the interfaces to be implemented
* @return a proxy class that implements the specified interfaces
* @throws IOException
* if de I/O operation fails
*/
@Override
protected Class<?> resolveProxyClass(String[] interfaces)
throws IOException, ClassNotFoundException {
Object obj = this.readObject();
try {
return super.resolveProxyClass(interfaces);
} catch (Exception e) {
return RMIClassLoader
.loadProxyClass((String) obj, interfaces, null);
}
}
示例9: testLoadProxyClass006
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
public final void testLoadProxyClass006() {
String interfaces[] = {
"ar.org.fitc.test.rmi.server.testclasses.SuperProxy",
"ar.org.fitc.test.rmi.server.testclasses.OverProxy",
"ar.org.fitc.test.rmi.server.testclasses.LoaderInterface" };
try {
RMIClassLoader.loadProxyClass(null, interfaces, new URLClassLoader(
new URL[] { new URL("file://" + pathOwnClass) }));
} catch (Throwable e) {
fail("Should not raise an exception but raised: " + e);
}
}
示例10: testLoadProxyClass009
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
public final void testLoadProxyClass009() {
String interfaces[] = {};
Class c = null;
try {
c = RMIClassLoader.loadProxyClass(null, interfaces, null);
assertNotNull(c);
} catch (Throwable e) {
fail("Should not raise an exception but raised: " + e);
}
}
示例11: testLoadProxyClassInvalidCodebase
import java.rmi.server.RMIClassLoader; //导入方法依赖的package包/类
/**
* Test for java.rmi.server.RMIClassLoader.loadProxyClass(String, String[],
* ClassLoader) testing invalid url as a codebase.
*/
public void testLoadProxyClassInvalidCodebase() throws Exception {
// Regression for HARMONY-1133
SecurityManager previous = System.getSecurityManager();
System.setSecurityManager(null);
try {
RMIClassLoader.loadProxyClass("zzz", new String[] {}, null);
fail("MalformedURLException expected");
} catch (MalformedURLException e) {
// expected
} finally {
System.setSecurityManager(previous);
}
}