Package org.jboss.web.tomcat.service.sso.jbc

Examples of org.jboss.web.tomcat.service.sso.jbc.JBossCacheSSOClusterManager$SSOCleanerTask


         mbeanServer.registerMBean(wrapper, new ObjectName(CACHE_OBJECT_NAME));
         wrapper.create();
         wrapper.start();
        
         // Build up an SSO infrastructure based on LOCAL_ADDRESS        
         JBossCacheSSOClusterManager localSSOManager = new JBossCacheSSOClusterManager();
        
         MockSSOValve localValve = new MockSSOValve(mbeanServer);
         localValve.setCacheConfig(CACHE_OBJECT_NAME);
         localValve.setClusterManager(localSSOManager);
         localSSOManager.setSSOLocalManager(localValve);
         localSSOManager.start();
        
         // Create an SSO that will have two sessions from local valve
         localSSOManager.register("1", "FORM", "Brian", "password");
        
         Manager localSessMgr1 = getSessionManager("A");
         Session sess1 = new MockSession(localSessMgr1, "1");
         localSSOManager.addSession("1", getFullyQualifiedSessionId(sess1));
        
         Manager localSessMgr2 = getSessionManager("B");
         Session sess2 = new MockSession(localSessMgr2, "2");
         localSSOManager.addSession("1", getFullyQualifiedSessionId(sess2));
        
         // Confirm that data is cached properly
         assertEquals("SSO 1 has correct number of sessions", 2, localSSOManager.getSessionCount("1"));  
      }
      finally
      {
         try
         {
View Full Code Here


         mbeanServer.registerMBean(wrapper, new ObjectName(CACHE_OBJECT_NAME));
         wrapper.create();
         wrapper.start();
        
         // Build up an SSO infrastructure based on LOCAL_ADDRESS        
         JBossCacheSSOClusterManager localSSOManager = new JBossCacheSSOClusterManager();
        
         MockSSOValve localValve = new MockSSOValve(mbeanServer);
         localValve.setCacheConfig(CACHE_OBJECT_NAME);
         localValve.setClusterManager(localSSOManager);
         localSSOManager.setSSOLocalManager(localValve);
         localSSOManager.start();
        
         // Create an SSO that will have two sessions from local valve
         localSSOManager.register("1", "FORM", "Brian", "password");
        
         Manager localSessMgr1 = getSessionManager("A");
         Session sess1 = new MockSession(localSessMgr1, "1");
         localSSOManager.addSession("1", getFullyQualifiedSessionId(sess1));
        
         Manager localSessMgr2 = getSessionManager("B");
         Session sess2 = new MockSession(localSessMgr2, "2");
         localSSOManager.addSession("1", getFullyQualifiedSessionId(sess2));
        
         // Confirm that data is cached properly
         assertEquals("SSO 1 has correct number of sessions", 2, localSSOManager.getSessionCount("1"));  
      }
      finally
      {
         try
         {
View Full Code Here

      PojoCache pc = PojoCacheFactory.createCache(config, false);
     
      cacheManager.registerPojoCache(pc, ClusteredSingleSignOn.DEFAULT_CACHE_NAME);
     
      // Build up an SSO infrastructure based on LOCAL_ADDRESS        
      JBossCacheSSOClusterManager localSSOManager = new JBossCacheSSOClusterManager();
     
      MockSSOValve localValve = new MockSSOValve(mbeanServer);
      localValve.setCacheConfig(ClusteredSingleSignOn.DEFAULT_CACHE_NAME);
      localValve.setClusterManager(localSSOManager);
      localSSOManager.setSSOLocalManager(localValve);
      localSSOManager.start();
     
      // Create an SSO that will have two sessions from local valve
      localSSOManager.register("1", "FORM", "Brian", "password");
     
      Manager localSessMgr1 = getSessionManager("A");
      Session sess1 = new MockSession(localSessMgr1, "1");
      localSSOManager.addSession("1", getFullyQualifiedSessionId(sess1));
     
      Manager localSessMgr2 = getSessionManager("B");
      Session sess2 = new MockSession(localSessMgr2, "2");
      localSSOManager.addSession("1", getFullyQualifiedSessionId(sess2));
     
      // Confirm that data is cached properly
      assertEquals("SSO 1 has correct number of sessions", 2, localSSOManager.getSessionCount("1"));
   }
View Full Code Here

         BasicThreadPool pool = new BasicThreadPool();
         mbeanServer.registerMBean(pool, new ObjectName(JBossCacheSSOClusterManager.DEFAULT_THREAD_POOL_NAME));
      }
     
      // Build up an SSO infrastructure based on LOCAL_ADDRESS 
      JBossCacheSSOClusterManager localSSOManager = new JBossCacheSSOClusterManager();
     
      MockSSOValve localValve = new MockSSOValve(mbeanServer);
      localValve.setCacheConfig(ClusteredSingleSignOn.DEFAULT_CACHE_NAME);
      localValve.setClusterManager(localSSOManager);
      localSSOManager.setSSOLocalManager(localValve);
      localSSOManager.start();
     
      assertEquals("Thread pool usage as expected", usePool, localSSOManager.isUsingThreadPool());
     
      //  Build up a second SSO infrastructure based on LOCAL_ADDRESS
      // It uses the same mock cache, but we change the cache address
      // so it thinks it's a different address when it starts
      cache.setOurAddress(REMOTE_ADDRESS);
     
      JBossCacheSSOClusterManager remoteSSOManager = new JBossCacheSSOClusterManager();
     
      MockSSOValve remoteValve = new MockSSOValve(mbeanServer);
      remoteValve.setCacheConfig(ClusteredSingleSignOn.DEFAULT_CACHE_NAME);
      remoteValve.setClusterManager(remoteSSOManager);
      remoteSSOManager.setSSOLocalManager(localValve);
      remoteSSOManager.start();
     
     
      // Create an SSO that will have sessions from both valves
      localSSOManager.register("1", "FORM", "Brian", "password");
     
      Manager localSessMgr1 = getSessionManager("A");
      Session sess1 = new MockSession(localSessMgr1, "1");
      localSSOManager.addSession("1", getFullyQualifiedSessionId(sess1));
     
      Manager remoteSessMgr1 = getSessionManager("B");
      Session sess2 = new MockSession(remoteSessMgr1, "2");
      remoteSSOManager.addSession("1", getFullyQualifiedSessionId(sess2));
     
     
      // Create another SSO with sessions only from remote
      remoteSSOManager.register("2", "FORM", "Brian", "password");
     
      Manager remoteSessMgr2 = getSessionManager("C");
      Session sess3 = new MockSession(remoteSessMgr2, "3");
      remoteSSOManager.addSession("2", getFullyQualifiedSessionId(sess3));
     
      Manager remoteSessMgr3 = getSessionManager("D");
      Session sess4 = new MockSession(remoteSessMgr3, "4");
      remoteSSOManager.addSession("2", getFullyQualifiedSessionId(sess4));
     
     
      // Create a third SSO that will have sessions from both valves
      // with the same session id
      localSSOManager.register("3", "FORM", "Brian", "password");
     
      Manager localSessMgr2 = getSessionManager("E");
      Session sess5 = new MockSession(localSessMgr2, "5");
      localSSOManager.addSession("3", getFullyQualifiedSessionId(sess5));
     
      Manager remoteSessMgr4 = getSessionManager("E");
      Session sess6 = new MockSession(remoteSessMgr4, "5");
      remoteSSOManager.addSession("3", getFullyQualifiedSessionId(sess6));
     
     
      // Create a fourth SSO that will have two sessions from local valve
      localSSOManager.register("4", "FORM", "Brian", "password");
     
      Manager localSessMgr3 = getSessionManager("F");
      Session sess7 = new MockSession(localSessMgr3, "7");
      localSSOManager.addSession("4", getFullyQualifiedSessionId(sess7));
     
      Manager localSessMgr4 = getSessionManager("G");
      Session sess8 = new MockSession(localSessMgr4, "8");
      localSSOManager.addSession("4", getFullyQualifiedSessionId(sess8));
     
     
      // Create a fifth SSO with sessions only from remote, same session id
      // but different managers
      remoteSSOManager.register("5", "FORM", "Brian", "password");
     
      Manager remoteSessMgr5 = getSessionManager("H");
      Session sess9 = new MockSession(remoteSessMgr5, "9");
      remoteSSOManager.addSession("5", getFullyQualifiedSessionId(sess9));
     
      Manager remoteSessMgr6 = getSessionManager("I");
      Session sess10 = new MockSession(remoteSessMgr6, "9");
      remoteSSOManager.addSession("5", getFullyQualifiedSessionId(sess10));
     
      // Confirm that data is cached properly
      assertEquals("SSO 1 has correct number of sessions", 2, localSSOManager.getSessionCount("1"));
      assertEquals("SSO 1 has correct number of sessions", 2, remoteSSOManager.getSessionCount("1"));
      assertEquals("SSO 2 has correct number of sessions", 2, localSSOManager.getSessionCount("2"));
      assertEquals("SSO 2 has correct number of sessions", 2, remoteSSOManager.getSessionCount("2"));
      assertEquals("SSO 3 has correct number of sessions", 2, localSSOManager.getSessionCount("3"));
      assertEquals("SSO 3 has correct number of sessions", 2, remoteSSOManager.getSessionCount("3"));
      assertEquals("SSO 4 has correct number of sessions", 2, localSSOManager.getSessionCount("4"));
      assertEquals("SSO 4 has correct number of sessions", 2, remoteSSOManager.getSessionCount("4"));
      assertEquals("SSO 5 has correct number of sessions", 2, localSSOManager.getSessionCount("5"));
      assertEquals("SSO 5 has correct number of sessions", 2, remoteSSOManager.getSessionCount("5"));
     
      // Put in a new view with REMOTE_ADDRESS dead
      ViewId viewId = new ViewId(LOCAL_ADDRESS, 1);
      Vector v = new Vector();
      v.add(LOCAL_ADDRESS);
View Full Code Here

      cache.getConfiguration().getRuntimeConfig().setTransactionManager(new BatchModeTransactionManager());
     
      cacheManager.registerCache(cache, ClusteredSingleSignOn.DEFAULT_CACHE_NAME);
     
      // Build up an SSO infrastructure based on LOCAL_ADDRESS 
      JBossCacheSSOClusterManager localSSOManager = new JBossCacheSSOClusterManager();
     
      MockSSOValve localValve = new MockSSOValve(mbeanServer);
      localValve.setCacheConfig(ClusteredSingleSignOn.DEFAULT_CACHE_NAME);
      localValve.setClusterManager(localSSOManager);
      localSSOManager.setSSOLocalManager(localValve);
      localSSOManager.start();
     
     
      // Create an SSO that will have sessions from both valves
      localSSOManager.register("1", "FORM", "Brian", "password");
     
      Manager localSessMgr1 = getSessionManager("A");
      Session sess1 = new MockSession(localSessMgr1, "1");
      localSSOManager.addSession("1", getFullyQualifiedSessionId(sess1));
     
      Manager localSessMgr2 = getSessionManager("B");
      Session sess2 = new MockSession(localSessMgr2, "1");
      localSSOManager.addSession("1", getFullyQualifiedSessionId(sess2));
     
      assertEquals(2, localSSOManager.getSessionCount("1"));
     
      localSSOManager.removeSession("1", getFullyQualifiedSessionId(sess2));
     
      assertEquals(1, localSSOManager.getSessionCount("1"));
   }
View Full Code Here

TOP

Related Classes of org.jboss.web.tomcat.service.sso.jbc.JBossCacheSSOClusterManager$SSOCleanerTask

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.