Commit 7f0ca858504e37a2cb597a7b3010068130dc1321
1 parent
ff3c30f3
规范代码写法
Showing
1 changed file
with
6 additions
and
5 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
| @@ -8,6 +8,7 @@ import org.slf4j.Logger; | @@ -8,6 +8,7 @@ import org.slf4j.Logger; | ||
| 8 | import org.slf4j.LoggerFactory; | 8 | import org.slf4j.LoggerFactory; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | import org.springframework.context.annotation.Bean; | 10 | import org.springframework.context.annotation.Bean; |
| 11 | +import org.springframework.context.annotation.Configuration; | ||
| 11 | import org.springframework.context.annotation.DependsOn; | 12 | import org.springframework.context.annotation.DependsOn; |
| 12 | import org.springframework.stereotype.Component; | 13 | import org.springframework.stereotype.Component; |
| 13 | 14 | ||
| @@ -18,7 +19,7 @@ import java.util.concurrent.LinkedBlockingQueue; | @@ -18,7 +19,7 @@ import java.util.concurrent.LinkedBlockingQueue; | ||
| 18 | import java.util.concurrent.ThreadPoolExecutor; | 19 | import java.util.concurrent.ThreadPoolExecutor; |
| 19 | import java.util.concurrent.TimeUnit; | 20 | import java.util.concurrent.TimeUnit; |
| 20 | 21 | ||
| 21 | -@Component | 22 | +@Configuration |
| 22 | public class SipLayer{ | 23 | public class SipLayer{ |
| 23 | 24 | ||
| 24 | private final static Logger logger = LoggerFactory.getLogger(SipLayer.class); | 25 | private final static Logger logger = LoggerFactory.getLogger(SipLayer.class); |
| @@ -35,7 +36,7 @@ public class SipLayer{ | @@ -35,7 +36,7 @@ public class SipLayer{ | ||
| 35 | 36 | ||
| 36 | 37 | ||
| 37 | @Bean("sipFactory") | 38 | @Bean("sipFactory") |
| 38 | - private SipFactory createSipFactory() { | 39 | + SipFactory createSipFactory() { |
| 39 | sipFactory = SipFactory.getInstance(); | 40 | sipFactory = SipFactory.getInstance(); |
| 40 | sipFactory.setPathName("gov.nist"); | 41 | sipFactory.setPathName("gov.nist"); |
| 41 | return sipFactory; | 42 | return sipFactory; |
| @@ -43,7 +44,7 @@ public class SipLayer{ | @@ -43,7 +44,7 @@ public class SipLayer{ | ||
| 43 | 44 | ||
| 44 | @Bean("sipStack") | 45 | @Bean("sipStack") |
| 45 | @DependsOn({"sipFactory"}) | 46 | @DependsOn({"sipFactory"}) |
| 46 | - private SipStack createSipStack() throws PeerUnavailableException { | 47 | + SipStack createSipStack() throws PeerUnavailableException { |
| 47 | Properties properties = new Properties(); | 48 | Properties properties = new Properties(); |
| 48 | properties.setProperty("javax.sip.STACK_NAME", "GB28181_SIP"); | 49 | properties.setProperty("javax.sip.STACK_NAME", "GB28181_SIP"); |
| 49 | properties.setProperty("javax.sip.IP_ADDRESS", sipConfig.getMonitorIp()); | 50 | properties.setProperty("javax.sip.IP_ADDRESS", sipConfig.getMonitorIp()); |
| @@ -64,7 +65,7 @@ public class SipLayer{ | @@ -64,7 +65,7 @@ public class SipLayer{ | ||
| 64 | 65 | ||
| 65 | @Bean(name = "tcpSipProvider") | 66 | @Bean(name = "tcpSipProvider") |
| 66 | @DependsOn("sipStack") | 67 | @DependsOn("sipStack") |
| 67 | - private SipProviderImpl startTcpListener() { | 68 | + SipProviderImpl startTcpListener() { |
| 68 | ListeningPoint tcpListeningPoint = null; | 69 | ListeningPoint tcpListeningPoint = null; |
| 69 | SipProviderImpl tcpSipProvider = null; | 70 | SipProviderImpl tcpSipProvider = null; |
| 70 | try { | 71 | try { |
| @@ -89,7 +90,7 @@ public class SipLayer{ | @@ -89,7 +90,7 @@ public class SipLayer{ | ||
| 89 | 90 | ||
| 90 | @Bean(name = "udpSipProvider") | 91 | @Bean(name = "udpSipProvider") |
| 91 | @DependsOn("sipStack") | 92 | @DependsOn("sipStack") |
| 92 | - private SipProviderImpl startUdpListener() { | 93 | + SipProviderImpl startUdpListener() { |
| 93 | ListeningPoint udpListeningPoint = null; | 94 | ListeningPoint udpListeningPoint = null; |
| 94 | SipProviderImpl udpSipProvider = null; | 95 | SipProviderImpl udpSipProvider = null; |
| 95 | try { | 96 | try { |