dev@grizzly.java.net

Should notificationObject be Instance of Future in Grizzly 2.0?

From: ming qin <mingqin1_at_yahoo.com>
Date: Mon, 15 Jun 2009 14:31:03 -0700 (PDT)

   Grizzly 2.0 
framework( grizzly-framework) API is based on
java.util.concurrent.Future.    In release 2.0.0-M3, only one class  ( 
com.sun.grizzly.utils.conditions.DefaultConditionListener) is referring  java.util.concurrent.Callable( another is  Junit test class-  AsyncWriteQueueTest.java).


 

   Since there are no other  classes referring Callable  except  DefaultConditionListener itself   in whole
grizzly-framework API,  doesn't nofiyListernObject
method  need care about noticationObject as instance of Callable?

 
Below is notifyListenerObject method,


public static final void notifyListenerObject(Object
notificationObject) {

        if
(notificationObject instanceof CountDownLatch) {

           ….

        } else if
(notificationObject instanceof Callable) {

            …….

            }

        } else if
(notificationObject instanceof Runnable) {

          ………

        } else {

           
synchronized (notificationObject) {

               
notificationObject.notify();

            }

        }

    }


Ming Qin

Cell Phone 858-353-2839