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


Java UID.read方法代碼示例

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


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

示例1: doMessage

import java.rmi.server.UID; //導入方法依賴的package包/類
private void doMessage ( Socket s, DataInputStream in, DataOutputStream out, Object payload ) throws Exception {
    System.err.println("Reading message...");

    int op = in.read();

    switch ( op ) {
    case TransportConstants.Call:
        // service incoming RMI call
        doCall(in, out, payload);
        break;

    case TransportConstants.Ping:
        // send ack for ping
        out.writeByte(TransportConstants.PingAck);
        break;

    case TransportConstants.DGCAck:
        UID u = UID.read(in);
        break;

    default:
        throw new IOException("unknown transport op " + op);
    }

    s.close();
}
 
開發者ID:hucheat,項目名稱:APacheSynapseSimplePOC,代碼行數:27,代碼來源:JRMPListener.java

示例2: doMessage

import java.rmi.server.UID; //導入方法依賴的package包/類
private void doMessage ( Socket s, DataInputStream in, DataOutputStream out ) throws Exception {
    System.err.println("Reading message...");

    int op = in.read();

    switch ( op ) {
    case TransportConstants.Call:
        // service incoming RMI call
        doCall(in, out);
        break;

    case TransportConstants.Ping:
        // send ack for ping
        out.writeByte(TransportConstants.PingAck);
        break;

    case TransportConstants.DGCAck:
        UID.read(in);
        break;

    default:
        throw new IOException("unknown transport op " + op);
    }

    s.close();
}
 
開發者ID:mbechler,項目名稱:marshalsec,代碼行數:27,代碼來源:RMIRefServer.java

示例3: executeCall

import java.rmi.server.UID; //導入方法依賴的package包/類
/**
 * @see RemoteCall.executeCall()
 */
public void executeCall() throws Exception {
    if (isClosed) {
        // rmi.38=Remote call is already closed.
        throw new RemoteException(Messages.getString("rmi.38")); //$NON-NLS-1$
    }
    byte data;

    try {
        // read input
        if ((data = (new DataInputStream(conn.getInputStream())).readByte())
                != CALL_OK) {
            // rmi.39=Unknown call status response: {0}
            throw new UnmarshalException(Messages.getString("rmi.39", data)); //$NON-NLS-1$
        }

        // read return value id
        getInputStream();
        data = oin.readByte();
    } catch (UnmarshalException re) {
        throw re;
    } catch (IOException ioe) {
        // rmi.3A=Unable to read call return header:
        throw new UnmarshalException(Messages.getString("rmi.3A"), //$NON-NLS-1$
                ioe);
    }

    if (data != RETURN_VAL && data != RETURN_EX) {
        // rmi.3B=Unknown call result response: {0}
        throw new UnmarshalException(Messages.getString("rmi.3B", data)); //$NON-NLS-1$
    }
    uid = UID.read(oin);

    if (data == RETURN_EX) {
        getExceptionFromServer();
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:40,代碼來源:ClientRemoteCall.java

示例4: readDGCAck

import java.rmi.server.UID; //導入方法依賴的package包/類
/**
 * Reads a DGCAck message
 * @param in 
 *          the {@link java.io.InputStream} to be read
 * @throws ProtocolException
 *          if not able to read the DGCAck
 */
private final void readDGCAck(DataInputStream in) throws ProtocolException {
    try {
        uid = UID.read(in);
    } catch (IOException e) {
        throw new ProtocolException("I/O Error Reading the DGCAck");
    }
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:15,代碼來源:Message.java

示例5: testRead001

import java.rmi.server.UID; //導入方法依賴的package包/類
public final void testRead001() {
    try {
        byte[] ba = { -5, 67, 99, -111, 125, 124, 33, -11, 45, 63, 52, 14,
                21, -38 };
        ByteArrayInputStream baops = new ByteArrayInputStream(ba);
        DataInputStream dis = new DataInputStream(baops);
        uid = UID.read(dis);
        assertEquals(uid.toString(), "-4bc9c6f:7d7c21f52d3f340e:15da");

    } catch (Throwable e) {
        fail("Failed with:" + e);
    }
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:14,代碼來源:TestUID.java

示例6: testRead002

import java.rmi.server.UID; //導入方法依賴的package包/類
public final void testRead002() {
    try {
        byte[] ba = { 5, 67, 0, 33, 125, -124, 33, -11, 45, 63, 52, 0, 0, 0 };
        ByteArrayInputStream baops = new ByteArrayInputStream(ba);
        DataInputStream dis = new DataInputStream(baops);
        uid = UID.read(dis);

        assertEquals(uid.toString(), "5430021:7d8421f52d3f3400:0");
    } catch (Throwable e) {
        fail("Failed with:" + e);
    }
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:13,代碼來源:TestUID.java

示例7: testRead003

import java.rmi.server.UID; //導入方法依賴的package包/類
public final void testRead003() {
    try {
        byte[] ba = { 4, -33, 57, 13, 0, 0, 0, 0, 0, 0, 0, 0, -21, -38 };
        ByteArrayInputStream baops = new ByteArrayInputStream(ba);
        DataInputStream dis = new DataInputStream(baops);
        uid = UID.read(dis);

        assertEquals(uid.toString(), "4df390d:0:-1426");
    } catch (Throwable e) {
        fail("Failed with:" + e);
    }
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:13,代碼來源:TestUID.java

示例8: testRead004

import java.rmi.server.UID; //導入方法依賴的package包/類
public final void testRead004() {
    byte[] ba = { 0, 0, 0, 0, -22, 124, 33, -11, 55, 25, 1, 111, 99, -99 };
    ByteArrayInputStream baops = new ByteArrayInputStream(ba);
    DataInputStream dis = new DataInputStream(baops);
    try {
        uid = UID.read(dis);
    } catch (Throwable e) {
        fail("Failed with:" + e);
    }
    assertEquals(uid.toString(), "0:-1583de0ac8e6fe91:639d");
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:12,代碼來源:TestUID.java

示例9: testRead005

import java.rmi.server.UID; //導入方法依賴的package包/類
public final void testRead005() {
    byte[] ba = { -5, 67, 99, -111, 125, 38, 33, -11, 45, 63, 52, 14, 21,
            -38 };
    ByteArrayInputStream baops = new ByteArrayInputStream(ba);
    DataInputStream dis = new DataInputStream(baops);
    try {
        uid = UID.read(dis);
    } catch (Throwable e) {
        fail("Failed with:" + e);
    }
    assertEquals(uid.toString(), "-4bc9c6f:7d2621f52d3f340e:15da");
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:13,代碼來源:TestUID.java

示例10: testRead006

import java.rmi.server.UID; //導入方法依賴的package包/類
public final void testRead006() {
    byte[] ba = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
    ByteArrayInputStream baops = new ByteArrayInputStream(ba);
    DataInputStream dis = new DataInputStream(baops);
    try {
        uid = UID.read(dis);
    } catch (Throwable e) {
        fail("Failed with:" + e);
    }
    assertEquals(uid.toString(), "0:0:0");
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:12,代碼來源:TestUID.java

示例11: readID

import java.rmi.server.UID; //導入方法依賴的package包/類
void readID() throws IOException {
    ackID = UID.read((DataInput) this);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:4,代碼來源:ConnectionInputStream.java

示例12: readObject

import java.rmi.server.UID; //導入方法依賴的package包/類
private void readObject(ObjectInput in)
        throws IOException, ClassNotFoundException {
    addr = (byte []) in.readObject();
    uid = UID.read(in);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:6,代碼來源:VMID.java


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