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


Java ObjectDataInput.readObject方法代码示例

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


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

示例1: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public CacheEntry read(ObjectDataInput in)
        throws IOException {

    try {
        int length = in.readInt();
        Serializable[] disassembledState = new Serializable[length];
        for (int i = 0; i < length; i++) {
            disassembledState[i] = in.readObject();
        }
        String subclass = in.readUTF();
        boolean lazyPropertiesAreUnfetched = in.readBoolean();
        Object version = in.readObject();

        return CACHE_ENTRY_CONSTRUCTOR.newInstance(disassembledState, subclass, lazyPropertiesAreUnfetched, version);

    } catch (Exception e) {
        if (e instanceof IOException) {
            throw (IOException) e;
        }
        throw new IOException(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:24,代码来源:Hibernate41CacheEntrySerializer.java

示例2: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public CacheKey read(ObjectDataInput in)
        throws IOException {

    try {
        Object key = in.readObject();
        Type type = in.readObject();
        String entityOrRoleName = in.readUTF();
        String tenantId = in.readUTF();
        int hashCode = in.readInt();

        CacheKey cacheKey = (CacheKey) UNSAFE.allocateInstance(CacheKey.class);
        UNSAFE.putObjectVolatile(cacheKey, KEY_OFFSET, key);
        UNSAFE.putObjectVolatile(cacheKey, TYPE_OFFSET, type);
        UNSAFE.putObjectVolatile(cacheKey, ENTITY_OR_ROLE_NAME_OFFSET, entityOrRoleName);
        UNSAFE.putObjectVolatile(cacheKey, TENANT_ID_OFFSET, tenantId);
        UNSAFE.putIntVolatile(cacheKey, HASH_CODE_OFFSET, hashCode);
        return cacheKey;

    } catch (Exception e) {
        if (e instanceof IOException) {
            throw (IOException) e;
        }
        throw new IOException(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:27,代码来源:Hibernate4CacheKeySerializer.java

示例3: createSerializer

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Serializer createSerializer() {
    return new StreamSerializer<MutableReference>() {
        @Override
        public int getTypeId() {
            return SerializerHookConstants.MUTABLE_REFERENCE;
        }

        @Override
        public void destroy() {

        }

        @Override
        public void write(ObjectDataOutput out, MutableReference object) throws IOException {
            out.writeObject(object.get());
        }

        @Override
        public MutableReference read(ObjectDataInput in) throws IOException {
            return new MutableReference<>(in.readObject());
        }
    };
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:25,代码来源:AccumulatorSerializerHooks.java

示例4: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
    size = in.readInt();
    if (size > starts.length) {
        // round to next power of 2
        @SuppressWarnings("checkstyle:magicnumber")
        int newSize = 1 << (32 - Integer.numberOfLeadingZeros(size - 1));
        starts = new long[newSize];
        ends = new long[newSize];
        accs = (A[]) new Object[newSize];
    }

    for (int i = 0; i < size; i++) {
        starts[i] = in.readLong();
        ends[i] = in.readLong();
        accs[i] = in.readObject();
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:19,代码来源:SessionWindowP.java

示例5: createSerializer

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Serializer createSerializer() {
    return new StreamSerializer<BroadcastEntry>() {
        @Override
        public int getTypeId() {
            return SerializerHookConstants.BROADCAST_ENTRY;
        }

        @Override
        public void destroy() {

        }

        @Override
        public void write(ObjectDataOutput out, BroadcastEntry object) throws IOException {
            out.writeObject(object.getKey());
            out.writeObject(object.getValue());
        }

        @Override
        public BroadcastEntry read(ObjectDataInput in) throws IOException {
            return new BroadcastEntry(in.readObject(), in.readObject());
        }
    };
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:26,代码来源:ExecutionSerializerHooks.java

示例6: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
    int vertexCount = in.readInt();

    for (int i = 0; i < vertexCount; i++) {
        String key = in.readObject();
        Vertex value = in.readObject();
        nameToVertex.put(key, value);
    }

    int edgeCount = in.readInt();

    for (int i = 0; i < edgeCount; i++) {
        Edge edge = in.readObject();
        edge.restoreSourceAndDest(nameToVertex);
        edges.add(edge);
    }

    verticesByIdentity.addAll(nameToVertex.values());
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:21,代码来源:DAG.java

示例7: readLogicalNodeTable

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Nonnull
static LogicalNodeTable readLogicalNodeTable(@Nonnegative int partitionId, @Nonnull ObjectDataInput in)
        throws IOException {

    SequencerDefinition definition = in.readObject();
    short size = in.readShort();

    Object[] assignmentTable = new Object[definition.getBoundedMaxLogicalNodeCount()];
    for (int i = 0; i < size; i++) {
        short index = in.readShort();
        Address address = new Address();
        address.readData(in);
        assignmentTable[index] = address;
    }
    return new LogicalNodeTable(partitionId, definition, assignmentTable);
}
 
开发者ID:noctarius,项目名称:snowcast,代码行数:17,代码来源:LogicalNodeTable.java

示例8: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Role read(ObjectDataInput in) throws IOException {
	Object[] entity = super.readEntity(in);
	String name = in.readUTF(); 
	String description = in.readUTF();
	List<Permission> perms = (List<Permission>) in.readObject();
	Set<String> roles = (Set<String>) in.readObject();
	Map<String, Permission> mPerms = new HashMap<String, Permission>(perms.size());
	for (Permission xpm: perms) {
		mPerms.put(xpm.getResource(), xpm);
	}

	Role xRole = new Role(
			(int) entity[0],
			(Date) entity[1],
			(String) entity[2],
			mPerms, 
			roles,
			name, 
			description);
	return xRole;
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:23,代码来源:RoleSerializer.java

示例9: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Expression read(ObjectDataInput in) throws IOException {
	int clnId = in.readInt();
	Comparison compType = Comparison.values()[in.readInt()];
	byte type = in.readByte();
	if (type == 0) {
		return new AlwaysExpression(clnId);
	} 
	PathBuilder path = in.readObject();
	if (type == 1) {
		return new BinaryExpression(clnId, compType, path);
	} else {
		return new PathExpression(clnId, compType, path, in.readUTF(), 
				(QueriedPath) in.readObject());
	}
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:17,代码来源:ExpressionSerializer.java

示例10: readDisassembled

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
private static CacheEntry readDisassembled(final ObjectDataInput in)
        throws IOException, IllegalAccessException, InvocationTargetException, InstantiationException {

    int length = in.readInt();
    Serializable[] disassembledState = new Serializable[length];
    for (int i = 0; i < length; i++) {
        disassembledState[i] = in.readObject();
    }

    String subclass = in.readUTF();
    boolean lazyPropertiesAreUnfetched = in.readBoolean();
    Object version = in.readObject();

    return CACHE_ENTRY_CONSTRUCTOR.newInstance(disassembledState, subclass, lazyPropertiesAreUnfetched, version);
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:16,代码来源:Hibernate5CacheEntrySerializer.java

示例11: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
    lock = in.readObject();
    newValue = in.readObject();
    newVersion = in.readObject();
    nextMarkerId = in.readUTF();
    timestamp = in.readLong();
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:9,代码来源:UpdateEntryProcessor.java

示例12: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(final ObjectDataInput in) throws IOException {
    lock = in.readObject();
    newValue = in.readObject();
    newVersion = in.readObject();
    nextMarkerId = in.readUTF();
    timestamp = in.readLong();
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:9,代码来源:UpdateEntryProcessor.java

示例13: createSerializer

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Serializer createSerializer() {
    return new StreamSerializer<TimestampedEntry>() {
        @Override
        public void write(ObjectDataOutput out, TimestampedEntry object) throws IOException {
            out.writeLong(object.getTimestamp());
            out.writeObject(object.getKey());
            out.writeObject(object.getValue());
        }

        @Override
        public TimestampedEntry read(ObjectDataInput in) throws IOException {
            long timestamp = in.readLong();
            Object key = in.readObject();
            Object value = in.readObject();
            return new TimestampedEntry<>(timestamp, key, value);
        }

        @Override
        public int getTypeId() {
            return SerializerHookConstants.TIMESTAMPED_ENTRY;
        }

        @Override
        public void destroy() {
        }
    };
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:29,代码来源:DataModelSerializerHooks.java

示例14: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
    oppositeVertexId = in.readInt();
    destOrdinal = in.readInt();
    sourceOrdinal = in.readInt();
    priority = in.readInt();
    isDistributed = in.readBoolean();
    routingPolicy = in.readObject();
    partitioner = CustomClassLoadedObject.read(in);
    config = in.readObject();
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:12,代码来源:EdgeDef.java

示例15: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
    vertices = readList(in);
    int len = in.readInt();
    partitionOwners = new Address[len];
    lastSnapshotId = in.readLong();
    for (int i = 0; i < len; i++) {
        partitionOwners[i] = in.readObject();
    }
    jobConfig = in.readObject();
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:12,代码来源:ExecutionPlan.java


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