code: public boolean cancel(boolean mayInterruptIfRunning) {
          final boolean isTraceOn = svLogger.isLoggable(Level.FINER);
          if (isTraceOn)
              svLogger.entering(CLASS_NAME, "cancel", new Object[] { toString(), Boolean.valueOf(mayInterruptIfRunning) });
  
          boolean cancelled = false;
  
          try {
              cancelled = (ivServer != null ? ivServer.cancel(mayInterruptIfRunning) : false);
              if (cancelled) {
                  ivCancellationException = new CancellationException(); // d614994
                  ivDone = true;
                  ivServer = null;
              }
          } catch (RemoteException e) {
              // Throw an EJBException to the client.
              EJBException ejbEx = initCause(new EJBException(e));
              if (isTraceOn)
                  svLogger.exiting(CLASS_NAME, "cancel", ejbEx);
              throw ejbEx;
          }
  
          if (isTraceOn)
              svLogger.exiting(CLASS_NAME, "cancel", Boolean.valueOf(cancelled));
          return cancelled;
      }
docs: Cancel the asynchronous method if possible. If the method is still waiting
  on a work manager queue and has not been dispatched, we can cancel it.
  Otherwise, it is not likely that the method will be able to stop
  execution.<p>
  
  @param mayInterruptIfRunning
  
  @return - true if the method was successfully canceled. Otherwise, false.