code: @Override
      public void atPassivate(BeanId beanId) throws RemoteException
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "atPassivate " + beanId);
  
          BeanO bean = null;
          MasterKey key = new MasterKey(beanId);
  
          try {
  
              synchronized (locks.getLock(key)) {
  
                  if ((bean = (BeanO) cache.findDontPinNAdjustPinCount(key, 0)) != null)
                  {
                      bean.passivate();
                      cache.remove(key, false);
                      bean.ivCacheKey = null; // d199233
                      if (EJSPlatformHelper.isZOS() || // LIDB2775-23.4
                          passivationPolicy.equals(PassivationPolicy.ON_DEMAND))
                      {
                          reaper.remove(beanId);
                      }
                  }
              }
  
          } catch (RemoteException ex) {
              FFDCFilter.processException(ex, CLASS_NAME + ".atPassivate", "525", this);
              Tr.warning(tc, "UNABLE_TO_PASSIVATE_EJB_CNTR0005W",
                         new Object[] { bean, this, ex }); //p111002.3
              throw ex;
          }
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "atPassivate");
      }
docs: This method will be invoked when the server invokes one of passivate
  or passivateAll on the ManagedContainer interface.
  
  On z/OS, this method will be invoked when the server invokes one of passivateAll
  on the ManagedContainer interface or during normal server stop,
  starting at EJSContainer.stopBean->Activator.uninstallBean. This is not
  the same as Distributed. In Distributed the atUninstall method is called
  on this class because for some reason they feel that normal server
  stop is like server going down. And they want to get rid of all the Stateful
  session beans, cached and passivated. See atUninstall description.