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


Java AbstractHessianOutput.writeInt方法代码示例

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


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

示例1: writeObject

import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
    if(out.addRef(obj)) {
        return;
    }
    @SuppressWarnings("unchecked")
    SoftReference<Object> data=(SoftReference<Object>)obj;

    int refV=out.writeObjectBegin(SoftReference.class.getName());

    if(refV == -1) {
        out.writeInt(1);
        out.writeString("ref");
        out.writeObjectBegin(SoftReference.class.getName());
    }
    if(data != null) {
        Object ref=data.get();
        if(null != ref) {
            out.writeObject(ref);
        } else {
            out.writeNull();
        }
    } else {
        out.writeNull();
    }
}
 
开发者ID:hailin0,项目名称:pagecache-parent,代码行数:27,代码来源:SoftReferenceSerializer.java

示例2: writeObject

import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
    if(out.addRef(obj)) {
        return;
    }
    @SuppressWarnings("unchecked")
    WeakReference<Object> data=(WeakReference<Object>)obj;

    int refV=out.writeObjectBegin(WeakReference.class.getName());

    if(refV == -1) {
        out.writeInt(1);
        out.writeString("ref");
        out.writeObjectBegin(WeakReference.class.getName());
    }
    if(data != null) {
        Object ref=data.get();
        if(null != ref) {
            out.writeObject(ref);
        } else {
            out.writeNull();
        }
    } else {
        out.writeNull();
    }
}
 
开发者ID:qiujiayu,项目名称:AutoLoadCache,代码行数:27,代码来源:WeakReferenceSerializer.java

示例3: writeObject

import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
	if (obj == null)
		out.writeNull();
	else {
		Class<?> cl = obj.getClass();

		if (out.addRef(obj)) return;

		int ref = out.writeObjectBegin(cl.getName());

		Pageable dest = (Pageable) obj;

		if (ref < -1) {
			out.writeString("value");
			write(out, dest);
			out.writeMapEnd();
		}
		else {
			if (ref == -1) {
				out.writeInt(1);
				out.writeString("value");
				out.writeObjectBegin(cl.getName());
			}

			write(out, dest);
		}
	}
}
 
开发者ID:5waynewang,项目名称:commons-jkit,代码行数:30,代码来源:PageableSerializer.java

示例4: writeObject

import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
	if (obj == null)
		out.writeNull();
	else {
		Class<?> cl = obj.getClass();

		if (out.addRef(obj)) return;

		int ref = out.writeObjectBegin(cl.getName());

		Sort.Order order = (Sort.Order) obj;

		if (ref < -1) {
			out.writeString("value");
			write(out, order);
			out.writeMapEnd();
		}
		else {
			if (ref == -1) {
				out.writeInt(1);
				out.writeString("value");
				out.writeObjectBegin(cl.getName());
			}

			write(out, order);
		}
	}
}
 
开发者ID:5waynewang,项目名称:commons-jkit,代码行数:30,代码来源:OrderSerializer.java

示例5: writeObject

import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
	if (obj == null)
		out.writeNull();
	else {
		Class<?> cl = obj.getClass();

		if (out.addRef(obj)) return;

		int ref = out.writeObjectBegin(cl.getName());

		Sort dest = (Sort) obj;

		if (ref < -1) {
			out.writeString("value");
			write(out, dest);
			out.writeMapEnd();
		}
		else {
			if (ref == -1) {
				out.writeInt(1);
				out.writeString("value");
				out.writeObjectBegin(cl.getName());
			}

			write(out, dest);
		}
	}
}
 
开发者ID:5waynewang,项目名称:commons-jkit,代码行数:30,代码来源:SortSerializer.java

示例6: writeObject

import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, final AbstractHessianOutput out) throws IOException {
	try {
		if (out.addRef(obj)) {
			return;
		}

           Transcribable transcribable = (Transcribable) obj;
           ServiceVersion serviceVersion = transcribable.getServiceVersion();
		Class clazz = obj.getClass();

           String classNameToWrite = clazz.getName();
           // if we're talking to an older version we need to migrate vMajor to vMajor_Minor
           if (!transcriptionParams.contains(TranscribableParams.MajorOnlyPackageNaming)) {
               // look for vMajor
               classNameToWrite = ClassnameCompatibilityMapper.toMajorMinorPackaging(clazz, serviceVersion);
           }
		int ref = out.writeObjectBegin(classNameToWrite);

           // true if the object has already been defined
		if (ref >= 0) {
			transcribe(out,transcribable, client);
		}
		else  {
			Parameter[] parameters =  transcribable.getParameters();
			out.writeInt(parameters.length);
			for (int i=0; i < parameters.length; i++) {
				out.writeString(parameters[i].getName());
			}
			out.writeObjectBegin(classNameToWrite);
			transcribe(out,transcribable, client);
		}
	}
	catch (Exception e) {
		throw new IOException(e);
	}


}
 
开发者ID:betfair,项目名称:cougar,代码行数:40,代码来源:TranscribableSerialiser.java

示例7: writeObject

import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
	if (obj == null) {
		out.writeNull();
	} else {
		if (out.addRef(obj)) {
			return;
		}

		Class<?> cl = obj.getClass();

		int ref = out.writeObjectBegin(cl.getName());

		if (ref < -1) {
			out.writeString("value");
			out.writeString(jodaObjectToString(obj));
			out.writeMapEnd();
		} else {
			if (ref == -1) {
				out.writeInt(1);
				out.writeString("value");
				out.writeObjectBegin(cl.getName());
			}

			out.writeString(jodaObjectToString(obj));
		}
	}
}
 
开发者ID:MaddHacker,项目名称:serialization-common,代码行数:29,代码来源:AbstractJodaSerializer.java

示例8: write

import com.caucho.hessian.io.AbstractHessianOutput; //导入方法依赖的package包/类
void write(AbstractHessianOutput out, Pageable dest) throws IOException {
	out.writeInt(dest.getPageNumber());
	out.writeInt(dest.getPageSize());
	out.writeObject(dest.getSort());
}
 
开发者ID:5waynewang,项目名称:commons-jkit,代码行数:6,代码来源:PageableSerializer.java


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