Examples of SessionManager


Examples of net.sourceforge.squirrel_sql.client.session.SessionManager

  public void testCreateDataSet() throws DataSetException {
   
    ISession mockSession = mockHelper.createMock(ISession.class);
    IApplication mockApplication = mockHelper.createMock(IApplication.class);
    IIdentifier mockIdentifier = mockHelper.createMock(IIdentifier.class);
    SessionManager mockSessionManager = mockHelper.createMock(SessionManager.class);
    ISQLConnection mockSqlConnection = mockHelper.createMock(ISQLConnection.class);
    SQLDatabaseMetaData mockMetaData = mockHelper.createMock(SQLDatabaseMetaData.class);
    IProcedureInfo mockProcedureInfo = mockHelper.createMock(IProcedureInfo.class);
   
    expect(mockSessionManager.getSession(mockIdentifier)).andStubReturn(mockSession);
    expect(mockSession.getApplication()).andStubReturn(mockApplication);
    expect(mockSession.getIdentifier()).andStubReturn(mockIdentifier);
    expect(mockApplication.getSessionManager()).andStubReturn(mockSessionManager);
    expect(mockSession.getSQLConnection()).andStubReturn(mockSqlConnection);
    expect(mockSqlConnection.getSQLMetaData()).andStubReturn(mockMetaData);
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.session.SessionManager

    if (args == null) { throw new IllegalArgumentException("ApplicationArguments == null"); }

    indicateNewStartupTask(splash, s_stringMgr.getString("Application.splash.createSessionManager"));
    // AliasMaintSheetFactory.initialize(this);
    // DriverMaintSheetFactory.initialize(this);
    _sessionManager = new SessionManager(this);

    indicateNewStartupTask(splash, s_stringMgr.getString("Application.splash.loadingprefs"));

    final boolean loadPlugins = args.getLoadPlugins();
    if (loadPlugins)
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.session.SessionManager

     replay(session);
     return session;
  }

  public static SessionManager getEasyMockSessionManager() {
     SessionManager result = createMock(SessionManager.class);
     result.addAllowedSchemaChecker(isA(IAllowedSchemaChecker.class));
     expectLastCall().anyTimes();
     replay(result);
     return result;
  }
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.session.SessionManager

        mockActColl = getEasyMockActionCollection();
     }
     expect(result.getActionCollection()).andReturn(mockActColl).anyTimes();
     SQLDriverManager driverManager = FwTestUtil.getEasyMockSQLDriverManager();
     expect(result.getSQLDriverManager()).andReturn(driverManager).anyTimes();
     SessionManager mockSessionManager = getEasyMockSessionManager();
     expect(result.getSessionManager()).andReturn(mockSessionManager)
                                       .anyTimes();
     if (replay) {
        replay(result);
     }
View Full Code Here

Examples of oracle.toplink.tools.sessionmanagement.SessionManager

   */
  protected DatabaseSession loadDatabaseSession(
      String configLocation, String sessionName, ClassLoader sessionClassLoader)
      throws TopLinkException {

    SessionManager manager = getSessionManager();

    // Try to find TopLink 10.1.3 XMLSessionConfigLoader.
    Method getSessionMethod = null;
    Object loader = null;
    try {
      Class loaderClass = Class.forName("oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader");
      getSessionMethod = SessionManager.class.getMethod("getSession",
          new Class[] {loaderClass, String.class, ClassLoader.class, boolean.class, boolean.class, boolean.class});
      if (logger.isDebugEnabled()) {
        logger.debug("Using TopLink 10.1.3 XMLSessionConfigLoader");
      }
      Constructor ctor = loaderClass.getConstructor(new Class[] {String.class});
      loader = ctor.newInstance(new Object[] {configLocation});
    }
    catch (Exception ex) {
      // TopLink 10.1.3 XMLSessionConfigLoader not found ->
      // fall back to TopLink 9.0.4 XMLLoader.
      if (logger.isDebugEnabled()) {
        logger.debug("Using TopLink 9.0.4 XMLLoader");
      }
      XMLLoader xmlLoader = new XMLLoader(configLocation);
      return (DatabaseSession) manager.getSession(xmlLoader, sessionName, sessionClassLoader, false, false);
    }

    // TopLink 10.1.3 XMLSessionConfigLoader found -> create loader instance
    // through reflection and fetch specified Session from SessionManager.
    // This invocation will check if the ClassLoader passed in is the same
View Full Code Here

Examples of org.apache.axis2.transport.http.server.SessionManager

        TransportInDescription httpDescription =
                new TransportInDescription(Constants.TRANSPORT_HTTP);
        httpDescription.setReceiver(this);
        trpInDesc = httpDescription;
        httpFactory.getListenerManager().addListener(httpDescription, true);
        sessionManager = new SessionManager();
    }
