http://groups.google.com/group/google-appengine-java/browse_thread/thread/672879dd9a3ba137の下記の発言から、ローカルの環境で動くのがバグであることがわかります。
Hi Erum. App Engine doesn't support this callback, so when sessionDestroyed is triggered by the development server, it's not within an active request and hence the exception that you're seeing. In the production environment, you would see a similar result if the callback is even triggered at all. The fact that the development server does trigger sessionDestroyed is a bug in the SDK. Please file a new report in our public tracker, and I'm sorry for the bad news.
これがもし本当なら、GAE 上で BlazeDS を使うのは結構厳しそうな気がします。
一例ですが、BlazeDS 3.2 のHttpFlexSession では、以下のようにライフサイクルイベントを前提としたコードがそれなりにあります。どうしたものか (´・ω・`)
/** * Implements HttpSessionListener. * When an HttpSession is destroyed, the associated HttpFlexSession is also destroyed. * NOTE: This method is not invoked against an HttpFlexSession associated with a request * handling thread. */ public void sessionDestroyed(HttpSessionEvent event) { HttpSession session = event.getSession(); Map httpSessionToFlexSessionMap = getHttpSessionToFlexSessionMap(session); HttpFlexSession flexSession = (HttpFlexSession)httpSessionToFlexSessionMap.remove(session.getId()); if (flexSession != null) { // invalidate the flex session flexSession.superInvalidate(); // Send notifications to attribute listeners if needed // This may send extra notifications if attributeRemoved is called first by the server, // but Java servlet 2.4 says session destroy is first, then attributes. for (Enumeration e = session.getAttributeNames(); e.hasMoreElements(); ) { String name = (String) e.nextElement(); if (name.equals(SESSION_ATTRIBUTE)) continue; Object value = session.getAttribute(name); if (value != null) { flexSession.notifyAttributeUnbound(name, value); flexSession.notifyAttributeRemoved(name, value); } } } }
しかし、本当にそうなのか?
ということで、GAE/J 環境の Application Lifecycle Listener の実験をしてみました。
0 件のコメント:
コメントを投稿