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


Java ProtocolEncoder类代码示例

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


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

示例1: test1

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
@Test
public void test1 () throws Exception
{
    final DataGenerator dg = new DataGenerator ( new HashSet<String> ( Arrays.asList ( "AVG", "MIN", "MAX" ) ), 1200 );
    final UpdateQueryData message = dg.createData ();

    final ProtocolEncoder encoder = new ObjectSerializationEncoder ();
    testEncoder ( encoder, message );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:10,代码来源:SizeTest.java

示例2: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
@Override
public ProtocolEncoder getEncoder(IoSession ioSession) throws Exception
{
    if(mProtocolEncoder == null)
    {
        mProtocolEncoder = new IcecastEncoder();
    }

    return mProtocolEncoder;
}
 
开发者ID:DSheirer,项目名称:sdrtrunk,代码行数:11,代码来源:IcecastCodecFactory.java

示例3: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
@Override
public ProtocolEncoder getEncoder(IoSession ioSession) throws Exception
{
    if(mEncoder == null)
    {
        mEncoder = new UltravoxEncoder();
    }

    return mEncoder;
}
 
开发者ID:DSheirer,项目名称:sdrtrunk,代码行数:11,代码来源:UltravoxProtocolFactory.java

示例4: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
	MinaEncoder minaEncoder = null;
	Object value = session.getAttribute(ENCODER_ATTRIBUTE);
	if (value != null && value instanceof MinaEncoder)
		minaEncoder = (MinaEncoder) value;
	if (minaEncoder == null) {
		minaEncoder = new MinaEncoder(codecFactory.getEncoder());
		session.setAttribute(ENCODER_ATTRIBUTE, minaEncoder);
	}
	return minaEncoder;
}
 
开发者ID:ugcs,项目名称:ugcs-java-sdk,代码行数:13,代码来源:MinaCodecFactory.java

示例5: filterWrite

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
@Override
public void filterWrite(NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception {
    Object message = writeRequest.getMessage();
    ProtocolEncoder encoder = getEncoder(session);
    ProtocolEncoderOutput encoderOut = new DirectOutput(session, nextFilter, writeRequest);
    try {
        encoder.encode(session, message, encoderOut);
        nextFilter.filterWrite(session, new EndOfMessage(writeRequest));
    } catch (ProtocolEncoderException e) {
        throw e;
    } catch (Throwable t) {
        throw new ProtocolEncoderException(t);
    }
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:15,代码来源:RTMPChannelFilter.java

示例6: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
@Override
public ProtocolEncoder getEncoder(IoSession arg0) throws Exception {
	return encoder;
}
 
开发者ID:kingston-csj,项目名称:jforgame,代码行数:5,代码来源:MessageCodecFactory.java

示例7: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
    return msgEncoder;
}
 
开发者ID:altiplanogao,项目名称:io-comparison,代码行数:5,代码来源:MsgCodecFactory.java

示例8: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
public ProtocolEncoder getEncoder() {
    return encoder;
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:4,代码来源:MinaCodecAdapter.java

示例9: ModbusRtuProtocolCodecFilter

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
public ModbusRtuProtocolCodecFilter ( final ProtocolEncoder encoder, final ModbusRtuDecoder decoder )
{
    super ( encoder, decoder );
    this.decoder = decoder;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:6,代码来源:ModbusRtuProtocolCodecFilter.java

示例10: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
public ProtocolEncoder getEncoder(IoSession session) {
    return encoder;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:4,代码来源:ObjectSerializationCodecFactory.java

示例11: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
    return encoder;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:7,代码来源:DemuxingProtocolCodecFactory.java

示例12: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
    return encoder;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:4,代码来源:PrefixedStringCodecFactory.java

示例13: testEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
private void testEncoder ( final ProtocolEncoder encoder, final Object message ) throws Exception
{
    final TestingOutput output = new TestingOutput ();
    encoder.encode ( null, message, output );
    System.out.println ( String.format ( "Encoder %s: %s bytes", encoder, output.getSize () ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:7,代码来源:SizeTest.java

示例14: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
public ProtocolEncoder getEncoder() throws Exception {
    return encoder;
}
 
开发者ID:NovaStory,项目名称:AeroStory,代码行数:4,代码来源:GMCodecFactory.java

示例15: getEncoder

import org.apache.mina.filter.codec.ProtocolEncoder; //导入依赖的package包/类
@Override
public ProtocolEncoder getEncoder() throws Exception {
    return encoder;
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:5,代码来源:MapleCodecFactory.java


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