本文整理匯總了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 ) ;
}
}