當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。