ing
This commit is contained in:
parent
1ed55320c6
commit
70e3c93d3f
7
pom.xml
7
pom.xml
|
@ -22,6 +22,7 @@
|
|||
<overflow.commons-java.version>1.0.0-SNAPSHOT</overflow.commons-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>
|
||||
<spring.version>5.0.5.RELEASE</spring.version>
|
||||
</properties>
|
||||
|
@ -48,6 +49,12 @@
|
|||
<version>${overflow.crawler-java.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-mapper-asl</artifactId>
|
||||
<version>${jackson.mapper.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-handler</artifactId>
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.loafle.commons.server.socket.handler.codec.SocketServerProtocolHandle
|
|||
import com.loafle.overflow.container.Container;
|
||||
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.Qualifier;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
@ -46,7 +47,7 @@ public class ContainerConfiguration {
|
|||
private RPCServerHandler rpcServerHandler;
|
||||
|
||||
@Autowired(required = false)
|
||||
private Gson gson;
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Bean(Server.CHANNEL_CLASS)
|
||||
public Class<? extends ServerChannel> channelClass() {
|
||||
|
@ -65,11 +66,7 @@ public class ContainerConfiguration {
|
|||
|
||||
@Bean(Container.RPC_SERVER_CODEC)
|
||||
public RPCServerCodec rpcServerCodec() {
|
||||
if (null != gson) {
|
||||
return new JSONRPCServerCodec(gson);
|
||||
} else {
|
||||
return new JSONRPCServerCodec();
|
||||
}
|
||||
return new JSONRPCServerCodec(this.objectMapper);
|
||||
}
|
||||
|
||||
@Bean({Container.RPC_INVOKER, Container.RPC_REGISTRY})
|
||||
|
|
Loading…
Reference in New Issue
Block a user