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


Java SerializationContext.setDeserializationValidator方法代码示例

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


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

示例1: setThreadLocals

import flex.messaging.io.SerializationContext; //导入方法依赖的package包/类
/**
 *
 */
public void setThreadLocals()
{
    if (serializationContext != null)
    {
        SerializationContext context = (SerializationContext)serializationContext.clone();
        // Get the latest deserialization validator from the broker.
        MessageBroker broker = getMessageBroker();
        DeserializationValidator validator = broker == null? null : broker.getDeserializationValidator();
        context.setDeserializationValidator(validator);
        SerializationContext.setSerializationContext(context);
    }

    TypeMarshallingContext.setTypeMarshaller(getTypeMarshaller());
}
 
开发者ID:apache,项目名称:flex-blazeds,代码行数:18,代码来源:AbstractEndpoint.java

示例2: setUp

import flex.messaging.io.SerializationContext; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    ClassDeserializationValidator classDeserializationValidator = new ClassDeserializationValidator();
    classDeserializationValidator.addAllowClassPattern("flex.messaging.io.amfx.testtypes.*");
    serializationContext = new SerializationContext();
    serializationContext.setDeserializationValidator(classDeserializationValidator);
    SerializationContext.setSerializationContext(serializationContext);
    //trace = new AmfTrace();
}
 
开发者ID:apache,项目名称:flex-blazeds,代码行数:10,代码来源:AmfxSerializationTest.java

示例3: deserializateRequest

import flex.messaging.io.SerializationContext; //导入方法依赖的package包/类
private void deserializateRequest(DeserializationValidator validator) {
    try {
        // Find sample AMF data, or read the default file.
        String sample = System.getProperty("AMF_SAMPLE_FILE");
        if (sample == null || sample.length() < 1)
            sample = "amf_request.xml";

        URL resource = ClassLoader.getSystemResource(sample);
        URI uri = new URI(resource.toString());
        File testData = new File(uri.getPath());
        String testDataLocation = testData.getCanonicalPath();

        // Generate sample AMF request from the data file.
        PipedOutputStream pout = new PipedOutputStream();
        DataOutputStream dout = new DataOutputStream(pout);

        DataInputStream din = new DataInputStream(new PipedInputStream(pout));

        AmfTrace trace = new AmfTrace();
        trace.startResponse("Serializing AMF/HTTP response");

        MessageGenerator gen = new MessageGenerator();
        gen.setDebugTrace(trace);
        gen.setOutputStream(dout);
        gen.parse(testDataLocation);
        trace.endMessage();
        trace.newLine();

        // Create a deserializer for sample AMF request.
        ActionContext context = new ActionContext();
        ActionMessage message = new ActionMessage();
        context.setRequestMessage(message);

        SerializationContext dsContext = SerializationContext.getSerializationContext();
        if (validator != null)
            dsContext.setDeserializationValidator(validator);
        MessageDeserializer deserializer = new AmfMessageDeserializer();
        deserializer.initialize(dsContext, din, trace);
        deserializer.readMessage(message, context);
        trace.endMessage();
        trace.newLine();

        //if (UnitTrace.debug) // Print trace output.
        //    System.out.print(trace.toString());
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail();
    }
}
 
开发者ID:apache,项目名称:flex-blazeds,代码行数:50,代码来源:AmfDeserializationValidatorTest.java


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