Code example for ArrayBlockingQueue

Methods: offerpoll

0
			appender.start();
			started = true;
		} 
 
		// Try to offer data to the queue 
		boolean is_full = !queue.offer( MESSAGE);
 
		// If it's full, remove the latest item and try again 
		if (is_full){
			queue.poll();
			queue.offer( MESSAGE);
		} 
	} 
 
	/** 
	 * @param date log time 
	 * @param logData log message 
	 * @param level log severity level 
	 * @return eg. <i>Mon 29 Aug 09:06:48 +0000 2011, severity=DEBUG, 	log message</i> 
	 */ 
	public String format(Date date, String logData, Level level) {