Search in sources :

Example 1 with ProtocolCodecFilter

use of org.apache.mina.filter.codec.ProtocolCodecFilter in project camel by apache.

the class Mina2Producer method addCodecFactory.

private void addCodecFactory(IoService service, ProtocolCodecFactory codecFactory) {
    LOG.debug("addCodecFactory name: {}", codecFactory.getClass().getName());
    service.getFilterChain().addLast("codec", new ProtocolCodecFilter(codecFactory));
}
Also used : ProtocolCodecFilter(org.apache.mina.filter.codec.ProtocolCodecFilter)

Example 2 with ProtocolCodecFilter

use of org.apache.mina.filter.codec.ProtocolCodecFilter in project opennms by OpenNMS.

the class HttpDetector method contructDefaults.

private void contructDefaults() {
    setProtocolCodecFilter(new ProtocolCodecFilter(new HttpProtocolCodecFactory()));
    setUrl(DEFAULT_URL);
    setMaxRetCode(DEFAULT_MAX_RET_CODE);
}
Also used : HttpProtocolCodecFactory(org.opennms.netmgt.provision.support.codec.HttpProtocolCodecFactory) ProtocolCodecFilter(org.apache.mina.filter.codec.ProtocolCodecFilter)

Example 3 with ProtocolCodecFilter

use of org.apache.mina.filter.codec.ProtocolCodecFilter in project bigbluebutton by bigbluebutton.

the class DeskShareServer method start.

public void start() {
    acceptor = new NioSocketAcceptor();
    acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ScreenCaptureProtocolCodecFactory()));
    acceptor.setHandler(screenCaptureHandler);
    acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, 10);
    acceptor.setReuseAddress(true);
    try {
        acceptor.bind(new InetSocketAddress(port));
    } catch (IOException e) {
        log.error("IOException while binding to port {}", port);
    }
}
Also used : InetSocketAddress(java.net.InetSocketAddress) IOException(java.io.IOException) ProtocolCodecFilter(org.apache.mina.filter.codec.ProtocolCodecFilter) NioSocketAcceptor(org.apache.mina.transport.socket.nio.NioSocketAcceptor)

Example 4 with ProtocolCodecFilter

use of org.apache.mina.filter.codec.ProtocolCodecFilter in project bigbluebutton by bigbluebutton.

the class DeskShareServer method start.

public void start() {
    acceptor = new NioSocketAcceptor();
    acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ScreenCaptureProtocolCodecFactory()));
    acceptor.setHandler(screenCaptureHandler);
    acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, 10);
    acceptor.setReuseAddress(true);
    try {
        acceptor.bind(new InetSocketAddress(port));
    } catch (IOException e) {
        log.error("IOException while binding to port {}", port);
    }
}
Also used : InetSocketAddress(java.net.InetSocketAddress) IOException(java.io.IOException) ProtocolCodecFilter(org.apache.mina.filter.codec.ProtocolCodecFilter) NioSocketAcceptor(org.apache.mina.transport.socket.nio.NioSocketAcceptor)

Example 5 with ProtocolCodecFilter

use of org.apache.mina.filter.codec.ProtocolCodecFilter in project pancm_project by xuwujing.

the class ClientTestServer method creatClient.

public IoConnector creatClient() {
    IoConnector connector = new NioSocketConnector();
    connector.setConnectTimeoutMillis(30000);
    connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
    connector.setHandler(new MinaClientHandler());
    return connector;
}
Also used : NioSocketConnector(org.apache.mina.transport.socket.nio.NioSocketConnector) MinaClientHandler(com.pancm.test.minatest.demo.MinaClientHandler) ObjectSerializationCodecFactory(org.apache.mina.filter.codec.serialization.ObjectSerializationCodecFactory) IoConnector(org.apache.mina.core.service.IoConnector) ProtocolCodecFilter(org.apache.mina.filter.codec.ProtocolCodecFilter)

Aggregations

ProtocolCodecFilter (org.apache.mina.filter.codec.ProtocolCodecFilter)27 InetSocketAddress (java.net.InetSocketAddress)15 NioSocketAcceptor (org.apache.mina.transport.socket.nio.NioSocketAcceptor)9 IOException (java.io.IOException)6 IoSession (org.apache.mina.core.session.IoSession)4 TextLineCodecFactory (org.apache.mina.filter.codec.textline.TextLineCodecFactory)4 DnsProtocolHandler (org.apache.directory.server.dns.protocol.DnsProtocolHandler)3 UdpTransport (org.apache.directory.server.protocol.shared.transport.UdpTransport)3 ObjectSerializationCodecFactory (org.apache.mina.filter.codec.serialization.ObjectSerializationCodecFactory)3 DatagramSessionConfig (org.apache.mina.transport.socket.DatagramSessionConfig)3 SocketAcceptor (org.apache.mina.transport.socket.nio.SocketAcceptor)3 SocketAcceptorConfig (org.apache.mina.transport.socket.nio.SocketAcceptorConfig)3 NamedThreadFactory (com.alibaba.dubbo.common.utils.NamedThreadFactory)2 Charset (java.nio.charset.Charset)2 DnsException (org.apache.directory.server.dns.DnsException)2 NamedThreadFactory (org.apache.dubbo.common.utils.NamedThreadFactory)2 DefaultIoFilterChainBuilder (org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder)2 ConnectFuture (org.apache.mina.core.future.ConnectFuture)2 IoAcceptor (org.apache.mina.core.service.IoAcceptor)2 IoConnector (org.apache.mina.core.service.IoConnector)2