开发者社区 问答 正文

Netty如何用spring管理

如题 请教netty用spring管理的用法

包括applicationContext.xml的配置 和class中的注入方式

希望哪位用过的兄弟能指导一下

不胜感激!

展开
收起
a123456678 2016-03-13 13:59:00 3109 分享 版权
1 条回答
写回答
取消 提交回答
  • <!-- netty config example -->
        <bean id="tcpServer" class="com.yixun.collector.server.NettyTCPServer" init-method="createServerBootstrap"
            destroy-method="stopServer">
            <property name="handshakePipelineFactory" ref="handshakePipelineFactory"></property>
        </bean>
     
        <bean id="handshakePipelineFactory" class="com.yixun.collector.server.HandshakePipelineFactory">
            <property name="handshakeHandler" ref="handshakeHandler"></property>
            <!-- <lookup-method name="createHandshakeHandler" bean="handshakeHandler" />
            <property name="stringDecoder" ref="stringDecoder"></property>
            <property name="stringEncoder" ref="stringEncoder"></property>
            <property name="nulEncoder" ref="nulEncoder"></property>
            <property name="frameSize" value="256"></property> -->
        </bean>
    2019-07-17 19:02:31
    赞同 展开评论
问答分类:
问答标签:
问答地址: