001    package railo.runtime.helpers;
002    
003    import java.io.IOException;
004    import java.net.MalformedURLException;
005    import java.net.URL;
006    
007    import javax.servlet.http.HttpSessionBindingEvent;
008    import javax.servlet.http.HttpSessionBindingListener;
009    
010    import railo.runtime.type.Collection;
011    import railo.runtime.type.StructImpl;
012    
013    public final class HttpSessionBindingListenerStruct extends StructImpl implements HttpSessionBindingListener {
014        
015        private URL url;
016    
017        /**
018         * Constructor of the class
019         * @param strUrl
020         * @throws MalformedURLException
021         */
022        public HttpSessionBindingListenerStruct(String strUrl) throws MalformedURLException {
023            this(new URL(strUrl));
024        }
025        
026        /**
027         * Constructor of the class
028         * @param url
029         */
030        public HttpSessionBindingListenerStruct(URL url) {
031            this.url=url;
032        }
033        
034        public void valueBound(HttpSessionBindingEvent event) {
035            //SystemOut.printDate("------------------------------- bound session -------------------------------");
036        }
037    
038        public void valueUnbound(HttpSessionBindingEvent event) {
039            //SystemOut.printDate("------------------------------- unbound session -------------------------------");
040            try {
041                url.getContent();
042            } 
043            catch (IOException e) {}
044        }
045    
046            /**
047             * @see railo.runtime.type.StructImpl#duplicate(boolean)
048             */
049            public Collection duplicate(boolean deepCopy) {
050                    HttpSessionBindingListenerStruct trg=new HttpSessionBindingListenerStruct(url);
051                    copy(this, trg, deepCopy);
052                    return trg;
053            }
054    }