本文整理汇总了Java中java.rmi.Remote.getClass方法的典型用法代码示例。如果您正苦于以下问题:Java Remote.getClass方法的具体用法?Java Remote.getClass怎么用?Java Remote.getClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.rmi.Remote
的用法示例。
在下文中一共展示了Remote.getClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exportObject
import java.rmi.Remote; //导入方法依赖的package包/类
/**
* Export this object, create the skeleton and stubs for this
* dispatcher. Create a stub based on the type of the impl,
* initialize it with the appropriate remote reference. Create the
* target defined by the impl, dispatcher (this) and stub.
* Export that target via the Ref.
*/
public Remote exportObject(Remote impl, Object data,
boolean permanent)
throws RemoteException
{
Class<?> implClass = impl.getClass();
Remote stub;
try {
stub = Util.createProxy(implClass, getClientRef(), forceStubUse);
} catch (IllegalArgumentException e) {
throw new ExportException(
"remote object implements illegal remote interface", e);
}
if (stub instanceof RemoteStub) {
setSkeleton(impl);
}
Target target =
new Target(impl, this, stub, ref.getObjID(), permanent);
ref.exportObject(target);
hashToMethod_Map = hashToMethod_Maps.get(implClass);
return stub;
}
示例2: setTarget
import java.rmi.Remote; //导入方法依赖的package包/类
public void setTarget(Remote target)
{
this.target = target;
if (target == null) {
classData = null ;
} else {
Class targetClass = target.getClass() ;
classData = pm.getClassData( targetClass ) ;
}
}