/** * Gets a String representation of the current time. * @return a String representation of the current time. */ public String getTimeStamp() { return formatDate(new Date()); } /**
@Override public void setCacheTimeOffset(DistributedMember coord, long offset, boolean isJoin) { // No use of coord and isJoin. They are only used for non-loner system. if (offset > this.systemTimeDelta) { long theTime = System.currentTimeMillis(); this.systemTimeDelta = offset; String cacheTime = ((LogWriterImpl) this.logger).formatDate(new Date( theTime + offset)); this.logger.info(LocalizedStrings.LonerDistributionManager_Cache_Time, new Object[] { cacheTime, this.systemTimeDelta }); } }
pw.print(record.getLevel().getName()); pw.print(' '); pw.print(logWriter.formatDate(new Date(record.getMillis()))); String threadName = Thread.currentThread().getName(); if (threadName != null) {
@Override public void setCacheTimeOffset(DistributedMember coord, long offset, boolean isJoin) { if (isJoin || offset > this.cacheTimeDelta) { long theTime = System.currentTimeMillis(); this.cacheTimeDelta = offset; if (this.cacheTimeDelta <= -300000 || 300000 <= this.cacheTimeDelta) { this.logger.warning(LocalizedStrings.DistributionManager_Time_Skew_Warning, coord); } String cacheTime = ((LogWriterImpl)this.logger).formatDate(new Date(theTime + offset)); if (Math.abs(this.cacheTimeDelta) > 1000) { Object src = coord; if (src == null) { src = "local clock adjustment"; } this.logger.info(LocalizedStrings.DistributionManager_Cache_Time, new Object[]{ src, cacheTime, this.cacheTimeDelta }); } } else if (!isJoin && offset < this.cacheTimeDelta) { // We need to suspend the cacheTimeMillis for (cacheTimeDelta - offset) ms. if ((this.cacheTimeDelta - offset) >= MAX_TIME_OFFSET_DIFF /* Max offset difference allowed */) { this.logger.warning(LocalizedStrings.DistributionManager_Cache_Time_Offset_Skew_Warning, (this.cacheTimeDelta - offset)); } cancelAndscheduleNewCacheTimerTask(offset); } }