* collection is stored within the HttpSession, and will be reused if available.
* Each listener is instantiated once per session. Listeners are singleton
* classes within the session, but not globally.
- *
+ *
* @author Michael Jumper
*/
public class SessionListenerCollection extends AbstractCollection {
* session.
*/
private Collection listeners;
-
+
/**
* Creates a new SessionListenerCollection which stores all listeners
* defined in guacamole.properties in the provided session. If listeners
* are already stored in the provided session, those listeners are used
* instead.
- *
+ *
* @param session The HttpSession to store listeners within.
* @throws GuacamoleException If an error occurs while instantiating new
* listeners.
*/
public SessionListenerCollection(HttpSession session) throws GuacamoleException {
-
+
// Pull cached listeners from session
listeners = (Collection) session.getAttribute(SESSION_ATTRIBUTE);
// Store listeners for next time
session.setAttribute(SESSION_ATTRIBUTE, listeners);
-
+
}
-
+
}
-
+
@Override
public Iterator iterator() {
return listeners.iterator();
public int size() {
return listeners.size();
}
-
+
}