code: public void run()
      {
          Folder folder = this.getInboxFolder();
          
          if (folder != null)
              this.processMail(folder);
  
          try {
              folder.close(true);
          } catch (MessagingException e) {
              e.printStackTrace();
          }
      }
docs: Run the code in this process.