org.apache.mina.filter.codec.ProtocolEncoder Java Examples

The following examples show how to use org.apache.mina.filter.codec.ProtocolEncoder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SizeTest.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@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 );
}
 
Example #2
Source File: HackedProtocolCodecFilter.java    From sailfish-core with Apache License 2.0 5 votes vote down vote up
/**
 * Dispose the encoder, removing its instance from the
 * session's attributes, and calling the associated
 * dispose method.
 */
private void disposeEncoder(IoSession session) {
    ProtocolEncoder encoder = (ProtocolEncoder) session.removeAttribute(ENCODER);
    if (encoder == null) {
        return;
    }

    try {
        encoder.dispose(session);
    } catch (Exception e) {
        LOGGER.warn("Failed to dispose: {} ({})", encoder.getClass().getName(), encoder);
    }
}
 
Example #3
Source File: CodecFactory.java    From sailfish-core with Apache License 2.0 5 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception	{
	
	AbstractCodec codec = codecs.get(session);
	
	if (codec != null) {
		return codec;
	}
	
	codec = codecClass.newInstance();
       codec.init(serviceContext, codecSettings, msgFactory, msgDictionary);
	codecs.putIfAbsent(session, codec);
	return codecs.get(session);
		
}
 
Example #4
Source File: WebSocketCodecFactory.java    From red5-websocket with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
    return encoder;
}
 
Example #5
Source File: CommandCodecFactory.java    From mina with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
    return encoder;
}
 
Example #6
Source File: SumkCodecFactory.java    From sumk with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
	return encoder;
}
 
Example #7
Source File: MinaCodecAdapter.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public ProtocolEncoder getEncoder() {
    return encoder;
}
 
Example #8
Source File: ImageCodecFactory.java    From javastruct with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ProtocolEncoder getEncoder() throws Exception {
    return encoder;
}
 
Example #9
Source File: RedisProtocolCodecFactory.java    From Redis-Synyed with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
	return redisProtocolEncoder;
}
 
Example #10
Source File: MapleCodecFactory.java    From mapleLemon with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
    return encoder;
}
 
Example #11
Source File: GameProtocolcodecFactory.java    From GameServer with Apache License 2.0 4 votes vote down vote up
public ProtocolEncoder getEncoder(IoSession session) {
	return encoder;
}
 
Example #12
Source File: MinaCodecAdapter.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public ProtocolEncoder getEncoder() {
    return encoder;
}
 
Example #13
Source File: GameProtocolcodecFactory.java    From TestClient with Apache License 2.0 4 votes vote down vote up
public ProtocolEncoder getEncoder(IoSession session) {
	return encoder;
}
 
Example #14
Source File: MapleCodecFactory.java    From HeavenMS with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
    return encoder;
}
 
Example #15
Source File: MinaCodecAdapter.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
public ProtocolEncoder getEncoder() {
    return encoder;
}
 
Example #16
Source File: TftpProtocolCodecFactory.java    From tftp4j with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public ProtocolEncoder getEncoder(@Nonnull IoSession session) {
    return TftpEncoder.INSTANCE;
}
 
Example #17
Source File: XMPPCodecFactory.java    From Openfire with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
    return encoder;
}
 
Example #18
Source File: WelderSensorCodec.java    From camelinaction with Apache License 2.0 4 votes vote down vote up
public ProtocolEncoder getEncoder() throws Exception {
    return new WelderEncoder();
}
 
Example #19
Source File: DhcpProtocolCodecFactory.java    From dhcp4j with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) {
    return encoder;
}
 
Example #20
Source File: RTMPCodecFactory.java    From red5-server-common with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
public ProtocolEncoder getEncoder(IoSession session) {
    return encoder;
}
 
Example #21
Source File: DhcpProtocolCodecFactory.java    From dhcp4j with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) {
    return encoder;
}
 
Example #22
Source File: RTMPMinaCodecFactory.java    From red5-client with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public ProtocolEncoder getEncoder(IoSession session) {
    return clientEncoder;
}
 
Example #23
Source File: AppMessageCodecFactory.java    From cim with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) {
	return encoder;
}
 
Example #24
Source File: WebMessageCodecFactory.java    From cim with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) {
	return encoder;
}
 
Example #25
Source File: MessageCodecFactory.java    From jforgame with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
	return encoder;
}
 
Example #26
Source File: DataCodecFactory.java    From oim-fx with MIT License 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) {
	return encoder;
}
 
Example #27
Source File: BytesDataFactory.java    From oim-fx with MIT License 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession session) {
	return encoder;
}
 
Example #28
Source File: DSCodecFactory.java    From CXTouch with GNU General Public License v3.0 4 votes vote down vote up
public ProtocolEncoder getEncoder(IoSession ioSession) throws Exception {
    return encoder;
}
 
Example #29
Source File: MyTextLineCodecFactory.java    From java-study with Apache License 2.0 4 votes vote down vote up
public ProtocolEncoder getEncoder(IoSession session) throws Exception {
    return new MyTextLineCodecEncoder(charset, delimiter);
}
 
Example #30
Source File: ITCHCodecFactory.java    From sailfish-core with Apache License 2.0 4 votes vote down vote up
@Override
public ProtocolEncoder getEncoder(IoSession ioSession) throws Exception {
    return itchHandler.getCodec(serviceContext);
}