|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.provision.ThreadContext
com.waveset.provision.FetchContext
A class holding the runtime state for a resource account fetch used to assemble all of the resource account attribute for a Waveset user.
Field Summary | |
static java.lang.String |
code_id
|
Fields inherited from class com.waveset.provision.ThreadContext |
trace |
Constructor Summary | |
FetchContext(Provisioner p,
ProvisioningOptions options)
|
Method Summary | |
void |
buildResourceOps()
Build a base list of "resource operation" objects for each account assigned to the user. |
void |
doFetch(ResourceOp op,
int thread)
This is the inner implementation of the fetch operation. |
int |
getDesiredThreads()
Calculate the optimum number of threads that could be launched to perform the ResourceOps in parallel. |
ResourceOp |
getNextOp()
Return the next operation that a thread can perform. |
java.util.List |
getOps()
Return the list of ResourceOps. |
java.util.List |
getResults()
Once all the threads have finished, iterate through the internal ResourceOp objects, and return a list of the ResourceResult objects that were left behind. |
void |
init()
Initialize all processing state. |
boolean |
isFinished(int thread)
Returns true once all operations have been performed. |
void |
prepare()
Make any last minute preparations before launching. |
void |
processOp(ResourceOp op,
int thread)
Called by each thread after it has obtained an operation to perform. |
Methods inherited from class com.waveset.provision.ThreadContext |
buildResourceUser, buildResourceUser, checkAdapters, generateIdentities, getAdministratorName, getExplicitIdentity, getOp, getOptions, getProvisioner, getUser, getUserName, launchThreads, normalizeResourceInfos, overrideResourceAttributes, println, setTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
Constructor Detail |
public FetchContext(Provisioner p, ProvisioningOptions options)
Method Detail |
public java.util.List getOps()
ThreadContext
getOps
in class ThreadContext
public void init()
public java.util.List getResults()
public void prepare() throws WavesetException
prepare
in class ThreadContext
WavesetException
public int getDesiredThreads()
getDesiredThreads
in class ThreadContext
public boolean isFinished(int thread)
The thread number is passed here so we can selectively decide to let threads expire even though we're not really done with processing. This might happen if we launched 10 threads to do a bunch of random things in parallel, but we're now down to 2 that have to iterate through 2 ordered lists. Since the other threads have nothing to do, we can let the die.
isFinished
in class ThreadContext
public ResourceOp getNextOp()
getNextOp
in class ThreadContext
public void processOp(ResourceOp op, int thread) throws WavesetException
processOp
in class ThreadContext
WavesetException
public void buildResourceOps() throws WavesetException
WavesetException
public void doFetch(ResourceOp op, int thread) throws WavesetException
This method must not be synchronized, all state is maintained in the ResourceOp. We're allowed to touch the WSUser object but the only modifications should be made in the ResourceInfo that is associated with this resource.
WavesetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |