当前位置: 首页>>代码示例>>Java>>正文


Java Util.readAddress方法代码示例

本文整理汇总了Java中org.jgroups.util.Util.readAddress方法的典型用法代码示例。如果您正苦于以下问题:Java Util.readAddress方法的具体用法?Java Util.readAddress怎么用?Java Util.readAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jgroups.util.Util的用法示例。


在下文中一共展示了Util.readAddress方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: process

import org.jgroups.util.Util; //导入方法依赖的package包/类
protected void process(Socket socket) {
    OutputStream      output=null;
    try {
        socket.setSendBufferSize(buffer_size);
        if(log.isDebugEnabled())
            log.debug(local_addr + ": accepted request for state transfer from " + socket.getInetAddress() + ":" + socket.getPort());

        DataInput in=new DataInputStream(socket.getInputStream());
        Address stateRequester=Util.readAddress(in);
        output=new BufferedOutputStream(socket.getOutputStream(), buffer_size);
        getStateFromApplication(stateRequester, output, false);
    }
    catch(Throwable e) {
        if(log.isWarnEnabled())
            log.warn(local_addr + ": failed handling request from requester", e);
    }
    // getStateFromApplication() is run in the same thread; it closes the output stream, and we close the socket
    finally {
        Util.close(socket);
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:22,代码来源:STATE_SOCK.java

示例2: readFrom

import org.jgroups.util.Util; //导入方法依赖的package包/类
public void readFrom(DataInput in) throws Exception {
    super.readFrom(in);
    short len=in.readShort();
    if(len > 0) {
        subgroups=new View[len];
        for(int i=0; i < len; i++) {
            int index=in.readShort();
            Address creator=index >= 0 ? get(index) : Util.readAddress(in);
            long id=in.readLong();
            Address[] mbrs=new Address[in.readShort()];
            for(int j=0; j < mbrs.length; j++) {
                index=in.readShort();
                mbrs[j]=index >= 0? get(index) : Util.readAddress(in);
            }
            try {
                View view=View.create(creator, id, mbrs);
                subgroups[i]=view;
            }
            catch(Throwable t) {
            }
        }
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:24,代码来源:MergeView.java

示例3: readFrom

import org.jgroups.util.Util; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void readFrom(DataInput instream) throws Exception {
    sender=Util.readAddress(instream);
    flags=instream.readByte();
    logical_name=Bits.readString(instream);
    physical_addr=(PhysicalAddress)Util.readAddress(instream);
    mbrs=Util.readAddresses(instream, ArrayList.class);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:9,代码来源:PingData.java

示例4: readFrom

import org.jgroups.util.Util; //导入方法依赖的package包/类
public void readFrom(DataInput in) throws Exception {
    type=in.readByte();
    switch(type) {
        case MSG:
        case XMIT_RSP:
        case HIGHEST_SEQNO:
            seqno=Bits.readLong(in);
            break;
        case XMIT_REQ:
            sender=Util.readAddress(in);
            break;
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:14,代码来源:NakAckHeader2.java

示例5: readFrom

import org.jgroups.util.Util; //导入方法依赖的package包/类
public void readFrom(DataInput in) throws Exception {
    type=in.readByte();
    switch(type) {
        case MSG:
        case XMIT_RSP:
            seqno=Bits.readLong(in);
            break;
        case XMIT_REQ:
            range=(Range)Util.readStreamable(Range.class, in);
            sender=Util.readAddress(in);
            break;
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:14,代码来源:NakAckHeader.java

示例6: readFrom

import org.jgroups.util.Util; //导入方法依赖的package包/类
public void readFrom(DataInput in) throws Exception {
    type=in.readByte();
    group=Bits.readString(in);
    addr=Util.readAddress(in);
    logical_name=Bits.readString(in);
    mbrs=(List<Address>)Util.readAddresses(in, LinkedList.class);
    physical_addr=(PhysicalAddress)Util.readAddress(in);
    buffer=Util.readByteBuffer(in);
    if(buffer != null) {
        offset=0;
        length=buffer.length;
    }
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:14,代码来源:GossipData.java

示例7: readFrom

import org.jgroups.util.Util; //导入方法依赖的package包/类
public void readFrom(DataInput in) throws Exception {
    type=in.readShort();
    from=Util.readAddress(in);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:5,代码来源:VERIFY_SUSPECT.java

示例8: readFrom

import org.jgroups.util.Util; //导入方法依赖的package包/类
public void readFrom(DataInput in) throws Exception {
    type=in.readByte();
    mbrs=(Collection<Address>)Util.readAddresses(in, ArrayList.class);
    from=Util.readAddress(in);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:6,代码来源:FD.java

示例9: readFrom

import org.jgroups.util.Util; //导入方法依赖的package包/类
@Override
public void readFrom(DataInput in) throws Exception {
    address = Util.readAddress(in);
    id = Bits.readLong(in);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:6,代码来源:MessageID.java

示例10: readFrom

import org.jgroups.util.Util; //导入方法依赖的package包/类
public void readFrom(DataInput in) throws Exception {
    creator=Util.readAddress(in);
    id=Bits.readLong(in);
}
 
开发者ID:zjumty,项目名称:jgroups-3.6.4-fixed,代码行数:5,代码来源:ViewId.java


注:本文中的org.jgroups.util.Util.readAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。