/** * @since 5.0 */ public void updateState(final Object state) { this.state = state; this.updated = getCurrentTime(); }
/** * @since 5.0 */ public void updateState(final Object state) { this.state = state; this.updated = getCurrentTime(); }
/** * @since 5.0 */ public void assignConnection(final C conn) { Args.notNull(conn, "connection"); if (this.connRef.compareAndSet(null, conn)) { this.created = getCurrentTime(); this.updated = this.created; this.validityDeadline = Deadline.calculate(this.created, this.timeToLive); this.expiryDeadline = this.validityDeadline; this.state = null; } else { throw new IllegalStateException("Connection already assigned"); } }
/** * @since 5.0 */ public void assignConnection(final C conn) { Args.notNull(conn, "connection"); if (this.connRef.compareAndSet(null, conn)) { this.created = getCurrentTime(); this.updated = this.created; this.validityDeadline = Deadline.calculate(this.created, this.timeToLive); this.expiryDeadline = this.validityDeadline; this.state = null; } else { throw new IllegalStateException("Connection already assigned"); } }
/** * @since 5.0 */ public void updateExpiry(final TimeValue expiryTime) { Args.notNull(expiryTime, "Expiry time"); final long currentTime = getCurrentTime(); final Deadline newExpiry = Deadline.calculate(currentTime, expiryTime); this.expiryDeadline = newExpiry.min(this.validityDeadline); this.updated = currentTime; }
/** * @since 5.0 */ public void updateExpiry(final TimeValue expiryTime) { Args.notNull(expiryTime, "Expiry time"); final long currentTime = getCurrentTime(); final Deadline newExpiry = Deadline.calculate(currentTime, expiryTime); this.expiryDeadline = newExpiry.min(this.validityDeadline); this.updated = currentTime; }