View Full Code Here

Examples of org.apache.cocoon.webapps.session.SessionManager

        }
    }
   
    private DocumentFragment getContextFragment(String context, String path)
    throws ProcessingException {
        SessionManager sessionManager = null;
        try {
            sessionManager = (SessionManager) this.manager.lookup(SessionManager.ROLE);
            return sessionManager.getContextFragment( context, path );
        } catch (ServiceException ce ) {
            throw new ProcessingException("Unable to lookup session manager.", ce);
        } finally {
            this.manager.release(sessionManager);
        }       
View Full Code Here

Examples of org.apache.cocoon.webapps.session.components.SessionManager

     */
    public Map act (Redirector redirector, SourceResolver resolver, Map objectModel, String src,
            Parameters parameters) throws Exception {
        Request req = ObjectModelHelper.getRequest(objectModel);

        SessionManager sessionManager = null;
        // read local settings
        try {

            sessionManager = (SessionManager)this.manager.lookup(SessionManager.ROLE);
            Session session = sessionManager.getSession(true);

            Configuration conf = (Configuration)session.getAttribute(
                                  req.getParameter(SessionConstants.SESSION_FORM_PARAMETER));

            String valstr = parameters.getParameter ("validate", (String) settings.get("validate",""));
View Full Code Here

Examples of org.apache.cocoon.webapps.session.components.SessionManager

                   SourceResolver resolver,
                   Map objectModel,
                   String source,
                   Parameters par)
    throws ProcessingException {
        SessionManager sessionManager = null;
        try {
            sessionManager = (SessionManager)this.manager.lookup(SessionManager.ROLE);
            final String action = par.getParameter("action", "create");
            if ( action.equals("create") == true ) {
                sessionManager.createSession();
            } else if ( action.equals("terminate") == true ) {
                final String mode = par.getParameter("mode", "immediately");
                if ( mode.equals("immediately") == true) {
                    sessionManager.terminateSession(true);
                } else if ( mode.equals("if-unused") == true ) {
                    sessionManager.terminateSession(false);
                } else {
                    throw new ProcessingException("Unknown mode " + mode + " for action " + action);
                }
            } else {
                throw new ProcessingException("Unknown action: " + action);
View Full Code Here

Examples of org.apache.cocoon.webapps.session.components.SessionManager

            UserState status = this.getUserState();
            status.removeHandler( handlerName );
            this.updateUserState();

            // handling of session termination
            SessionManager sessionManager = null;
            try {
                sessionManager = (SessionManager)this.manager.lookup( SessionManager.ROLE );
           
                if ( mode == AuthenticationConstants.LOGOUT_MODE_IMMEDIATELY ) {
                    sessionManager.terminateSession(true);
                } else if ( mode == AuthenticationConstants.LOGOUT_MODE_IF_UNUSED ) {
                    if ( !status.hasHandler()) {
                        sessionManager.terminateSession( false );
                    }
                
                } else if ( mode == AuthenticationConstants.LOGOUT_MODE_IF_NOT_AUTHENTICATED) {
                    if ( !status.hasHandler()) {
                        sessionManager.terminateSession( true );
                    }
                } else {
                    throw new ProcessingException("Unknown logout mode: " + mode);
                }
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.