Code example for ReentrantLock

Methods: newCondition

0
import android.util.SparseArray; 
 
import fr.fagno.android.caws.app.AppLog; 
 
public class ChatHandler implements HttpRequestHandler {
	private final ReentrantLock lock = new ReentrantLock();
	private final Condition newMessageReceived = lock.newCondition();
 
	private int counter = -1;
	private final int MAX_MESSAGES_SAVED = 30;
	SparseArray<String> Lastmessages = new SparseArray<String>();
	Map<String, String> newContent = new HashMap<String, String>();
 
	public ChatHandler(Context context){
	} 
 
	@Override 
	public void handle(HttpRequest request, HttpResponse response, HttpContext httpContext) throws HttpException, IOException {
		String bodyResponse = new String();
		AppLog.logString("CH:UpdateHandling: " + request.getRequestLine().getMethod());