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


Java SerializationPolicy类代码示例

本文整理汇总了Java中com.google.gwt.user.server.rpc.SerializationPolicy的典型用法代码示例。如果您正苦于以下问题:Java SerializationPolicy类的具体用法?Java SerializationPolicy怎么用?Java SerializationPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: doGetSerializationPolicy

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
@Override
protected SerializationPolicy doGetSerializationPolicy(HttpServletRequest request, String moduleBaseURL, String strongName) {
	if (Config.SYSTEM_APACHE_REQUEST_HEADER_FIX) {
		// Get base url from the header instead of the body. This way
		// Apache reverse proxy with rewrite on header can work.
		// Suggested at http://stackoverflow.com/questions/1517290/problem-with-gwt-behind-a-reverse-proxy-either-nginx-or-apache
		// ProxyPass /app/ ajp://localhost:8009/OpenKM/
		// RequestHeader edit X-GWT-Module-Base ^(.*)/app/(.*)$ $1/OpenKM/$2
		String moduleBaseURLHdr = request.getHeader("X-GWT-Module-Base");
		log.debug("X-GWT-Module-Base: {}", moduleBaseURLHdr);

		if (moduleBaseURLHdr != null) {
			moduleBaseURL = moduleBaseURLHdr;
		}
	}

	return super.doGetSerializationPolicy(request, moduleBaseURL, strongName);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:19,代码来源:OKMRemoteServiceServlet.java

示例2: getSerializationPolicy

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
@Override
public SerializationPolicy getSerializationPolicy(String moduleBaseURL,
		String strongName) {
	SerializationPolicy serializationPolicy = null;
	synchronized (serializationPolicyCache) {
		serializationPolicy = serializationPolicyCache.get(moduleBaseURL
				+ strongName);
	}
	if (serializationPolicy != null) {
		return serializationPolicy;
	}
	serializationPolicy = loadSerializationPolicy(moduleBaseURL, strongName);
	if (serializationPolicy == null) {
		serializationPolicy = RPC.getDefaultSerializationPolicy();
	}
	serializationPolicyCache.put(moduleBaseURL + strongName,
			serializationPolicy);
	return serializationPolicy;
}
 
开发者ID:ctripcorp,项目名称:dataworks-zeus,代码行数:20,代码来源:RpcFilter.java

示例3: createCometServletResponse

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
private CometServletResponseImpl createCometServletResponse(HttpServletRequest request, HttpServletResponse response, SerializationPolicy serializationPolicy, ClientOracle clientOracle, int requestHeartbeat) {
	
	String accept = request.getHeader("Accept");
	String userAgent = request.getHeader("User-Agent");
	if ("text/event-stream".equals(accept)) {
		return new EventSourceCometServletResponse(request, response, serializationPolicy, clientOracle, this, async, requestHeartbeat);
	}
	else if ("application/comet".equals(accept)) {
		return new HTTPRequestCometServletResponse(request, response, serializationPolicy, clientOracle, this, async, requestHeartbeat);
	}
	else if (userAgent != null && userAgent.contains("Opera")) {
		return new OperaEventSourceCometServletResponse(request, response, serializationPolicy, clientOracle, this, async, requestHeartbeat);
	}
	else {
		return new IEHTMLFileCometServletResponse(request, response, serializationPolicy, clientOracle, this, async, requestHeartbeat);
	}
}
 
开发者ID:rzschech,项目名称:gwt-comet,代码行数:18,代码来源:CometServlet.java

示例4: ManagedStreamCometServletResponseImpl

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
public ManagedStreamCometServletResponseImpl(HttpServletRequest request, HttpServletResponse response, SerializationPolicy serializationPolicy, ClientOracle clientOracle, CometServlet servlet, AsyncServlet async, int heartbeat) {
	super(request, response, serializationPolicy, clientOracle, servlet, async, heartbeat);
	
	String paddingParameter = getRequest().getParameter("padding");
	if (paddingParameter != null) {
		paddingRequired = Integer.parseInt(paddingParameter);
	}
	else {
		paddingRequired = getPaddingRequired();
	}
	
	String lengthParameter = getRequest().getParameter("length");
	if (lengthParameter != null) {
		length = Integer.parseInt(lengthParameter);
	}
	else {
		length = 0;
	}
}
 
开发者ID:rzschech,项目名称:gwt-comet,代码行数:20,代码来源:ManagedStreamCometServletResponseImpl.java

示例5: serialize

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
public <T> String serialize(Class<? super T> clazz, T instance, SerializationPolicy serializationPolicy) throws SerializationException {
  if (instance == null) {
    return null;
  }else if(String.class.equals(clazz)){
    return (String) instance;
  }

  if (serializationPolicy == null) {
    throw new IllegalArgumentException("SerializationPolicy is null, please call StorageUtils.PolicyLoader.load(...) before");
  }

  ServerSerializationStreamWriter stream = new ServerSerializationStreamWriter(serializationPolicy);
  stream.setFlags(AbstractSerializationStream.DEFAULT_FLAGS);
  stream.prepareToWrite();
  if (clazz != void.class) {
    stream.serializeValue(instance, clazz);
  }
  return stream.toString();
}
 
开发者ID:seanchenxi,项目名称:gwt-storage,代码行数:20,代码来源:ServerStorageSerializer.java

示例6: SyncClientSerializationStreamWriter

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
public SyncClientSerializationStreamWriter(Serializer serializer,
		String moduleBaseURL, String serializationPolicyStrongName,
		SerializationPolicy serializationPolicy, RpcToken rpcToken) {
	this.serializer = serializer;
	this.moduleBaseURL = moduleBaseURL;
	this.serializationPolicyStrongName = serializationPolicyStrongName;
	this.serializationPolicy = serializationPolicy;
	this.rpcToken = rpcToken;
	if (rpcToken != null) {
		addFlags(FLAG_RPC_TOKEN_INCLUDED);
	}
}
 
开发者ID:jcricket,项目名称:gwt-syncproxy,代码行数:13,代码来源:SyncClientSerializationStreamWriter.java

示例7: doGetSerializationPolicy

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
/**
 * Attempt to load the RPC serialization policy normally. If it isn't found,
 * try loading it using the context path instead of the URL.
 */
@Override
protected SerializationPolicy doGetSerializationPolicy(HttpServletRequest request, String moduleBaseURL, String strongName)
{
    SerializationPolicy policy = super.doGetSerializationPolicy(request, moduleBaseURL, strongName);
    if(policy == null) {
        return SerializationPolicyUtil.loadSerializationPolicy(this, request, moduleBaseURL, strongName);
    } else {
        return policy;
    }
}
 
开发者ID:alfameCom,项目名称:salasanasiilo,代码行数:15,代码来源:WPSXsrfProtectedServiceServlet.java

示例8: invokeAndEncodeResponse

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
public static String invokeAndEncodeResponse(Object target,
                                             Method serviceMethod,
                                             Object[] args,
                                             SerializationPolicy serializationPolicy)
    throws SerializationException {
  return invokeAndEncodeResponse(target, serviceMethod, args, serializationPolicy,
      AbstractSerializationStream.DEFAULT_FLAGS);
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:9,代码来源:RpcHelper.java

示例9: CometServletResponseImpl

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
protected CometServletResponseImpl(HttpServletRequest request, HttpServletResponse response, SerializationPolicy serializationPolicy, ClientOracle clientOracle, CometServlet servlet, AsyncServlet async, int heartbeat) {
	this.request = request;
	this.response = response;
	this.serializationPolicy = serializationPolicy;
	this.clientOracle = clientOracle;
	this.servlet = servlet;
	this.async = async;
	this.heartbeat = heartbeat;
}
 
开发者ID:rzschech,项目名称:gwt-comet,代码行数:10,代码来源:CometServletResponseImpl.java

示例10: load

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
public static void load(InputStream is, String moduleName, boolean isDefault) throws IOException, ParseException {
  SerializationPolicy serializationPolicy = SerializationPolicyLoader.loadFromStream(is, null);
  synchronized (StorageUtils.StorageUtilsHolder.SERIALIZATION_POLICY_CACHE) {
    boolean shouldDefault = StorageUtils.StorageUtilsHolder.SERIALIZATION_POLICY_CACHE.isEmpty();
    StorageUtils.StorageUtilsHolder.SERIALIZATION_POLICY_CACHE.put(moduleName, serializationPolicy);
    if (isDefault || shouldDefault) {
      StorageUtils.StorageUtilsHolder.SERIALIZATION_POLICY_CACHE.put(DEFAULT_POLICY_MODULE, serializationPolicy);
    }
  }
}
 
开发者ID:seanchenxi,项目名称:gwt-storage,代码行数:11,代码来源:StorageUtils.java

示例11: deserialize

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
public static <T> T deserialize(Class<? super T> clazz, String serializedString, String moduleName) throws SerializationException {
  if(clazz == null || serializedString == null){
    return null;
  }
  SerializationPolicy policy;
  synchronized (StorageUtilsHolder.SERIALIZATION_POLICY_CACHE) {
    String _mn = (moduleName != null && !moduleName.trim().isEmpty()) ? moduleName.trim() : DEFAULT_POLICY_MODULE;
    policy = StorageUtilsHolder.SERIALIZATION_POLICY_CACHE.get(_mn);
  }
  if (policy == null) policy = RPC.getDefaultSerializationPolicy();
  return StorageUtilsHolder.SERIALIZER.deserialize(clazz, serializedString, policy);
}
 
开发者ID:seanchenxi,项目名称:gwt-storage,代码行数:13,代码来源:StorageUtils.java

示例12: serialize

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
public static <T> String serialize(Class<? super T> clazz, T instance, String moduleName) throws SerializationException {
  if(clazz == null || instance == null){
    return null;
  }
  SerializationPolicy policy;
  synchronized (StorageUtilsHolder.SERIALIZATION_POLICY_CACHE) {
    String _mn = (moduleName != null && !moduleName.trim().isEmpty()) ? moduleName.trim() : DEFAULT_POLICY_MODULE;
    policy = StorageUtilsHolder.SERIALIZATION_POLICY_CACHE.get(_mn);
  }
  if (policy == null) policy = RPC.getDefaultSerializationPolicy();
  return serialize(clazz, instance, policy);
}
 
开发者ID:seanchenxi,项目名称:gwt-storage,代码行数:13,代码来源:StorageUtils.java

示例13: SyncClientSerializationStreamReader

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
public SyncClientSerializationStreamReader(
		SerializationPolicy serializationPolicy) {
	this.serializationPolicy = serializationPolicy;
}
 
开发者ID:jcricket,项目名称:gwt-syncproxy,代码行数:5,代码来源:SyncClientSerializationStreamReader.java

示例14: invokeAndEncodeResponse

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
public static String invokeAndEncodeResponse(Object target, Method serviceMethod, Object[] args,
    SerializationPolicy serializationPolicy) throws SerializationException {
  return invokeAndEncodeResponse(target, serviceMethod, args, serializationPolicy,
      AbstractSerializationStream.DEFAULT_FLAGS);
}
 
开发者ID:kaaproject,项目名称:sandbox-frame,代码行数:6,代码来源:RPCHelper.java

示例15: getPolicy

import com.google.gwt.user.server.rpc.SerializationPolicy; //导入依赖的package包/类
public static SerializationPolicy getPolicy()
{
  return s_policy;
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:5,代码来源:FmgSerializationPolicy.java


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