private void permissionWithoutUsage ( ) { if ( isUsingNonJava ) return ; synchronized ( permanentUserReadWriteLock ) { permissionWithoutUsageLimit = LocalDateTime . now ( ) . plus ( 10 , ChronoUnit . SECONDS ) ; permissionWithoutUsageCloseThread = getMain ( ) . getThreadPoolManager ( ) . getAddOnsThreadPool ( ) . submit ( ( Runnable ) ( ) -> { try { Thread . sleep ( 10000 ) ; fireLineAccessEndedNotification ( ) ; endPermanent ( permanentAddOn ) ; } catch ( InterruptedException ignored ) { //ignored.printStackTrace(); } } ) ; } }
creates a LocaleDateTime - Object 10 seconds in the Future and a Thread which will remove it if it passes the threshold . the Thread