Package org.cipango.server.session.SessionManager

Examples of org.cipango.server.session.SessionManager.SessionScope


   
    // Patch TMP fix for CIPANGO 8
    CallSession callSession = _tx.getRequest().getCallSession();
    SessionManager cm = callSession.getServer().getSessionManager();
     
      SessionScope work = cm.openScope(callSession);
      try
      {
      // End patch
        while (LazyList.size(_targets) > 0)
            {
          Branch branch = (Branch) LazyList.get(_targets, 0);
          _targets = LazyList.remove(_targets, 0);
               
                if (Log.isDebugEnabled())
                  Log.debug("Proxying to {} ", branch.getUri(), null);
               
                branch.start();

          if (!_parallel) break;
        }
      // Patch TMP fix for CIPANGO 8
      }
      finally
      {
        work.close();
      }
      // End patch
  }
View Full Code Here


                    return;
                }
      }
    }
   
    SessionScope scope = null;
    try
    {
      scope = _sessionManager.openScope(message.getApplicationSession());
      if (_handler != null)
        _handler.handle(message);
    }
    finally
    {
      if (scope != null)
        scope.close();
    }
  }
View Full Code Here

        if (isCommitted())
            throw new IllegalStateException("Response is commited");
       
        SessionManager csm = getCallSession().getServer().getSessionManager();
       
        SessionScope scope = csm.openScope(getCallSession());
       
        try
        {
          _session.sendResponse(this, (ServerTransaction) getTransaction(), reliable);
            setCommitted(true);
        }
        catch (Exception e)
        {
            Log.warn(e);
            if (e instanceof IOException)
                throw (IOException) e;
            throw new IllegalStateException(e.getMessage());
        }
        finally
        {
          scope.close();
        }
    }
View Full Code Here

          throw new IllegalStateException("Can send request only in UAC mode");
      setCommitted(true);
     
      SessionManager csm = getCallSession().getServer().getSessionManager();
     
      SessionScope scope = csm.openScope(getCallSession());
      try
      {
        if (isCancel())
          ((ClientTransaction) getTransaction()).cancel(this);
        else
          //getCallSession().getServer().sendRequest(this, _session);
          _session.sendRequest(this);
      }
      finally
      {
        scope.close();
      }
    }
View Full Code Here

       
        public SipApplicationSession createApplicationSession()
        {
          Server server = getServer();
         
          SessionScope scope = server.getSessionManager().openScope(ID.newCallId());
          try
          {
            AppSession session = scope.getCallSession().createAppSession(SipAppContext.this, ID.newAppSessionId());
            return new ScopedAppSession(session);
          }
          finally
          {
            scope.close();
          }
        }
View Full Code Here

      if (key == null)
        throw new NullPointerException("key is null");
     
      String id = ID.getIdFromKey(getName(), key);

      SessionScope tx = getServer().getSessionManager().openScope(id);
      try
      {
        AppSession appSession = tx.getCallSession().getAppSession(id);
        if (appSession == null)
        {
          if (create)
            appSession = tx.getCallSession().createAppSession(SipAppContext.this, id);
          else
            return null;
        }
        return new ScopedAppSession(appSession);
      }
      finally
      {
        tx.close();
      }     
    }
View Full Code Here

    return timers;
  }

  public void invalidate()
  {
    SessionScope scope = openScope();
    try
    {
      _appSession.invalidate();
    }
    finally
    {
      scope.close();
    }
  }
View Full Code Here

    return _appSession.isValid();
  }

  public void removeAttribute(String name)
  {
    SessionScope scope = openScope();
    try
    {
      _appSession.removeAttribute(name);
    }
    finally
    {
      scope.close();
    }
  }
View Full Code Here

    }
  }

  public void setAttribute(String name, Object value)
  {
    SessionScope scope = openScope();
    try
    {
      _appSession.setAttribute(name, value);
    }
    finally
    {
      scope.close();
    }
  }
View Full Code Here

    }
  }

  public int setExpires(int deltaMinutes)
  {
    SessionScope scope = openScope();
    try
    {
      return _appSession.setExpires(deltaMinutes);
    }
    finally
    {
      scope.close();
    }
  }
View Full Code Here

TOP

Related Classes of org.cipango.server.session.SessionManager.SessionScope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.