/** * This method is synchronized so that the validity check and validity change is atomic for callers of this method. * @return */ @Override public synchronized T getResourceIfValid() { if (this.valid) { return getResource(); } else { return null; } } }
/** * This method is synchronized so that the validity check and validity change is atomic for callers of this method. * @return */ @Override public synchronized T getResourceIfValid() { if (this.valid) { return getResource(); } else { return null; } } }