From fc901e8c65b6a2ec3c19e60534202114970fccbe Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 25 九月 2020 17:41:02 +0800
Subject: [PATCH] 更新readme
---
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java | 35 ++++++++++++++++++++++++-----------
1 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java
index 88e7ccf..fe97e2b 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java
@@ -34,6 +34,7 @@
import com.genersoft.iot.vmp.gb28181.transmit.response.impl.InviteResponseProcessor;
import com.genersoft.iot.vmp.gb28181.transmit.response.impl.OtherResponseProcessor;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
+import com.genersoft.iot.vmp.utils.SpringBeanFactory;
import com.genersoft.iot.vmp.utils.redis.RedisUtil;
/**
@@ -82,12 +83,10 @@
@Autowired
private OtherResponseProcessor otherResponseProcessor;
- @Autowired
- @Qualifier(value="tcpSipProvider")
+ // 娉細杩欓噷浣跨敤娉ㄨВ浼氬鑷村惊鐜緷璧栨敞鍏ワ紝鏆傜敤springBean
private SipProvider tcpSipProvider;
-
- @Autowired
- @Qualifier(value="udpSipProvider")
+
+ // 娉細杩欓噷浣跨敤娉ㄨВ浼氬鑷村惊鐜緷璧栨敞鍏ワ紝鏆傜敤springBean
private SipProvider udpSipProvider;
public ISIPRequestProcessor createRequestProcessor(RequestEvent evt) {
@@ -97,14 +96,14 @@
if (Request.INVITE.equals(method)) {
InviteRequestProcessor processor = new InviteRequestProcessor();
processor.setRequestEvent(evt);
- processor.setTcpSipProvider(tcpSipProvider);
- processor.setUdpSipProvider(udpSipProvider);
+ processor.setTcpSipProvider(getTcpSipProvider());
+ processor.setUdpSipProvider(getUdpSipProvider());
return processor;
} else if (Request.REGISTER.equals(method)) {
RegisterRequestProcessor processor = new RegisterRequestProcessor();
processor.setRequestEvent(evt);
- processor.setTcpSipProvider(tcpSipProvider);
- processor.setUdpSipProvider(udpSipProvider);
+ processor.setTcpSipProvider(getTcpSipProvider());
+ processor.setUdpSipProvider(getUdpSipProvider());
processor.setHandler(handler);
processor.setPublisher(publisher);
processor.setSipConfig(sipConfig);
@@ -129,8 +128,8 @@
} else if (Request.MESSAGE.equals(method)) {
MessageRequestProcessor processor = new MessageRequestProcessor();
processor.setRequestEvent(evt);
- processor.setTcpSipProvider(tcpSipProvider);
- processor.setUdpSipProvider(udpSipProvider);
+ processor.setTcpSipProvider(getTcpSipProvider());
+ processor.setUdpSipProvider(getUdpSipProvider());
processor.setPublisher(publisher);
processor.setRedis(redis);
processor.setDeferredResultHolder(deferredResultHolder);
@@ -158,4 +157,18 @@
}
}
+ private SipProvider getTcpSipProvider() {
+ if (tcpSipProvider == null) {
+ tcpSipProvider = (SipProvider) SpringBeanFactory.getBean("tcpSipProvider");
+ }
+ return tcpSipProvider;
+ }
+
+ private SipProvider getUdpSipProvider() {
+ if (udpSipProvider == null) {
+ udpSipProvider = (SipProvider) SpringBeanFactory.getBean("udpSipProvider");
+ }
+ return udpSipProvider;
+ }
+
}
--
Gitblit v1.8.0