Fixed infinite recursion due to method renaming.

This commit is contained in:
Simone Bordet 2012-11-22 12:12:36 +01:00 committed by Greg Wilkins
parent b2c03b04f1
commit 9f86d36d6c
1 changed files with 11 additions and 11 deletions

View File

@ -182,9 +182,9 @@ public class HttpSender
StatefulExecutorCallback callback = new StatefulExecutorCallback(client.getExecutor())
{
@Override
protected void pendingCompleted()
protected void onSucceeded()
{
LOG.debug("Write completed for {}", request);
LOG.debug("Write succeeded for {}", request);
if (!commit(request))
return;
@ -215,7 +215,7 @@ public class HttpSender
write(callback, header, chunk, expect100 ? null : contentInfo.content);
if (callback.isPending())
if (callback.process())
{
LOG.debug("Write pending for {}", request);
return;
@ -464,7 +464,7 @@ public class HttpSender
State previous = state.get();
while (true)
{
if (state.compareAndSet(previous, State.COMPLETE))
if (state.compareAndSet(previous, State.SUCCEEDED))
break;
previous = state.get();
}
@ -475,10 +475,10 @@ public class HttpSender
@Override
public final void run()
{
pendingCompleted();
onSucceeded();
}
protected abstract void pendingCompleted();
protected abstract void onSucceeded();
@Override
public final void failed(final Throwable x)
@ -497,26 +497,26 @@ public class HttpSender
@Override
public void run()
{
failed(x);
onFailed(x);
}
});
}
else
{
failed(x);
onFailed(x);
}
}
protected abstract void onFailed(Throwable x);
public boolean isPending()
public boolean process()
{
return state.compareAndSet(State.INCOMPLETE, State.PENDING);
}
public boolean isSucceeded()
{
return state.get() == State.COMPLETE;
return state.get() == State.SUCCEEDED;
}
public boolean isFailed()
@ -526,7 +526,7 @@ public class HttpSender
private enum State
{
INCOMPLETE, PENDING, COMPLETE, FAILED
INCOMPLETE, PENDING, SUCCEEDED, FAILED
}
}