コード例 #1
0
 public static void releaseSession(NgnPublicationSession session) {
   synchronized (sSessions) {
     if (session != null && sSessions.containsKey(session.getId())) {
       long id = session.getId();
       session.decRef();
       sSessions.remove(id);
     }
   }
 }
コード例 #2
0
 public static NgnPublicationSession createOutgoingSession(NgnSipStack sipStack, String toUri) {
   synchronized (sSessions) {
     final NgnPublicationSession pubSession = new NgnPublicationSession(sipStack, toUri);
     sSessions.put(pubSession.getId(), pubSession);
     return pubSession;
   }
 }
コード例 #3
0
 public static void releaseSession(long id) {
   synchronized (sSessions) {
     NgnPublicationSession session = NgnPublicationSession.getSession(id);
     if (session != null) {
       session.decRef();
       sSessions.remove(id);
     }
   }
 }
コード例 #4
0
 public static boolean hasSession(long id) {
   synchronized (sSessions) {
     return sSessions.containsKey(id);
   }
 }
コード例 #5
0
 public static int getSize() {
   synchronized (sSessions) {
     return sSessions.size();
   }
 }
コード例 #6
0
 public static NgnPublicationSession getSession(long id) {
   synchronized (sSessions) {
     if (sSessions.containsKey(id)) return sSessions.get(id);
     else return null;
   }
 }