View | Details | Raw Unified | Return to bug 56536
Collapse All | Expand All

(-)java/org/apache/catalina/session/StandardSession.java (-42 / +41 lines)
Lines 822-872 Link Here
822
                        }
822
                        }
823
                    }
823
                    }
824
                }
824
                }
825
            } finally {
826
                if (oldTccl != null) {
827
                    if (Globals.IS_SECURITY_ENABLED) {
828
                        PrivilegedAction<Void> pa =
829
                            new PrivilegedSetTccl(oldTccl);
830
                        AccessController.doPrivileged(pa);
831
                    } else {
832
                        Thread.currentThread().setContextClassLoader(oldTccl);
833
                    }
834
                }
835
            }
836
825
837
            if (ACTIVITY_CHECK) {
826
                if (ACTIVITY_CHECK) {
838
                accessCount.set(0);
827
                	accessCount.set(0);
839
            }
840
841
            // Remove this session from our manager's active sessions
842
            manager.remove(this, true);
843
844
            // Notify interested session event listeners
845
            if (notify) {
846
                fireSessionEvent(Session.SESSION_DESTROYED_EVENT, null);
847
            }
848
849
            // Call the logout method
850
            if (principal instanceof GenericPrincipal) {
851
                GenericPrincipal gp = (GenericPrincipal) principal;
852
                try {
853
                    gp.logout();
854
                } catch (Exception e) {
855
                    manager.getContainer().getLogger().error(
856
                            sm.getString("standardSession.logoutfail"),
857
                            e);
858
                }
828
                }
859
            }
860
829
861
            // We have completed expire of this session
830
		            // Remove this session from our manager's active sessions
862
            setValid(false);
831
		            manager.remove(this, true);
863
            expiring = false;
832
		
864
833
		            // Notify interested session event listeners
865
            // Unbind any objects associated with this session
834
		            if (notify) {
866
            String keys[] = keys();
835
		                fireSessionEvent(Session.SESSION_DESTROYED_EVENT, null);
867
            for (int i = 0; i < keys.length; i++)
836
		            }
868
                removeAttributeInternal(keys[i], notify);
837
		
869
838
		            // Call the logout method
839
		            if (principal instanceof GenericPrincipal) {
840
		                GenericPrincipal gp = (GenericPrincipal) principal;
841
		                try {
842
		                    gp.logout();
843
		                } catch (Exception e) {
844
		                    manager.getContainer().getLogger().error(
845
		                            sm.getString("standardSession.logoutfail"),
846
		                            e);
847
		                }
848
		            }
849
		
850
		            // We have completed expire of this session
851
		            setValid(false);
852
		            expiring = false;
853
		
854
		            // Unbind any objects associated with this session
855
		            String keys[] = keys();
856
		            for (int i = 0; i < keys.length; i++)
857
		                removeAttributeInternal(keys[i], notify);
858
            } finally {
859
              if (oldTccl != null) {
860
                  if (Globals.IS_SECURITY_ENABLED) {
861
                      PrivilegedAction<Void> pa =
862
                          new PrivilegedSetTccl(oldTccl);
863
                      AccessController.doPrivileged(pa);
864
                  } else {
865
                      Thread.currentThread().setContextClassLoader(oldTccl);
866
                  }
867
              }
868
          }
870
        }
869
        }
871
870
872
    }
871
    }

Return to bug 56536