code: private ChaiProviderImplementor getProviderImpl( )
              throws ChaiUnavailableException
      {
          if ( realProvider != null && !realProvider.isConnected() )
          {
              disconnectRealProvider( "underlying connection has already been closed" );
          }
  
          switch ( wdStatus )
          {
              case CLOSED:
                  throw new IllegalStateException( "ChaiProvider instance has been closed" );
  
              case ACTIVE:
                  return realProvider;
  
              case IDLE:
                  return restoreRealProvider();
  
              default:
                  throw new IllegalStateException( "unexpected internal ProviderState encountered: " + wdStatus );
          }
  
      }
docs: /* internal un-synchronized methods below