|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.modeshape.graph.request.Request
org.modeshape.graph.request.CompositeRequest
@Immutable public class CompositeRequest

A request that wraps multiple other requests, allowing multiple requests to be treated as a single request.
Note that Request.isCancelled() and Request.cancel() apply to all requests contained by the composite request. In other
words, cancelling this request immediately marks all contained requests as cancelled. However, cancelling any request in the
request has the effect of cancelling all other requests in the composite, including the composite. (This is implemented by
having all Request objects in the composite share the same cancelled flag object.)
| Field Summary | |
|---|---|
static int |
UNKNOWN_NUMBER_OF_REQUESTS
|
| Constructor Summary | |
|---|---|
protected |
CompositeRequest(boolean readOnly)
Create a composite request from the supplied list of requests. |
protected |
CompositeRequest(List<? extends Request> requests,
boolean readOnly)
Create a composite request from the supplied list of requests. |
| Method Summary | |
|---|---|
static CompositeRequest |
add(CompositeRequest composite,
Iterator<? extends Request> requests)
Add requests to the supplied composite request. |
static CompositeRequest |
add(CompositeRequest composite,
Request... requests)
Add requests to the supplied composite request. |
void |
checkForErrors()
Check the set of requests for errors. |
boolean |
equals(Object obj)
|
List<Request> |
getRequests()
Return the unmodifiable requests contained in this composite request. |
RequestType |
getType()
Returns the type of the request |
boolean |
isReadOnly()
Return whether this request only reads information. |
Iterator<Request> |
iterator()
|
int |
size()
Get the number of requests. |
String |
toString()
|
static Request |
with(Iterator<? extends Request> requests)
Return a request that either wraps multiple requests, or the single request if only one is supplied. |
static Request |
with(List<? extends Request> requests)
Return a request that either wraps multiple requests, or the single request if only one is supplied. |
static Request |
with(Request... requests)
Return a request that either wraps multiple requests, or the single request if only one is supplied. |
| Methods inherited from class org.modeshape.graph.request.Request |
|---|
cancel, checkNotFrozen, freeze, getError, hasError, isCancelled, isFrozen, printable, printable, setError, setLatchForFreezing |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int UNKNOWN_NUMBER_OF_REQUESTS
| Constructor Detail |
|---|
protected CompositeRequest(List<? extends Request> requests,
boolean readOnly)
requests - the modifiable list of requests; may not be nullreadOnly - true if all of the requests are read-onlyprotected CompositeRequest(boolean readOnly)
readOnly - true if all of the requests are read-only| Method Detail |
|---|
public static Request with(Request... requests)
requests - the requests to wrap
IllegalArgumentException - if there requests are null, empty, or contains only nullspublic static Request with(Iterator<? extends Request> requests)
requests - the requests to wrap
IllegalArgumentException - if there requests are null, empty, or contains only nullspublic static Request with(List<? extends Request> requests)
requests - the requests to wrap
IllegalArgumentException - if there requests are null or empty
public static CompositeRequest add(CompositeRequest composite,
Request... requests)
composite - the composite request to which the requests are to be addedrequests - the requests to wrap
IllegalArgumentException - if the composite request is null
public static CompositeRequest add(CompositeRequest composite,
Iterator<? extends Request> requests)
composite - the composite request to which the requests are to be addedrequests - the requests to wrap
IllegalArgumentException - if the composite request is nullpublic List<Request> getRequests()
public int size()
public Iterator<Request> iterator()
iterator in interface Iterable<Request>Iterable.iterator()public boolean isReadOnly()
isReadOnly in class RequestRequest.isReadOnly()public void checkForErrors()
existing error
being reset to a new error or null if there are no errors.
public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public String toString()
toString in class Objectpublic RequestType getType()
Request
getType in class Request
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||