001    package railo.runtime.type.scope.storage;
002    
003    import java.io.Serializable;
004    
005    import railo.runtime.CFMLFactoryImpl;
006    import railo.runtime.exp.ExceptionHandler;
007    import railo.runtime.listener.ApplicationListener;
008    import railo.runtime.op.Caster;
009    
010    public class SessionEndListener implements StorageScopeListener,Serializable {
011    
012            private static final long serialVersionUID = -3868545140988347285L;
013    
014            /**
015             * @see railo.runtime.type.scope.storage.StorageScopeListener#doEnd(railo.runtime.type.scope.storage.StorageScopeEngine, railo.runtime.type.scope.storage.StorageScopeCleaner, java.lang.String, java.lang.String)
016             */
017            public void doEnd(StorageScopeEngine engine,StorageScopeCleaner cleaner,String appName, String cfid) {
018                    CFMLFactoryImpl factory = engine.getFactory();
019                    ApplicationListener listener = factory.getConfig().getApplicationListener();
020                    try {
021                            cleaner.info("call onSessionEnd for "+appName+"/"+cfid);
022                            listener.onSessionEnd(factory, appName, cfid);
023                    } 
024                    catch (Throwable t) {
025                            ExceptionHandler.log(factory.getConfig(),Caster.toPageException(t));
026                    }
027            }
028    
029    }