Code example for ScheduledFuture

Methods: cancel

0
		this.future = future;
	} 
 
	public synchronized void cancel() { 
		if (state == MESSAGE_STATE_WAITING) {
			future.cancel(false);
			this.setState(MESSAGE_STATE_CANCELED);
		} else if (state == MESSAGE_STATE_INQUEUE) {
			this.setState(MESSAGE_STATE_CANCELED);
		} 
	} 
 
	public long getCreateTimestamp() { 
		return createTimestamp;
	} 
 
	@Override 
	public boolean read() throws MessageParseException { 
		throw new UnsupportedOperationException();
	}