com.webhydra.slug.process
Interface ISlugRunner

All Superinterfaces:
ISlugService
All Known Implementing Classes:
AbstractProcessRunner, UnlimitedProcessRunner

public interface ISlugRunner
extends ISlugService

Process scheduling and management interface.

Author:
rossen

Method Summary
 long activeCount()
          Returns the count of all active processes
 java.lang.String add(SluggishProcess proc, java.lang.String session)
          Add and execute a new SluggishProcess for execution.
 SluggishProcess cancelProcess(java.lang.String session, java.lang.String pid)
          Cancel process Proces is signalled using SluggishProcess.cancel() and is removed from Active Process List (APL).
 ProcessStatus checkProcess(java.lang.String session, java.lang.String pid)
          Checks process status
 void cleanSession(java.lang.String session)
          Remove all processes for specified session.
 void clear()
          Cancels all running processes and removes them from this instance.
 SluggishProcess consumeProcess(java.lang.String session, java.lang.String pid)
          Remove specified process from the Active Process List (APL).
 long count()
          Returns estimated total number of sluggish processes in this runner instance.
 
Methods inherited from interface com.webhydra.slug.process.ISlugService
init, prepare, release
 

Method Detail

add

java.lang.String add(SluggishProcess proc,
                     java.lang.String session)
                     throws java.security.InvalidParameterException
Add and execute a new SluggishProcess for execution.

Parameters:
proc - process to be executed.
session - current user session ID
Returns:
Proccess ID (PID) assigned to provided process/session pair.
Throws:
java.security.InvalidParameterException - if any of the provided parameters is null.

cancelProcess

SluggishProcess cancelProcess(java.lang.String session,
                              java.lang.String pid)
Cancel process Proces is signalled using SluggishProcess.cancel() and is removed from Active Process List (APL).

Parameters:
session - current user session ID
pid - Process ID (PID) to be canceled.
Returns:
process or null if PID is not found.

checkProcess

ProcessStatus checkProcess(java.lang.String session,
                           java.lang.String pid)
Checks process status

Parameters:
session - current user session ID
pid - running Process ID (PID)
Returns:
current porcess status if process with provided PID exist in current session. If no process can be found then null is returned.

consumeProcess

SluggishProcess consumeProcess(java.lang.String session,
                               java.lang.String pid)
Remove specified process from the Active Process List (APL). If this is the last process for provided session then this session is removed from APL too.

Parameters:
session - current user session ID
pid - Process ID (PID) to be removed
Returns:
removed process or null if PID is not found.

cleanSession

void cleanSession(java.lang.String session)
Remove all processes for specified session.

Parameters:
session - user's session to cleanup.

activeCount

long activeCount()
Returns the count of all active processes

Returns:
the number of actively running sluggish processes.

count

long count()
Returns estimated total number of sluggish processes in this runner instance.

Returns:
the estimated count of all running and completed processes accomodated in this instance.

clear

void clear()
Cancels all running processes and removes them from this instance.