|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.parabon.client.SessionManager
com.parabon.client.LocalSessionManager
public class LocalSessionManager
A run-local implementation of SessionManager.
Runs all tasks in local mode; that is, run tasks directly in the
same JVM as this client application is running, without attempting
to simulate the behaviour of remote mode. This mode is meant for
efficiently executing tasks locally as part of an application when the
application does not need the power of Frontier, and for debugging tasks
and applications without the difficulties of multiple JVMs.
As this mode does not impose the constraints of remote mode (such as
restricted security, task isolation in a separate JVM, etc), tasks should
be fully evaluated and debugged in simulator mode (via
SimulatorSessionManager) to ensure that they run correctly in
the Frontier environment attempting to submit them to the Frontier server
in remote mode (via RemoteSessionManager).
SessionManager,
SimulatorSessionManager,
RemoteSessionManager| Nested Class Summary | |
|---|---|
protected class |
LocalSessionManager.TaskRunnable
|
protected class |
LocalSessionManager.TaskSpawner
|
| Field Summary | |
|---|---|
protected java.util.Map<java.net.URI,com.parabon.io.DataWrapper> |
clientElements
|
protected static int |
DEFAULT_MAX_RUNNING_TASKS
|
protected int |
nextJobID
|
protected LocalSessionManager.TaskSpawner |
taskSpawner
|
protected com.parabon.util.Queue |
tasksWaitingToRun
|
| Fields inherited from class com.parabon.client.SessionManager |
|---|
DEFAULT_SESSION_MANAGER, destroyed, idGenerator, jobs, LOCAL_SESSION_MANAGER, log, pool, REMOTE_SESSION_MANAGER, SESSION_MODE_PROPERTY, SIMULATOR_SESSION_MANAGER, tempListenerList |
| Constructor Summary | |
|---|---|
LocalSessionManager()
|
|
| Method Summary | |
|---|---|
Job |
createJob(java.util.Map<java.lang.String,java.lang.String> attributes)
Create and add a new Job with the given attributes. |
void |
destroy()
Close this session. |
void |
destroy(int blockMillis)
Equivalent to destroy(). |
void |
destroy(com.parabon.util.Listener completionListener)
Similar to destroy(). |
void |
flush(int blockMillis)
Block until all actions taken thus far in the current session have been recieved and acknowledged by the server. |
protected java.net.URI |
getBaseClientURI()
|
com.parabon.io.DataWrapper |
getElement(java.net.URI uri)
|
java.net.URI |
getGlobalDataURI()
|
int |
getMaxRunningTasks()
Return the number of tasks allowed to run simultaneously. |
int |
getNumRunningTasks()
Returns the number of tasks currently running. |
void |
reestablish(int blockMillis)
Attempt to retrieve the latest list of jobs from the Frontier server, blocking until complete or until approximately the given number milliseconds have elapsed. |
void |
reestablish(com.parabon.util.Listener listener)
Attempt to retrieve the latest list of jobs from the Frontier server, returning immediately without waiting for the operation to complete. |
void |
setMaxRunningTasks(int i)
Sets the maximum number of simulateously executing tasks. |
protected void |
startTask(com.parabon.client.LocalTaskMaster task)
|
protected void |
stopTask(com.parabon.client.LocalTaskMaster task,
int blockMillis)
|
protected void |
submitElement(java.net.URI uri,
com.parabon.io.DataWrapper contents)
|
| Methods inherited from class com.parabon.client.SessionManager |
|---|
addElement, addElement, addElement, addElement, addJob, getClientDataURI, getInstance, getInstance, getJobDataURI, getJobs, getLog, getTaskDataURI, notifyTaskEventListeners, reestablish, removeJob, setLog |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int DEFAULT_MAX_RUNNING_TASKS
protected java.util.Map<java.net.URI,com.parabon.io.DataWrapper> clientElements
protected int nextJobID
protected com.parabon.util.Queue tasksWaitingToRun
protected LocalSessionManager.TaskSpawner taskSpawner
| Constructor Detail |
|---|
public LocalSessionManager()
| Method Detail |
|---|
public void destroy()
destroy in class SessionManagerSessionManager.destroy(int),
SessionManager.flush(int)public void destroy(int blockMillis)
destroy in class SessionManagerdestroy()public void destroy(com.parabon.util.Listener completionListener)
destroy(). Also calls
completionListener.alert(null) after destruction is
complete.
destroy in class SessionManagerdestroy()
public java.net.URI getGlobalDataURI()
throws java.net.URISyntaxException
getGlobalDataURI in class SessionManagerjava.net.URISyntaxException
protected java.net.URI getBaseClientURI()
throws java.net.URISyntaxException
getBaseClientURI in class SessionManagerjava.net.URISyntaxException
protected void submitElement(java.net.URI uri,
com.parabon.io.DataWrapper contents)
submitElement in class SessionManager
public com.parabon.io.DataWrapper getElement(java.net.URI uri)
throws NoSuchElementException
NoSuchElementExceptionpublic void setMaxRunningTasks(int i)
public int getMaxRunningTasks()
public int getNumRunningTasks()
public Job createJob(java.util.Map<java.lang.String,java.lang.String> attributes)
SessionManagercreateJob
returns without affecting the newly-created job.
createJob in class SessionManagerprotected void startTask(com.parabon.client.LocalTaskMaster task)
protected void stopTask(com.parabon.client.LocalTaskMaster task,
int blockMillis)
throws TimeoutException
TimeoutExceptionpublic void flush(int blockMillis)
SessionManagerblockMillis==-1, no
timeout is used, and blocks until the flush condition is satisfied.
flush in class SessionManagerpublic void reestablish(int blockMillis)
SessionManagerTimeoutException will be
thrown, but the reestablish attempt might still result in the list
of jobs being updated in the future.
If blockMillis==-1, the SessionManager
will block indefinitely. Note that this method should never be
called (except with a timeout of 0) from within an
event listener or any other method which must complete in order
for further events to be processed, as this would lead to a
possible deadlock.
reestablish in class SessionManagerpublic void reestablish(com.parabon.util.Listener listener)
SessionManagercompletionListener.alert(nul) will be called when
reestablishment is complete.
reestablish in class SessionManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||