/** * Clear and remove customizer if its session is the same as the passed one; * in case prevCustomizer exists set it as a new customizer. * Called when ClientSession releases write accessor: * if the customizer was created by the ClientSession it's removed, and * the previous customizer (that ConnectionPool had set) is brought back; * otherwise the customizer (created by ConnectionPool) is kept. * Ignored if there's no customizer. */ public void releaseCustomizer(AbstractSession session) { if(customizer != null) { if(customizer.getSession() == session) { if(customizer.isActive()) { customizer.clear(); } if(customizer.getPrevCustomizer() == null) { customizer = null; } else { setCustomizer(customizer.getPrevCustomizer()); } } } }
/** * Clear and remove customizer if its session is the same as the passed one; * in case prevCustomizer exists set it as a new customizer. * Called when ClientSession releases write accessor: * if the customizer was created by the ClientSession it's removed, and * the previous customizer (that ConnectionPool had set) is brought back; * otherwise the customizer (created by ConnectionPool) is kept. * Ignored if there's no customizer. */ public void releaseCustomizer(AbstractSession session) { if(customizer != null) { if(customizer.getSession() == session) { if(customizer.isActive()) { customizer.clear(); } if(customizer.getPrevCustomizer() == null) { customizer = null; } else { setCustomizer(customizer.getPrevCustomizer()); } } } }
/** * Clear and remove customizer if its session is the same as the passed one; * in case prevCustomizer exists set it as a new customizer. * Called when ClientSession releases write accessor: * if the customizer was created by the ClientSession it's removed, and * the previous customizer (that ConnectionPool had set) is brought back; * otherwise the customizer (created by ConnectionPool) is kept. * Ignored if there's no customizer. */ public void releaseCustomizer(AbstractSession session) { if(customizer != null) { if(customizer.getSession() == session) { if(customizer.isActive()) { customizer.clear(); } if(customizer.getPrevCustomizer() == null) { customizer = null; } else { setCustomizer(customizer.getPrevCustomizer()); } } } }
setCustomizer(newCustomizer); setCustomizer(newCustomizer);
setCustomizer(newCustomizer); setCustomizer(newCustomizer);
setCustomizer(newCustomizer); setCustomizer(newCustomizer);