code
stringlengths 23
201k
| docstring
stringlengths 17
96.2k
| func_name
stringlengths 0
235
| language
stringclasses 1
value | repo
stringlengths 8
72
| path
stringlengths 11
317
| url
stringlengths 57
377
| license
stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Override
public T take() throws InterruptedException {
pauseLock.lock();
try {
while (isPaused) {
unpaused.await();
}
} catch (InterruptedException ie) {
throw new RuntimeException("Interrupted while paused.");
} finally {
pauseLock.unlock();
}
return super.take();
}
|
This class is used internally. It makes testing easier. The queue will not
allow to {@link #poll()} or {@link #take()} an element when paused.
@author SNI
|
take
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausablePriorityBlockingQueue.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausablePriorityBlockingQueue.java
|
Apache-2.0
|
public void pause() {
pauseLock.lock();
try {
isPaused = true;
} finally {
pauseLock.unlock();
}
}
|
This class is used internally. It makes testing easier. The queue will not
allow to {@link #poll()} or {@link #take()} an element when paused.
@author SNI
|
pause
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausablePriorityBlockingQueue.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausablePriorityBlockingQueue.java
|
Apache-2.0
|
public void resume() {
pauseLock.lock();
try {
isPaused = false;
unpaused.signalAll();
} finally {
pauseLock.unlock();
}
}
|
This class is used internally. It makes testing easier. The queue will not
allow to {@link #poll()} or {@link #take()} an element when paused.
@author SNI
|
resume
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausablePriorityBlockingQueue.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausablePriorityBlockingQueue.java
|
Apache-2.0
|
private void readObject(ObjectInputStream ois) {
try {
ois.defaultReadObject();
pauseLock = new ReentrantLock();
pauseLock.newCondition();
} catch (Exception e) {
e.printStackTrace();
}
}
|
This class is used internally. It makes testing easier. The queue will not
allow to {@link #poll()} or {@link #take()} an element when paused.
@author SNI
|
readObject
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausablePriorityBlockingQueue.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausablePriorityBlockingQueue.java
|
Apache-2.0
|
public void pause() {
((PausablePriorityBlockingQueue<Runnable>) getQueue()).pause();
}
|
Creates a thread pool executor with a
{@link PausablePriorityBlockingQueue} and low priority threads.
@param poolSize
the size of the pool of threads.
|
pause
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausableThreadPoolExecutor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausableThreadPoolExecutor.java
|
Apache-2.0
|
public void resume() {
((PausablePriorityBlockingQueue<Runnable>) getQueue()).resume();
}
|
Creates a thread pool executor with a
{@link PausablePriorityBlockingQueue} and low priority threads.
@param poolSize
the size of the pool of threads.
|
resume
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausableThreadPoolExecutor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PausableThreadPoolExecutor.java
|
Apache-2.0
|
public int getPriority() {
return priority;
}
|
A future with priority, from <a href=
"http://stackoverflow.com/q/807223/693752">SOF</a>
@author SNI
@param <T>
the type of the future's return.
|
getPriority
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PriorityFuture.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PriorityFuture.java
|
Apache-2.0
|
@Override
public int compareTo(PriorityFuture<T> other) {
return priority - other.priority;
}
|
A future with priority, from <a href=
"http://stackoverflow.com/q/807223/693752">SOF</a>
@author SNI
@param <T>
the type of the future's return.
|
compareTo
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PriorityFuture.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PriorityFuture.java
|
Apache-2.0
|
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + priority;
return result;
}
|
A future with priority, from <a href=
"http://stackoverflow.com/q/807223/693752">SOF</a>
@author SNI
@param <T>
the type of the future's return.
|
hashCode
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PriorityFuture.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PriorityFuture.java
|
Apache-2.0
|
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
PriorityFuture<?> other = (PriorityFuture<?>) obj;
if (priority != other.priority) {
return false;
}
return true;
}
|
A future with priority, from <a href=
"http://stackoverflow.com/q/807223/693752">SOF</a>
@author SNI
@param <T>
the type of the future's return.
|
equals
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PriorityFuture.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/priority/PriorityFuture.java
|
Apache-2.0
|
@Override
public RetryPolicy getRetryPolicy() {
return spiceRequest.getRetryPolicy();
}
|
Decorates {@link SpiceRequest} and provides additional information used by
RoboSpice. There are very few chances that you should use this class directly, though you can.
But generally speaking,
{@link com.octo.android.robospice.SpiceManager#execute(SpiceRequest, Object, long, com.octo.android.robospice.request.listener.RequestListener)}
is considered to be more clear.
@author SNI
@param <RESULT>
|
getRetryPolicy
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public void setRetryPolicy(RetryPolicy retryPolicy) {
spiceRequest.setRetryPolicy(retryPolicy);
}
|
Decorates {@link SpiceRequest} and provides additional information used by
RoboSpice. There are very few chances that you should use this class directly, though you can.
But generally speaking,
{@link com.octo.android.robospice.SpiceManager#execute(SpiceRequest, Object, long, com.octo.android.robospice.request.listener.RequestListener)}
is considered to be more clear.
@author SNI
@param <RESULT>
|
setRetryPolicy
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public RESULT loadDataFromNetwork() throws Exception {
return spiceRequest.loadDataFromNetwork();
}
|
Decorates {@link SpiceRequest} and provides additional information used by
RoboSpice. There are very few chances that you should use this class directly, though you can.
But generally speaking,
{@link com.octo.android.robospice.SpiceManager#execute(SpiceRequest, Object, long, com.octo.android.robospice.request.listener.RequestListener)}
is considered to be more clear.
@author SNI
@param <RESULT>
|
loadDataFromNetwork
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public Class<RESULT> getResultType() {
return spiceRequest.getResultType();
}
|
Decorates {@link SpiceRequest} and provides additional information used by
RoboSpice. There are very few chances that you should use this class directly, though you can.
But generally speaking,
{@link com.octo.android.robospice.SpiceManager#execute(SpiceRequest, Object, long, com.octo.android.robospice.request.listener.RequestListener)}
is considered to be more clear.
@author SNI
@param <RESULT>
|
getResultType
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public boolean isAggregatable() {
return spiceRequest.isAggregatable();
}
|
Decorates {@link SpiceRequest} and provides additional information used by
RoboSpice. There are very few chances that you should use this class directly, though you can.
But generally speaking,
{@link com.octo.android.robospice.SpiceManager#execute(SpiceRequest, Object, long, com.octo.android.robospice.request.listener.RequestListener)}
is considered to be more clear.
@author SNI
@param <RESULT>
|
isAggregatable
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public void setAggregatable(final boolean isAggregatable) {
spiceRequest.setAggregatable(isAggregatable);
}
|
Decorates {@link SpiceRequest} and provides additional information used by
RoboSpice. There are very few chances that you should use this class directly, though you can.
But generally speaking,
{@link com.octo.android.robospice.SpiceManager#execute(SpiceRequest, Object, long, com.octo.android.robospice.request.listener.RequestListener)}
is considered to be more clear.
@author SNI
@param <RESULT>
|
setAggregatable
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
public boolean isProcessable() {
return isProcessable;
}
|
Decorates {@link SpiceRequest} and provides additional information used by
RoboSpice. There are very few chances that you should use this class directly, though you can.
But generally speaking,
{@link com.octo.android.robospice.SpiceManager#execute(SpiceRequest, Object, long, com.octo.android.robospice.request.listener.RequestListener)}
is considered to be more clear.
@author SNI
@param <RESULT>
|
isProcessable
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
public void setProcessable(final boolean isProcessable) {
this.isProcessable = isProcessable;
}
|
Decorates {@link SpiceRequest} and provides additional information used by
RoboSpice. There are very few chances that you should use this class directly, though you can.
But generally speaking,
{@link com.octo.android.robospice.SpiceManager#execute(SpiceRequest, Object, long, com.octo.android.robospice.request.listener.RequestListener)}
is considered to be more clear.
@author SNI
@param <RESULT>
|
setProcessable
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
protected void setFuture(final Future<?> future) {
spiceRequest.setFuture(future);
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
setFuture
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public void cancel() {
spiceRequest.cancel();
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
cancel
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public boolean isCancelled() {
return spiceRequest.isCancelled();
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
isCancelled
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
protected void setRequestProgressListener(final RequestProgressListener requestProgressListener) {
spiceRequest.setRequestProgressListener(requestProgressListener);
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
setRequestProgressListener
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public void setRequestCancellationListener(final RequestCancellationListener requestCancellationListener) {
spiceRequest.setRequestCancellationListener(requestCancellationListener);
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
setRequestCancellationListener
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
protected void publishProgress(final float progress) {
spiceRequest.publishProgress(progress);
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
publishProgress
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
public Object getRequestCacheKey() {
return requestCacheKey;
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
getRequestCacheKey
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
public long getCacheDuration() {
return cacheDuration;
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
getCacheDuration
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
public SpiceRequest<RESULT> getSpiceRequest() {
return spiceRequest;
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
getSpiceRequest
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
void setStatus(final RequestStatus status) {
spiceRequest.setStatus(status);
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
setStatus
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
RequestProgress getProgress() {
return spiceRequest.getProgress();
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
getProgress
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public void setPriority(int priority) {
spiceRequest.setPriority(priority);
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
setPriority
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public int getPriority() {
return spiceRequest.getPriority();
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
getPriority
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
public boolean isAcceptingDirtyCache() {
return isAcceptingDirtyCache;
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
isAcceptingDirtyCache
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
public void setAcceptingDirtyCache(boolean isAcceptingDirtyCache) {
this.isAcceptingDirtyCache = isAcceptingDirtyCache;
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
setAcceptingDirtyCache
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
public boolean isOffline() {
return isOffline;
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
isOffline
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
public void setOffline(boolean isOffline) {
this.isOffline = isOffline;
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
setOffline
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public String toString() {
return "CachedSpiceRequest [requestCacheKey=" + requestCacheKey + ", cacheDuration=" + cacheDuration + ", spiceRequest=" + spiceRequest + "]";
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
toString
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (spiceRequest.getResultType() == null ? 0 : spiceRequest.getResultType().hashCode());
result = prime * result + (requestCacheKey == null ? 0 : requestCacheKey.hashCode());
return result;
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
hashCode
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
// http://stackoverflow.com/q/596462/693752
if (!(obj instanceof CachedSpiceRequest)) {
return false;
}
final CachedSpiceRequest<?> other = (CachedSpiceRequest<?>) obj;
if (spiceRequest.getResultType() == null && other.spiceRequest.getResultType() != null) {
return false;
}
if (!spiceRequest.getResultType().equals(other.spiceRequest.getResultType())) {
return false;
}
if (spiceRequest.isAggregatable() != other.spiceRequest.isAggregatable()) {
return false;
}
if (requestCacheKey == null || !requestCacheKey.equals(other.requestCacheKey)) {
return false;
}
return true;
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
equals
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
@Override
public int compareTo(SpiceRequest<RESULT> other) {
if (this == other) {
return 0;
}
if (other == null) {
return -1;
}
return this.spiceRequest.compareTo(other);
}
|
Sets the future of this request, used to cancel it.
@param future
the future result of this request.
|
compareTo
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/CachedSpiceRequest.java
|
Apache-2.0
|
public void executeRequest(CachedSpiceRequest<?> request) {
executorLock.lock();
try {
if (isStopped) {
Ln.d("Dropping request : " + request + " as runner is stopped.");
return;
}
planRequestExecution(request);
} finally {
executorLock.unlock();
}
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
executeRequest
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
protected <T> void processRequest(final CachedSpiceRequest<T> request) {
final long startTime = System.currentTimeMillis();
Ln.d("Processing request : " + request);
T result = null;
// add a progress listener to the request to be notified of
// progress during load data from network
final RequestProgressListener requestProgressListener = requestProgressManager.createProgressListener(request);
request.setRequestProgressListener(requestProgressListener);
if (request.getRequestCacheKey() != null && request.getCacheDuration() != DurationInMillis.ALWAYS_EXPIRED) {
// First, search data in cache
try {
Ln.d("Loading request from cache : " + request);
request.setStatus(RequestStatus.READING_FROM_CACHE);
result = loadDataFromCache(request.getResultType(), request.getRequestCacheKey(), request.getCacheDuration());
// if something is found in cache, fire result and finish
// request
if (result != null) {
Ln.d("Request loaded from cache : " + request + " result=" + result);
requestProgressManager.notifyListenersOfRequestSuccess(request, result);
printRequestProcessingDuration(startTime, request);
return;
} else if (request.isAcceptingDirtyCache()) {
// as a fallback, some request may accept whatever is in the
// cache but still
// want an update from network.
result = loadDataFromCache(request.getResultType(), request.getRequestCacheKey(), DurationInMillis.ALWAYS_RETURNED);
if (result != null) {
requestProgressManager.notifyListenersOfRequestSuccessButDontCompleteRequest(request, result);
}
}
} catch (final SpiceException e) {
Ln.d(e, "Cache file could not be read.");
if (failOnCacheError) {
handleRetry(request, e);
printRequestProcessingDuration(startTime, request);
return;
}
cacheManager.removeDataFromCache(request.getResultType(), request.getRequestCacheKey());
Ln.d(e, "Cache file deleted.");
}
}
// if result is not in cache, load data from network
Ln.d("Cache content not available or expired or disabled");
if (!networkStateChecker.isNetworkAvailable(applicationContext) && !request.isOffline()) {
Ln.e("Network is down.");
if (!request.isCancelled()) {
// don't retry when there is no network
requestProgressManager.notifyListenersOfRequestFailure(request, new NoNetworkException());
}
printRequestProcessingDuration(startTime, request);
return;
}
// network is ok, load data from network
try {
if (request.isCancelled()) {
printRequestProcessingDuration(startTime, request);
return;
}
Ln.d("Calling netwok request.");
request.setStatus(RequestStatus.LOADING_FROM_NETWORK);
result = request.loadDataFromNetwork();
Ln.d("Network request call ended.");
} catch (final Exception e) {
if (!request.isCancelled()) {
Ln.e(e, "An exception occurred during request network execution :" + e.getMessage());
handleRetry(request, new NetworkException("Exception occurred during invocation of web service.", e));
} else {
Ln.e("An exception occurred during request network execution but request was cancelled, so listeners are not called.");
}
printRequestProcessingDuration(startTime, request);
return;
}
if (result != null && request.getRequestCacheKey() != null) {
// request worked and result is not null, save
// it to cache
try {
if (request.isCancelled()) {
printRequestProcessingDuration(startTime, request);
return;
}
Ln.d("Start caching content...");
request.setStatus(RequestStatus.WRITING_TO_CACHE);
result = saveDataToCacheAndReturnData(result, request.getRequestCacheKey());
if (request.isCancelled()) {
printRequestProcessingDuration(startTime, request);
return;
}
requestProgressManager.notifyListenersOfRequestSuccess(request, result);
printRequestProcessingDuration(startTime, request);
return;
} catch (final SpiceException e) {
Ln.d(e, "An exception occurred during service execution :" + e.getMessage());
if (failOnCacheError) {
handleRetry(request, e);
printRequestProcessingDuration(startTime, request);
return;
} else {
if (request.isCancelled()) {
printRequestProcessingDuration(startTime, request);
return;
}
// result can't be saved to
// cache but we reached that
// point after a success of load
// data from
// network
requestProgressManager.notifyListenersOfRequestSuccess(request, result);
}
cacheManager.removeDataFromCache(request.getResultType(), request.getRequestCacheKey());
Ln.d(e, "Cache file deleted.");
}
} else {
// result can't be saved to cache but we reached
// that point after a success of load data from
// network
requestProgressManager.notifyListenersOfRequestSuccess(request, result);
printRequestProcessingDuration(startTime, request);
return;
}
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
processRequest
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
protected void planRequestExecution(final CachedSpiceRequest<?> request) {
Future<?> future = executorService.submit(new PriorityRunnable() {
@Override
public void run() {
try {
processRequest(request);
} catch (final Throwable t) {
Ln.d(t, "An unexpected error occurred when processsing request %s", request.toString());
} finally {
request.setRequestCancellationListener(null);
}
}
@Override
public int getPriority() {
return request.getPriority();
}
});
request.setFuture(future);
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
planRequestExecution
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
@Override
public void run() {
try {
processRequest(request);
} catch (final Throwable t) {
Ln.d(t, "An unexpected error occurred when processsing request %s", request.toString());
} finally {
request.setRequestCancellationListener(null);
}
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
run
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
@Override
public int getPriority() {
return request.getPriority();
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
getPriority
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
public boolean isFailOnCacheError() {
return failOnCacheError;
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
isFailOnCacheError
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
public void setFailOnCacheError(boolean failOnCacheError) {
this.failOnCacheError = failOnCacheError;
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
setFailOnCacheError
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
public void shouldStop() {
executorLock.lock();
try {
isStopped = true;
executorService.shutdown();
} finally {
executorLock.unlock();
}
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
shouldStop
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
public boolean isStopped() {
return isStopped;
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
isStopped
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
private <T> T loadDataFromCache(final Class<T> clazz, final Object cacheKey, final long maxTimeInCacheBeforeExpiry) throws CacheLoadingException, CacheCreationException {
return cacheManager.loadDataFromCache(clazz, cacheKey, maxTimeInCacheBeforeExpiry);
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
loadDataFromCache
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
private <T> T saveDataToCacheAndReturnData(final T data, final Object cacheKey) throws CacheSavingException, CacheCreationException {
return cacheManager.saveDataToCacheAndReturnData(data, cacheKey);
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
saveDataToCacheAndReturnData
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
private void handleRetry(final CachedSpiceRequest<?> request, final SpiceException e) {
if (request.getRetryPolicy() != null) {
request.getRetryPolicy().retry(e);
if (request.getRetryPolicy().getRetryCount() > 0) {
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(request.getRetryPolicy().getDelayBeforeRetry());
executeRequest(request);
} catch (InterruptedException e) {
Ln.e(e, "Retry attempt failed for request " + request);
}
}
}).start();
return;
}
}
requestProgressManager.notifyListenersOfRequestFailure(request, e);
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
handleRetry
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
@Override
public void run() {
try {
Thread.sleep(request.getRetryPolicy().getDelayBeforeRetry());
executeRequest(request);
} catch (InterruptedException e) {
Ln.e(e, "Retry attempt failed for request " + request);
}
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
run
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
private static String getTimeString(long millis) {
return String.format("%02d ms", millis);
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
getTimeString
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
private static void printRequestProcessingDuration(long startTime, CachedSpiceRequest<?> request) {
Ln.d("It tooks %s to process request %s.", getTimeString(System.currentTimeMillis() - startTime), request.toString());
}
|
Thanks Olivier Croiser from Zenika for his excellent <a href=
"http://blog.zenika.com/index.php?post/2012/04/11/Introduction-programmation-concurrente-Java-2sur2. "
>blog article</a>.
|
printRequestProcessingDuration
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/DefaultRequestRunner.java
|
Apache-2.0
|
public boolean processBytes(final byte[] buffer, final int offset, final int length) throws IOException {
bos.write(buffer, offset, length);
progress += length - offset;
spiceRequest.publishProgress((float) progress / total);
return !Thread.interrupted();
}
|
Inspired from Guava com.google.common.io.ByteProcessor
|
processBytes
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/ProgressByteProcessor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/ProgressByteProcessor.java
|
Apache-2.0
|
public void addRequest(final CachedSpiceRequest<?> request, final Set<RequestListener<?>> listRequestListener) {
if (isStopped) {
Ln.d("Dropping request : " + request + " as processor is stopped.");
return;
}
Ln.d("Adding request to queue " + hashCode() + ": " + request + " size is " + mapRequestToRequestListener.size());
if (request.isCancelled()) {
synchronized (mapRequestToRequestListener) {
for (final CachedSpiceRequest<?> cachedSpiceRequest : mapRequestToRequestListener.keySet()) {
if (request.equals(cachedSpiceRequest)) {
cachedSpiceRequest.cancel();
requestProgressManager.notifyListenersOfRequestCancellation(request);
return;
}
}
}
}
boolean aggregated = false;
Set<RequestListener<?>> listRequestListenerForThisRequest;
synchronized (mapRequestToRequestListener) {
listRequestListenerForThisRequest = mapRequestToRequestListener.get(request);
if (listRequestListenerForThisRequest == null) {
if (request.isProcessable()) {
Ln.d("Adding entry for type %s and cacheKey %s.", request.getResultType(), request.getRequestCacheKey());
listRequestListenerForThisRequest = Collections.synchronizedSet(new HashSet<RequestListener<?>>());
this.mapRequestToRequestListener.put(request, listRequestListenerForThisRequest);
}
} else {
Ln.d("Request for type %s and cacheKey %s already exists.", request.getResultType(), request.getRequestCacheKey());
aggregated = true;
}
}
if (listRequestListener != null && listRequestListenerForThisRequest != null) {
listRequestListenerForThisRequest.addAll(listRequestListener);
}
if (aggregated) {
requestProgressManager.notifyListenersOfRequestAggregated(request, listRequestListener);
return;
}
if (request.isProcessable()) {
requestProgressManager.notifyListenersOfRequestAdded(request, listRequestListener);
} else {
if (listRequestListenerForThisRequest == null) {
requestProgressManager.notifyListenersOfRequestNotFound(request, listRequestListener);
}
requestProgressManager.notifyOfRequestProcessed(request, listRequestListener);
// we have to return if request is not processable.
// fix bug https://github.com/octo-online/robospice/issues/215
return;
}
final RequestCancellationListener requestCancellationListener = new RequestCancellationListener() {
@Override
public void onRequestCancelled() {
requestProgressManager.notifyListenersOfRequestCancellation(request);
mapRequestToRequestListener.remove(request);
}
};
request.setRequestCancellationListener(requestCancellationListener);
if (request.isCancelled()) {
requestProgressManager.notifyListenersOfRequestCancellation(request);
mapRequestToRequestListener.remove(request);
return;
} else {
requestRunner.executeRequest(request);
}
}
|
Build a request processor using a custom. This feature has been
implemented following a feature request from Riccardo Ciovati.
@param cacheManager
the {@link CacheManager} that will be used to retrieve
requests' result and store them.
@param requestProgressManager
@param requestRunner
|
addRequest
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
Apache-2.0
|
@Override
public void onRequestCancelled() {
requestProgressManager.notifyListenersOfRequestCancellation(request);
mapRequestToRequestListener.remove(request);
}
|
Build a request processor using a custom. This feature has been
implemented following a feature request from Riccardo Ciovati.
@param cacheManager
the {@link CacheManager} that will be used to retrieve
requests' result and store them.
@param requestProgressManager
@param requestRunner
|
onRequestCancelled
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
Apache-2.0
|
public void dontNotifyRequestListenersForRequest(final CachedSpiceRequest<?> request, final Collection<RequestListener<?>> listRequestListener) {
requestProgressManager.dontNotifyRequestListenersForRequest(request, listRequestListener);
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
dontNotifyRequestListenersForRequest
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
Apache-2.0
|
public boolean removeDataFromCache(final Class<?> clazz, final Object cacheKey) {
return cacheManager.removeDataFromCache(clazz, cacheKey);
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
removeDataFromCache
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
Apache-2.0
|
public boolean isFailOnCacheError() {
return requestRunner.isFailOnCacheError();
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
isFailOnCacheError
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
Apache-2.0
|
@Override
public String toString() {
final StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append('[');
stringBuilder.append(getClass().getName());
stringBuilder.append(" : ");
stringBuilder.append(" request count= ");
stringBuilder.append(mapRequestToRequestListener.keySet().size());
stringBuilder.append(", listeners per requests = [");
for (final Map.Entry<CachedSpiceRequest<?>, Set<RequestListener<?>>> entry : mapRequestToRequestListener.entrySet()) {
stringBuilder.append(entry.getKey().getClass().getName());
stringBuilder.append(":");
stringBuilder.append(entry.getKey());
stringBuilder.append(" --> ");
if (entry.getValue() == null) {
stringBuilder.append(entry.getValue());
} else {
stringBuilder.append(entry.getValue().size());
}
}
stringBuilder.append(']');
stringBuilder.append(']');
return stringBuilder.toString();
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
toString
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
Apache-2.0
|
public void shouldStop() {
isStopped = true;
requestRunner.shouldStop();
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
shouldStop
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
Apache-2.0
|
public boolean isStopped() {
return isStopped;
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
isStopped
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProcessor.java
|
Apache-2.0
|
public void setMapRequestToRequestListener(Map<CachedSpiceRequest<?>, Set<RequestListener<?>>> mapRequestToRequestListener) {
this.mapRequestToRequestListener = mapRequestToRequestListener;
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
setMapRequestToRequestListener
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public void notifyListenersOfRequestNotFound(final CachedSpiceRequest<?> request, final Set<RequestListener<?>> listeners) {
Ln.d("Request was *NOT* found when adding request listeners to existing requests.");
spiceServiceListenerNotifier.notifyObserversOfRequestNotFound(request);
requestListenerNotifier.notifyListenersOfRequestNotFound(request, listeners);
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
notifyListenersOfRequestNotFound
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public <T> void notifyListenersOfRequestAdded(CachedSpiceRequest<T> request, Set<RequestListener<?>> listeners) {
Ln.d("Request was added to queue.");
spiceServiceListenerNotifier.notifyObserversOfRequestAdded(request, listeners);
requestListenerNotifier.notifyListenersOfRequestAdded(request, listeners);
notifyListenersOfRequestProgress(request, listeners, request.getProgress());
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
notifyListenersOfRequestAdded
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public <T> void notifyListenersOfRequestAggregated(CachedSpiceRequest<T> request, Set<RequestListener<?>> listeners) {
Ln.d("Request was aggregated in queue.");
spiceServiceListenerNotifier.notifyObserversOfRequestAggregated(request, listeners);
requestListenerNotifier.notifyListenersOfRequestAggregated(request, listeners);
notifyListenersOfRequestProgress(request, listeners, request.getProgress());
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
notifyListenersOfRequestAggregated
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
protected <T> void notifyListenersOfRequestProgress(final CachedSpiceRequest<?> request, final Set<RequestListener<?>> listeners, final RequestStatus status) {
notifyListenersOfRequestProgress(request, listeners, new RequestProgress(status));
checkAllRequestComplete();
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
notifyListenersOfRequestProgress
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public <T> void notifyListenersOfRequestProgress(final CachedSpiceRequest<?> request, final Set<RequestListener<?>> listeners, final RequestProgress progress) {
Ln.d("Sending progress %s", progress.getStatus());
spiceServiceListenerNotifier.notifyObserversOfRequestProgress(request, progress);
requestListenerNotifier.notifyListenersOfRequestProgress(request, listeners, progress);
checkAllRequestComplete();
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
notifyListenersOfRequestProgress
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
protected void checkAllRequestComplete() {
if (mapRequestToRequestListener.isEmpty()) {
Ln.d("Sending all request complete.");
requestProcessorListener.allRequestComplete();
}
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
checkAllRequestComplete
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public <T> void notifyListenersOfRequestSuccessButDontCompleteRequest(final CachedSpiceRequest<T> request, final T result) {
final Set<RequestListener<?>> listeners = mapRequestToRequestListener.get(request);
spiceServiceListenerNotifier.notifyObserversOfRequestSuccess(request);
requestListenerNotifier.notifyListenersOfRequestSuccess(request, result, listeners);
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
notifyListenersOfRequestSuccessButDontCompleteRequest
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public <T> void notifyListenersOfRequestSuccess(final CachedSpiceRequest<T> request, final T result) {
final Set<RequestListener<?>> listeners = mapRequestToRequestListener.get(request);
notifyListenersOfRequestProgress(request, listeners, RequestStatus.COMPLETE);
spiceServiceListenerNotifier.notifyObserversOfRequestSuccess(request);
requestListenerNotifier.notifyListenersOfRequestSuccess(request, result, listeners);
notifyOfRequestProcessed(request, listeners);
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
notifyListenersOfRequestSuccess
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public <T> void notifyListenersOfRequestFailure(final CachedSpiceRequest<T> request, final SpiceException e) {
final Set<RequestListener<?>> listeners = mapRequestToRequestListener.get(request);
notifyListenersOfRequestProgress(request, listeners, RequestStatus.COMPLETE);
spiceServiceListenerNotifier.notifyObserversOfRequestFailure(request);
requestListenerNotifier.notifyListenersOfRequestFailure(request, e, listeners);
notifyOfRequestProcessed(request, listeners);
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
notifyListenersOfRequestFailure
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public void notifyListenersOfRequestCancellation(final CachedSpiceRequest<?> request) {
Ln.d("Not calling network request : " + request + " as it is cancelled. ");
final Set<RequestListener<?>> listeners = mapRequestToRequestListener.get(request);
notifyListenersOfRequestProgress(request, listeners, RequestStatus.COMPLETE);
spiceServiceListenerNotifier.notifyObserversOfRequestCancellation(request);
requestListenerNotifier.notifyListenersOfRequestCancellation(request, listeners);
notifyOfRequestProcessed(request, listeners);
}
|
Entity responsible for managing request's progress and notifying associated
listeners of any progress change.
@author Andrew Clark
|
notifyListenersOfRequestCancellation
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public void dontNotifyRequestListenersForRequest(final CachedSpiceRequest<?> request, final Collection<RequestListener<?>> listRequestListener) {
final Set<RequestListener<?>> setRequestListener = mapRequestToRequestListener.get(request);
requestListenerNotifier.clearNotificationsForRequest(request, setRequestListener);
if (setRequestListener != null && listRequestListener != null) {
Ln.d("Removing listeners of request : " + request.toString() + " : " + setRequestListener.size());
setRequestListener.removeAll(listRequestListener);
}
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
dontNotifyRequestListenersForRequest
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public void notifyOfRequestProcessed(final CachedSpiceRequest<?> request, Set<RequestListener<?>> listeners) {
Ln.v("Removing %s size is %d", request, mapRequestToRequestListener.size());
mapRequestToRequestListener.remove(request);
checkAllRequestComplete();
spiceServiceListenerNotifier.notifyObserversOfRequestProcessed(request, listeners);
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
notifyOfRequestProcessed
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public int getPendingRequestCount() {
return mapRequestToRequestListener.keySet().size();
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
getPendingRequestCount
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public <T> RequestProgressListener createProgressListener(final CachedSpiceRequest<T> request) {
// add a progress listener to the request to be notified of
// progress during load data from network
final RequestProgressListener requestProgressListener = new RequestProgressListener() {
@Override
public void onRequestProgressUpdate(final RequestProgress progress) {
final Set<RequestListener<?>> listeners = mapRequestToRequestListener.get(request);
notifyListenersOfRequestProgress(request, listeners, progress);
}
};
return requestProgressListener;
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
createProgressListener
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
@Override
public void onRequestProgressUpdate(final RequestProgress progress) {
final Set<RequestListener<?>> listeners = mapRequestToRequestListener.get(request);
notifyListenersOfRequestProgress(request, listeners, progress);
}
|
Disable request listeners notifications for a specific request.<br/>
All listeners associated to this request won't be called when request
will finish.<br/>
@param request
Request on which you want to disable listeners
@param listRequestListener
the collection of listeners associated to request not to be
notified
|
onRequestProgressUpdate
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/RequestProgressManager.java
|
Apache-2.0
|
public RetryPolicy getRetryPolicy() {
return retryPolicy;
}
|
Base class for writing requests in RoboSpice. Simply override
{@link #loadDataFromNetwork()} to define the network operation of a request.
REST Requests are easier using the Request class proposed by the
spring-android module of RoboSpice.
@author sni
@param <RESULT>
|
getRetryPolicy
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
public void setRetryPolicy(RetryPolicy retryPolicy) {
this.retryPolicy = retryPolicy;
}
|
Set a {@link RetryPolicy} that will be responsible to coordinate retry
attempts by the RequestProcessor. Can be null (no retry). Retry policy only
applies when network is on. If network is down, requests are "tried" only once.
@param retryPolicy the new retry policy
@see {@link com.octo.android.robospice.networkstate.NetworkStateChecker.NetworkStateChecker}
|
setRetryPolicy
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
public void setPriority(int priority) {
if (priority < 0) {
throw new IllegalArgumentException("Priority must be positive.");
}
this.priority = priority;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
setPriority
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
public int getPriority() {
return priority;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
getPriority
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
private void checkInnerClassDeclarationToPreventMemoryLeak() {
// thanx to Cyril Mottier for this contribution
// prevent devs from creating memory leaks by using inner
// classes of contexts
if (getClass().isMemberClass() && Context.class.isAssignableFrom(getClass().getDeclaringClass()) && !Modifier.isStatic(getClass().getModifiers())) {
throw new IllegalArgumentException("Requests must be either non-inner classes or a static inner member class of Context : " + getClass());
}
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
checkInnerClassDeclarationToPreventMemoryLeak
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
public Class<RESULT> getResultType() {
return resultType;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
getResultType
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
public void cancel() {
this.isCanceled = true;
if (future != null) {
future.cancel(true);
}
if (this.requestCancellationListener != null) {
this.requestCancellationListener.onRequestCancelled();
}
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
cancel
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
void setStatus(final RequestStatus status) {
this.progress = new RequestProgress(status);
publishProgress();
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
setStatus
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
RequestProgress getProgress() {
return progress;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
getProgress
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
public boolean isCancelled() {
return this.isCanceled;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
isCancelled
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
public boolean isAggregatable() {
return isAggregatable;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
isAggregatable
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
public void setAggregatable(final boolean isAggregatable) {
this.isAggregatable = isAggregatable;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
setAggregatable
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
protected void setFuture(final Future<?> future) {
this.future = future;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
setFuture
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
protected void setRequestProgressListener(final RequestProgressListener requestProgressListener) {
this.requestProgressListener = requestProgressListener;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
setRequestProgressListener
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
protected void publishProgress() {
if (requestProgressListener != null) {
// TODO SIDE_EFFECT ?
requestProgressListener.onRequestProgressUpdate(progress);
}
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
publishProgress
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
protected void publishProgress(final float progress) {
this.progress.setStatus(RequestStatus.LOADING_FROM_NETWORK);
this.progress.setProgress(progress);
publishProgress();
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
publishProgress
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
public void setRequestCancellationListener(final RequestCancellationListener requestCancellationListener) {
this.requestCancellationListener = requestCancellationListener;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
setRequestCancellationListener
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
@Override
public int compareTo(SpiceRequest<RESULT> other) {
if (this == other) {
return 0;
}
return this.priority - other.priority;
}
|
Sets the priority of the request. Use priority constants or a positive
integer. Will have no effect on a request after it starts being executed.
@param priority
the priority of request. Defaults to {@link #PRIORITY_NORMAL}.
@see #PRIORITY_LOW
@see #PRIORITY_NORMAL
@see #PRIORITY_HIGH
|
compareTo
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/SpiceRequest.java
|
Apache-2.0
|
@Override
public void onRequestSucceeded(CachedSpiceRequest<?> request, RequestProcessingContext requestProcessingContext) {
}
|
Defines the behavior of a listener that will be notified of request
processing by the {@link SpiceService}.
@author sni
|
onRequestSucceeded
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/listener/SpiceServiceAdapter.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/listener/SpiceServiceAdapter.java
|
Apache-2.0
|
@Override
public void onRequestFailed(CachedSpiceRequest<?> request, RequestProcessingContext requestProcessingContext) {
}
|
Defines the behavior of a listener that will be notified of request
processing by the {@link SpiceService}.
@author sni
|
onRequestFailed
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/listener/SpiceServiceAdapter.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/listener/SpiceServiceAdapter.java
|
Apache-2.0
|
@Override
public void onRequestCancelled(CachedSpiceRequest<?> request, RequestProcessingContext requestProcessingContext) {
}
|
Defines the behavior of a listener that will be notified of request
processing by the {@link SpiceService}.
@author sni
|
onRequestCancelled
|
java
|
stephanenicolas/robospice
|
robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/listener/SpiceServiceAdapter.java
|
https://github.com/stephanenicolas/robospice/blob/master/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/listener/SpiceServiceAdapter.java
|
Apache-2.0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.