Example usage for io.netty.handler.codec.marshalling DefaultMarshallerProvider DefaultMarshallerProvider

List of usage examples for io.netty.handler.codec.marshalling DefaultMarshallerProvider DefaultMarshallerProvider

Introduction

In this page you can find the example usage for io.netty.handler.codec.marshalling DefaultMarshallerProvider DefaultMarshallerProvider.

Prototype

public DefaultMarshallerProvider(MarshallerFactory factory, MarshallingConfiguration config) 

Source Link

Document

Create a new instance

Usage

From source file:books.netty.codec.marshalling.MarshallingCodeCFactory.java

License:Apache License

/**
 * Jboss Marshalling?MarshallingEncoder//  w w  w.  ja v  a  2  s .c o m
 *
 * @return
 */
public static MarshallingEncoder buildMarshallingEncoder() {
    final MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("serial");
    final MarshallingConfiguration configuration = new MarshallingConfiguration();
    configuration.setVersion(5);
    MarshallerProvider provider = new DefaultMarshallerProvider(marshallerFactory, configuration);
    MarshallingEncoder encoder = new MarshallingEncoder(provider);
    return encoder;
}

From source file:com.netty.coder.MarshallingCodeCFactory.java

License:Apache License

/**
 * Jboss Marshalling?MarshallingEncoder/*from  w  ww  . ja  v a 2  s  .c o m*/
 * 
 * @return
 */
public static NettyMarshallingEncoder buildMarshallingEncoder() {
    final MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("serial");
    final MarshallingConfiguration configuration = new MarshallingConfiguration();
    configuration.setVersion(5);
    MarshallerProvider provider = new DefaultMarshallerProvider(marshallerFactory, configuration);
    NettyMarshallingEncoder encoder = new NettyMarshallingEncoder(provider);
    return encoder;
}

From source file:netty.codec.marshalling.MarshallingCodeCFactory.java

License:Apache License

/**
 * Jboss Marshalling?MarshallingEncoder//from  w  ww  .j  a v a  2  s.  co m
 *
 * @return
 */
public static MarshallingEncoder buildMarshallingEncoder() {
    final MarshallerFactory marshallerFactory = Marshalling.getProvidedMarshallerFactory("serial");
    final MarshallingConfiguration configuration = new MarshallingConfiguration();
    configuration.setVersion(5);
    MarshallerProvider provider = new DefaultMarshallerProvider(marshallerFactory, configuration);
    return new MarshallingEncoder(provider);
}