This commit is contained in:
crusader 2018-04-29 20:28:04 +09:00
parent 1ed55320c6
commit 70e3c93d3f
2 changed files with 10 additions and 6 deletions

View File

@ -22,6 +22,7 @@
<overflow.commons-java.version>1.0.0-SNAPSHOT</overflow.commons-java.version> <overflow.commons-java.version>1.0.0-SNAPSHOT</overflow.commons-java.version>
<overflow.crawler-java.version>1.0.0-SNAPSHOT</overflow.crawler-java.version> <overflow.crawler-java.version>1.0.0-SNAPSHOT</overflow.crawler-java.version>
<jackson.mapper.version>1.9.13</jackson.mapper.version>
<netty.version>4.1.24.Final</netty.version> <netty.version>4.1.24.Final</netty.version>
<spring.version>5.0.5.RELEASE</spring.version> <spring.version>5.0.5.RELEASE</spring.version>
</properties> </properties>
@ -48,6 +49,12 @@
<version>${overflow.crawler-java.version}</version> <version>${overflow.crawler-java.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.mapper.version}</version>
</dependency>
<dependency> <dependency>
<groupId>io.netty</groupId> <groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId> <artifactId>netty-handler</artifactId>

View File

@ -14,6 +14,7 @@ import com.loafle.commons.server.socket.handler.codec.SocketServerProtocolHandle
import com.loafle.overflow.container.Container; import com.loafle.overflow.container.Container;
import com.loafle.overflow.container.server.handler.RPCServerHandler; import com.loafle.overflow.container.server.handler.RPCServerHandler;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -46,7 +47,7 @@ public class ContainerConfiguration {
private RPCServerHandler rpcServerHandler; private RPCServerHandler rpcServerHandler;
@Autowired(required = false) @Autowired(required = false)
private Gson gson; private ObjectMapper objectMapper;
@Bean(Server.CHANNEL_CLASS) @Bean(Server.CHANNEL_CLASS)
public Class<? extends ServerChannel> channelClass() { public Class<? extends ServerChannel> channelClass() {
@ -65,11 +66,7 @@ public class ContainerConfiguration {
@Bean(Container.RPC_SERVER_CODEC) @Bean(Container.RPC_SERVER_CODEC)
public RPCServerCodec rpcServerCodec() { public RPCServerCodec rpcServerCodec() {
if (null != gson) { return new JSONRPCServerCodec(this.objectMapper);
return new JSONRPCServerCodec(gson);
} else {
return new JSONRPCServerCodec();
}
} }
@Bean({Container.RPC_INVOKER, Container.RPC_REGISTRY}) @Bean({Container.RPC_INVOKER, Container.RPC_REGISTRY})