當前位置: 首頁>>代碼示例>>Java>>正文


Java PortableRemoteObject.toStub方法代碼示例

本文整理匯總了Java中javax.rmi.PortableRemoteObject.toStub方法的典型用法代碼示例。如果您正苦於以下問題:Java PortableRemoteObject.toStub方法的具體用法?Java PortableRemoteObject.toStub怎麽用?Java PortableRemoteObject.toStub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.rmi.PortableRemoteObject的用法示例。


在下文中一共展示了PortableRemoteObject.toStub方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: toStub

import javax.rmi.PortableRemoteObject; //導入方法依賴的package包/類
@Override
public Remote toStub(final Remote obj) throws NoSuchObjectException {
    if (System.getSecurityManager() == null) {
        return PortableRemoteObject.toStub(obj);
    } else {
        try {
            return AccessController.doPrivileged(new PrivilegedExceptionAction<Remote>() {

                @Override
                public Remote run() throws Exception {
                    return PortableRemoteObject.toStub(obj);
                }
            }, STUB_ACC);
        } catch (PrivilegedActionException e) {
            if (e.getException() instanceof NoSuchObjectException) {
                throw (NoSuchObjectException)e.getException();
            }
            throw new RuntimeException("Unexpected exception type", e.getException());
        }
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:22,代碼來源:IIOPProxyImpl.java

示例2: getEchoStub

import javax.rmi.PortableRemoteObject; //導入方法依賴的package包/類
/**
 * Initialize the ORB and the singleton Echo server stub.
 * @return the stub for the Echo server.
 * @throws RemoteException if an error occurs
 */
synchronized Echo getEchoStub() throws RemoteException {
    if (echoStub == null) {
        ORB orb = (ORB) ORB.init(new String[0], null);
        Echo server = new Server();
        echoStub = (javax.rmi.CORBA.Stub) PortableRemoteObject.toStub(server);
        echoStub.connect(orb);
    }
    return (Echo)echoStub;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:15,代碼來源:ObjectStreamTest.java

示例3: toStub

import javax.rmi.PortableRemoteObject; //導入方法依賴的package包/類
public static Object toStub(final Object obj) throws IOException {
    final Tie tie = javax.rmi.CORBA.Util.getTie((Remote) obj);
    if (tie == null) {
        throw new IOException("Unable to serialize PortableRemoteObject; object has not been exported: " + obj);
    }
    final ORB orb = getORB();
    tie.orb(orb);
    return PortableRemoteObject.toStub((Remote) obj);
}
 
開發者ID:apache,項目名稱:tomee,代碼行數:10,代碼來源:Corbas.java

示例4: toStub

import javax.rmi.PortableRemoteObject; //導入方法依賴的package包/類
@Override
public Remote toStub(Remote obj) throws NoSuchObjectException {
    return PortableRemoteObject.toStub(obj);
}
 
開發者ID:openjdk,項目名稱:jdk7-jdk,代碼行數:5,代碼來源:IIOPProxyImpl.java


注:本文中的javax.rmi.PortableRemoteObject.toStub方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。