本文整理汇总了Java中com.hazelcast.nio.ObjectDataOutput.writeObject方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectDataOutput.writeObject方法的具体用法?Java ObjectDataOutput.writeObject怎么用?Java ObjectDataOutput.writeObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.nio.ObjectDataOutput
的用法示例。
在下文中一共展示了ObjectDataOutput.writeObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(ObjectDataOutput out, CacheEntry object)
throws IOException {
try {
Serializable[] disassembledState = (Serializable[]) UNSAFE.getObject(object, DISASSEMBLED_STATE_OFFSET);
String subclass = (String) UNSAFE.getObject(object, SUBCLASS_OFFSET);
boolean lazyPropertiesAreUnfetched = UNSAFE.getBoolean(object, LAZY_PROPERTIES_ARE_UNFETCHED);
Object version = UNSAFE.getObject(object, VERSION_OFFSET);
out.writeInt(disassembledState.length);
for (Serializable state : disassembledState) {
out.writeObject(state);
}
out.writeUTF(subclass);
out.writeBoolean(lazyPropertiesAreUnfetched);
out.writeObject(version);
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException(e);
}
}
示例2: write
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(ObjectDataOutput out, CacheKey object)
throws IOException {
try {
Object key = UNSAFE.getObject(object, KEY_OFFSET);
Type type = (Type) UNSAFE.getObject(object, TYPE_OFFSET);
String entityOrRoleName = (String) UNSAFE.getObject(object, ENTITY_OR_ROLE_NAME_OFFSET);
String tenantId = (String) UNSAFE.getObject(object, TENANT_ID_OFFSET);
int hashCode = UNSAFE.getInt(object, HASH_CODE_OFFSET);
out.writeObject(key);
out.writeObject(type);
out.writeUTF(entityOrRoleName);
out.writeUTF(tenantId);
out.writeInt(hashCode);
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
}
throw new IOException(e);
}
}
示例3: createSerializer
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public Serializer createSerializer() {
return new StreamSerializer<Tuple2>() {
@Override
public void write(ObjectDataOutput out, Tuple2 t) throws IOException {
out.writeObject(t.f0());
out.writeObject(t.f1());
}
@Override
public Tuple2 read(ObjectDataInput in) throws IOException {
return tuple2(in.readObject(), in.readObject());
}
@Override
public int getTypeId() {
return SerializerHookConstants.TUPLE2;
}
@Override
public void destroy() {
}
};
}
示例4: createSerializer
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的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());
}
};
}
示例5: createSerializer
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public Serializer createSerializer() {
return new StreamSerializer<Entry>() {
@Override
public int getTypeId() {
return SerializerHookConstants.MAP_ENTRY;
}
@Override
public void write(ObjectDataOutput out, Entry object) throws IOException {
out.writeObject(object.getKey());
out.writeObject(object.getValue());
}
@Override
public Entry read(ObjectDataInput in) throws IOException {
return entry(in.readObject(), in.readObject());
}
@Override
public void destroy() {
}
};
}
示例6: write
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(ObjectDataOutput out, XQSequence sequence) throws IOException {
try {
List<XQItemAccessor> items;
synchronized (sequence) {
if (sequence.isScrollable()) {
sequence.beforeFirst();
items = new ArrayList<>(sequence.count());
} else {
items = new ArrayList<>();
}
while (sequence.next()) {
Object value = sequence.getObject();
if (value instanceof XQItemAccessor) {
items.add((XQItemAccessor) value);
} else {
items.add(sequence.getItem());
}
}
}
logger.trace("write; writing items: {}", items);
out.writeObject(items);
} catch (XQException ex) {
throw new IOException(ex);
}
}
示例7: writeLogicalNodeTable
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
static void writeLogicalNodeTable(@Nonnull LogicalNodeTable logicalNodeTable, @Nonnull ObjectDataOutput out)
throws IOException {
out.writeObject(logicalNodeTable.definition);
Object[] assignmentTable = logicalNodeTable.assignmentTable;
int length = assignmentTable.length;
int size = 0;
for (int i = 0; i < length; i++) {
if (assignmentTable[i] != null) {
size++;
}
}
out.writeShort(size);
for (int i = 0; i < length; i++) {
Address address = (Address) assignmentTable[i];
if (address != null) {
out.writeShort(i);
address.writeData(out);
}
}
}
示例8: write
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void write(ObjectDataOutput out, Function xFunc) throws IOException {
out.writeUTF(xFunc.getClassName());
out.writeUTF(xFunc.getMethod());
out.writeObject(xFunc.getResult());
out.writeUTF(xFunc.getDescription());
out.writeUTF(xFunc.getPrefix());
out.writeInt(xFunc.getParameters().size());
for (Parameter xp: xFunc.getParameters()) {
out.writeObject(xp);
}
out.writeInt(xFunc.getAnnotations().size());
for (Map.Entry<String, List<String>> entry: xFunc.getAnnotations().entrySet()) {
out.writeUTF(entry.getKey());
out.writeInt(entry.getValue().size());
for (String value: entry.getValue()) {
out.writeUTF(value);
}
}
}
示例9: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void writeData(ObjectDataOutput out) throws IOException {
super.writeData(out);
boolean compress = Boolean.parseBoolean(context.getProperty(pn_document_compress, "false"));
String format = context.getProperty(pn_document_data_format);
if (format != null) {
ContentSerializer cs = repo.getSerializer(format);
if (cs != null) {
if (compress) {
writeCompressedContent(getSerializationService(), out, cs, content);
} else {
cs.writeContent(out, content);
}
return;
}
}
if (compress) {
writeCompressedData(getSerializationService(), out, content);
} else {
out.writeObject(content);
}
}
示例10: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeUTF(this.serviceId);
out.writeUTF(this.serviceType.toString());
out.writeUTF(this.serviceName);
out.writeUTF(this.serviceDesc);
out.writeUTF(this.ownerId);
out.writeUTF(this.scope);
out.writeObject(this.createDt);
out.writeObject(this.updateDt);
}
示例11: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeUTF(this.userId);
out.writeUTF(this.userType.toString());
out.writeUTF(this.firstName);
out.writeUTF(this.lastName);
out.writeUTF(this.email);
out.writeUTF(this.password);
out.writeObject(this.createDt);
out.writeObject(this.updateDt);
}
示例12: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput objectDataOutput) throws IOException {
objectDataOutput.writeLong(creationTime);
objectDataOutput.writeLong(lastAccessedTime);
objectDataOutput.writeInt(maxInactiveInterval);
objectDataOutput.writeBoolean(isNew);
objectDataOutput.writeBoolean(isValid);
objectDataOutput.writeLong(thisAccessedTime);
objectDataOutput.writeObject(id);
serializeMap(getAttributes(), objectDataOutput);
serializeMap(notes, objectDataOutput);
}
示例13: writeDisassembled
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
private static void writeDisassembled(ObjectDataOutput out, CacheEntry object)
throws IOException {
Serializable[] disassembledState = object.getDisassembledState();
out.writeInt(disassembledState.length);
for (Serializable state : disassembledState) {
out.writeObject(state);
}
out.writeUTF(object.getSubclass());
out.writeBoolean(object.areLazyPropertiesUnfetched());
out.writeObject(object.getVersion());
}
示例14: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(ObjectDataOutput out) throws IOException {
out.writeObject(id);
out.writeUTF(entityOrRoleName);
out.writeUTF(tenantId);
out.writeObject(type);
out.writeInt(hashCode);
}
示例15: writeData
import com.hazelcast.nio.ObjectDataOutput; //导入方法依赖的package包/类
@Override
public void writeData(final ObjectDataOutput out) throws IOException {
out.writeObject(lock);
out.writeObject(newValue);
out.writeObject(newVersion);
out.writeUTF(nextMarkerId);
out.writeLong(timestamp);
}