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

Gavin King gavin.king at jboss.com
Fri Feb 9 10:17:04 EST 2007


  User: gavin   
  Date: 07/02/09 10:17:04

  Modified:    src/main/org/jboss/seam/core  Events.java
  Log:
  exception
  
  Revision  Changes    Path
  1.20      +15 -5     jboss-seam/src/main/org/jboss/seam/core/Events.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Events.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Events.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  --- Events.java	9 Feb 2007 15:12:47 -0000	1.19
  +++ Events.java	9 Feb 2007 15:17:04 -0000	1.20
  @@ -79,7 +79,17 @@
      
      public void raiseAsynchronousEvent(String type, Object... parameters)
      {
  -      Dispatcher.instance().scheduleEvent(type, 0l, null, null, parameters);
  +      getDispatcher().scheduleEvent(type, 0l, null, null, parameters);
  +   }
  +
  +   protected LocalDispatcher getDispatcher()
  +   {
  +      LocalDispatcher dispatcher = Dispatcher.instance();
  +      if (dispatcher==null)
  +      {
  +         throw new IllegalStateException("org.jboss.seam.core.dispatcher is not installed");
  +      }
  +      return dispatcher;
      }
      
      public void raiseTransactionSuccessEvent(String type, Object... parameters)
  @@ -94,22 +104,22 @@
      
      public void raiseTimedEvent(String type, long duration, Object... parameters)
      {
  -      Dispatcher.instance().scheduleEvent(type, duration, null, null, parameters);
  +      getDispatcher().scheduleEvent(type, duration, null, null, parameters);
      }
      
      public void raiseTimedEvent(String type, Date expiration, Object... parameters)
      {
  -      Dispatcher.instance().scheduleEvent(type, null, expiration, null, parameters);
  +      getDispatcher().scheduleEvent(type, null, expiration, null, parameters);
      }
      
      public void raiseTimedEvent(String type, Date expiration, long intervalDuration, Object... parameters)
      {
  -      Dispatcher.instance().scheduleEvent(type, null, expiration, intervalDuration, parameters);
  +      getDispatcher().scheduleEvent(type, null, expiration, intervalDuration, parameters);
      }
      
      public void raiseTimedEvent(String type, long duration, long intervalDuration)
      {
  -      Dispatcher.instance().scheduleEvent(type, duration, null, intervalDuration);
  +      getDispatcher().scheduleEvent(type, duration, null, intervalDuration);
      }
      
      public static boolean exists()
  
  
  



More information about the jboss-cvs-commits mailing list