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


Java ObjectDataInput.readUTF方法代码示例

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


在下文中一共展示了ObjectDataInput.readUTF方法的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,代码来源:Hibernate3CacheEntrySerializer.java

示例2: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
   @Override
   public MutableRepositoryItemExt read(ObjectDataInput in) throws IOException {
try {
    
    String gsonString = in.readUTF();  
    System.out.println("MutableRepositoryItemExtHazelcastSerializer deserialize " + System.currentTimeMillis() + " "  + gsonString);
	  
    Gson gson = new GsonBuilder().enableComplexMapKeySerialization().create();
 	    Map<String, Object> cache = gson.fromJson(gsonString, Map.class);

    String javaClassName = (String) cache.get("__class");
    String repositoryId = (String) cache.get("__repositoryId");
  
    Class beanClass = Class.forName(javaClassName);
    MutableRepositoryItemExt mutableRepositoryItemExt = ConstructorUtils.invokeExactConstructor(beanClass, null);
    mutableRepositoryItemExt.setRepositoryId(repositoryId);
    mutableRepositoryItemExt.setCachedData(cache);

    return mutableRepositoryItemExt;
} catch (Exception e) {
    throw new RuntimeException(e);
}
   }
 
开发者ID:varelma,项目名称:atg-generics,代码行数:25,代码来源:MutableRepositoryItemExtHazelcastSerializer.java

示例3: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
	clientId = in.readUTF();
	ip = in.readUTF();
	port = in.readInt();
	isConnected = in.readBoolean();
	currentMessageId = in.readInt();

	if (in.readBoolean()) {
		will = new Message(in);
	}

	cleanSession = in.readBoolean();
	keepAliveSeconds = in.readInt();

	long rawLong = in.readLong();
	createTime = rawLong != Long.MIN_VALUE ? new Date(rawLong) : null;

	rawLong = in.readLong();
	lastIncomingTime = rawLong != Long.MIN_VALUE ? new Date(rawLong) : null;

	disposeLock = ClusterDataFactory.INSTANCE.createLock("Session_disposeLock_" + clientId);
	messageSender = new MessageSender(this);
}
 
开发者ID:anyflow,项目名称:lannister,代码行数:25,代码来源:Session.java

示例4: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
  
  try 
  {
    //setIterationError(in.readDouble());
    //setMeanAbsErr(in.readDouble());
    //setRootMeanSqErr(in.readDouble());
    //setPctIncorrect(in.readDouble());
    //setFolds(in.readInt());
    setName(in.readUTF());
    classifierImpl = in.readUTF();
    deserializeClassifierFromJson(in.readUTF());
    setLongId(in.readLong());
    setStringId(in.readUTF());
    setGeneratedOn(in.readLong());
  } catch (Exception e) {
    throw new IOException(e);
  }
}
 
开发者ID:javanotes,项目名称:reactive-data,代码行数:21,代码来源:RegressionModel.java

示例5: 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

示例6: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Writable read(ObjectDataInput in) throws IOException {
    if (!warnedOnce) {
        LOGGER.warning("Using default Writable serialization without explicit type registration. " +
                "Consider explicit type registration using WritableSerializerHook.");
        warnedOnce = true;
    }
    String className = in.readUTF();
    try {
        Writable instance = ClassLoaderUtil.newInstance(Thread.currentThread().getContextClassLoader(), className);
        instance.readFields(in);
        return instance;
    } catch (Exception e) {
        throw rethrow(e);
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:17,代码来源:WritableSerializerHooks.java

示例7: 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

示例8: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public Document read(ObjectDataInput in) throws IOException {
	
	FragmentedDocument xDoc = new FragmentedDocument(
			in.readLong(),
			in.readUTF(),
			in.readUTF(),
			in.readLong(),
			in.readLong(),
			new java.util.Date(in.readLong()),
			in.readUTF(),
			in.readUTF(),
			in.readInt(),
			in.readInt());
	xDoc.setCollections(in.readIntArray());
	xDoc.setFragments(in.readLongArray());
	return xDoc;
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:19,代码来源:FragmentedDocumentSerializer.java

示例9: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
    id = in.readUTF();
    bookId = in.readUTF();
    cost = in.readDouble();
    quantity = in.readInt();
    inStock = in.readBoolean();
}
 
开发者ID:ivogm,项目名称:bookstore,代码行数:9,代码来源:BookCartItem.java

示例10: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
  this.clientId = in.readUTF();
  this.clientSecret = in.readUTF();
  this.clientType = Client.ClientTypeEnum.fromValue(in.readUTF());
  this.clientProfile = Client.ClientProfileEnum.fromValue(in.readUTF());
  this.clientName = in.readUTF();
  this.clientDesc = in.readUTF();
  this.ownerId = in.readUTF();
  this.scope = in.readUTF();
  this.redirectUri = in.readUTF();
  this.createDt = in.readObject();
  this.updateDt = in.readObject();
}
 
开发者ID:networknt,项目名称:light-oauth2,代码行数:15,代码来源:Client.java

示例11: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
  this.userId = in.readUTF();
  this.userType = User.UserTypeEnum.fromValue(in.readUTF());
  this.firstName = in.readUTF();
  this.lastName = in.readUTF();
  this.email = in.readUTF();
  this.password = in.readUTF();
  this.createDt = in.readObject();
  this.updateDt = in.readObject();
}
 
开发者ID:networknt,项目名称:light-oauth2,代码行数:12,代码来源:User.java

示例12: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(ObjectDataInput in) throws IOException {
	id = in.readInt();
	topicName = in.readUTF();
	publisherId = in.readUTF();
	message = in.readByteArray();

	int rawInt = in.readInt();
	qos = rawInt != Byte.MIN_VALUE ? MqttQoS.valueOf(rawInt) : null;

	isRetain = in.readBoolean();
}
 
开发者ID:anyflow,项目名称:lannister,代码行数:13,代码来源:Message.java

示例13: read

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public RemoteCommand read(ObjectDataInput objectDataInput) throws IOException {
    String commandJson = objectDataInput.readUTF();
    return CommandJson.fromString(commandJson, commandTypeMatcher, objectMapper)
            .map(RemoteCommand::processing)
            .orElseThrow(() -> new IllegalArgumentException("No command type matcher found for command " + commandJson));
}
 
开发者ID:opencredo,项目名称:concursus,代码行数:8,代码来源:RemoteCommandSerialiser.java

示例14: 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();
    Object version = in.readObject();

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

示例15: readData

import com.hazelcast.nio.ObjectDataInput; //导入方法依赖的package包/类
@Override
public void readData(final ObjectDataInput in) throws IOException {
    super.readData(in);
    concurrent = in.readBoolean();
    markerId = in.readUTF();
    multiplicity = in.readInt();
    timeout = in.readLong();
    expiredTimestamp = in.readLong();
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:10,代码来源:ExpiryMarker.java


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