code: @Override
      public long getTimeRemaining()
                      throws IllegalStateException,
                      NoSuchObjectLocalException,
                      EJBException
      {
          Date nextTime = getNextTimeout();
          long currentTime = System.currentTimeMillis();
          long remaining = nextTime.getTime() - currentTime;
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              Tr.debug(tc, "getTimeRemaining: " + remaining);
  
          return remaining;
      }
docs: Get the number of milliseconds that will elapse before the next
  scheduled timer expiration. <p>
  
  Per EJB 3.1 section 18.2.5.3, If the bean invokes the getNextTimeout or
  getTimeRemaining method on the timer associated with a timeout callback
  while within the timeout callback, and there are no future timeouts for
  this calendar-based timer, a NoMoreTimeoutsException must be thrown.
  
  @exception IllegalStateException If this method is invoked while the
  instance is in a state that does not allow access to this method.
  @exception NoSuchObjectLocalException If invoked on a timer that has
  expired or has been canceled.
  @exception EJBException If this method could not complete due to a
  system-level failure.