[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...

Gavin King gavin.king at jboss.com
Wed May 30 19:23:46 EDT 2007


  User: gavin   
  Date: 07/05/30 19:23:46

  Modified:    src/main/org/jboss/seam/core   Dispatcher.java
                        LocalDispatcher.java
  Log:
  JBSEAM-1218
  
  Revision  Changes    Path
  1.18      +27 -14    jboss-seam/src/main/org/jboss/seam/core/Dispatcher.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Dispatcher.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Dispatcher.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -b -r1.17 -r1.18
  --- Dispatcher.java	26 Feb 2007 20:56:58 -0000	1.17
  +++ Dispatcher.java	30 May 2007 23:23:45 -0000	1.18
  @@ -41,7 +41,7 @@
   @Name("org.jboss.seam.core.dispatcher")
   @Interceptors(SeamInterceptor.class)
   @Install(value=false, precedence=BUILT_IN)
  -public class Dispatcher implements LocalDispatcher
  +public class Dispatcher implements LocalDispatcher<Timer>
   {
      
      public static final String EXECUTING_ASYNCHRONOUS_CALL = "org.jboss.seam.core.executingAsynchronousCall";
  @@ -240,12 +240,17 @@
      
       public Object call(Callable task) 
       {
  -        try {
  +        try 
  +        {
               return task.call();
  -        } catch (RuntimeException e) {
  +        } 
  +        catch (RuntimeException e) 
  +        {
               // just pass along runtime exceptions
               throw e;
  -        } catch (Exception e) {
  +        } 
  +        catch (Exception e) 
  +        {
               throw new RuntimeException(e);
           }
       }
  @@ -275,7 +280,8 @@
                   EJBException
           {
               callInContext(new Callable() {
  -                    public Object call() {
  +                    public Object call() 
  +                    {
                           timer.cancel();
                           return null;
                       }
  @@ -290,7 +296,8 @@
           {
               TimerHandle handle = (TimerHandle) 
                   callInContext(new Callable() {
  -                        public Object call() {
  +                        public Object call() 
  +                        {
                               return timer.getHandle();
                           }
                       });
  @@ -305,7 +312,8 @@
           {
               return (Serializable) 
                   callInContext(new Callable() {
  -                        public Object call() {
  +                        public Object call() 
  +                        {
                               return timer.getInfo();
                           }
                       });            
  @@ -318,7 +326,8 @@
           {
               return (Date) 
                   callInContext(new Callable() {
  -                        public Object call() {
  +                        public Object call() 
  +                        {
                               return timer.getNextTimeout();
                           }
                       });            
  @@ -331,7 +340,8 @@
           {
               return (Long) 
                   callInContext(new Callable() {
  -                        public Object call() {
  +                        public Object call() 
  +                        {
                               return timer.getTimeRemaining();
                           }
                       });  
  @@ -346,11 +356,13 @@
         
           TimerHandle handle;
   
  -        public TimerHandleProxy(TimerHandle handle) {
  +        public TimerHandleProxy(TimerHandle handle) 
  +        {
               this.handle = handle;
           }
           
  -        private Object callInContext(Callable callable) {
  +        private Object callInContext(Callable callable) 
  +        {
               return Dispatcher.instance().call(callable);
           }
   
  @@ -359,8 +371,9 @@
                      NoSuchObjectLocalException,
                      EJBException 
           {
  -            Timer timer = (Timer) callInContext(new Callable() {
  -                public Object call() {
  +            Timer timer = (Timer) callInContext( new Callable() {
  +                public Object call() 
  +                {
                       try
                       {
                           return handle.getTimer();
  @@ -370,7 +383,7 @@
                           return null;
                       }           
                   }
  -            });
  +            } );
               if (timer==null)
               {
                  throw new NoSuchObjectLocalException();
  
  
  
  1.10      +11 -4     jboss-seam/src/main/org/jboss/seam/core/LocalDispatcher.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: LocalDispatcher.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/LocalDispatcher.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- LocalDispatcher.java	26 Jan 2007 04:19:21 -0000	1.9
  +++ LocalDispatcher.java	30 May 2007 23:23:45 -0000	1.10
  @@ -4,16 +4,23 @@
   import java.util.concurrent.Callable;
   
   import javax.ejb.Local;
  -import javax.ejb.Timer;
   
   import org.jboss.seam.Component;
   import org.jboss.seam.intercept.InvocationContext;
   
   @Local
  -public interface LocalDispatcher
  +public interface LocalDispatcher<T>
   {
  -   public Timer scheduleInvocation(InvocationContext invocation, Component component);
  -   public Timer scheduleEvent(String type, Long duration, Date expiration, Long intervalDuration, Object... parameters);
  +   /**
  +    * Schedule an asynchronous method call.
  +    * @return some kind of timer object, or null
  +    */
  +   public T scheduleInvocation(InvocationContext invocation, Component component);
  +   /**
  +    * Schedule an asynchronous method call.
  +    * @return some kind of timer object, or null
  +    */
  +   public T scheduleEvent(String type, Long duration, Date expiration, Long intervalDuration, Object... parameters);
       
      public Object call(Callable task);
   }
  
  
  



More information about the jboss-cvs-commits mailing list