code: private static Adapter tryAdapter( Class adapterClass, Object externalContext )
      {
          try
          {
              Adapter sa = ( Adapter ) adapterClass.newInstance();
  
              try
              {
                  AdapterContext context = new AdapterContext( externalContext );
                  
                  if ( sa.accept( context ) )
                  {
                      _log.info( "Adapter " + adapterClass.getName() + " accepted." );
                      sa.setContext( context );
                      return sa;
                  }
                  else
                  {
                      _log.info( "Adapter " + adapterClass.getName() + " is present but did not accept." );
                  }
              }
              catch ( Exception e )
              {
                  _log.error( adapterClass.getName() + ".accept() threw an exception.", e );
              }
              catch ( LinkageError e )
              {
                  _log.error( adapterClass.getName() + ".accept() caused a linkage error and may be out of date.", e );
              }
          }
          catch ( InstantiationException e )
          {
              _log.error( "Could not create instance of Adapter class " + adapterClass.getName(), e );
          }
          catch ( IllegalAccessException e )
          {
              _log.error( "Could not create instance of Adapter class " + adapterClass.getName(), e );
          }
          catch ( Exception e )
          {
              _log.error( "Error creating instance of Adapter class " + adapterClass.getName(), e );
          }
  
          return null;
      }
docs: TODO: this method could move to a more general place.