public class WorkloadManager
extends java.lang.Object
Note: In order to use the classes in this package the caller's address space must be permitted to the BPX.WLMSERVER Facility class if it is defined. If BPX.WLMSERVER is not defined, the calling process must be defined as a superuser (UID=0).
Note: WLM currently only allows one WorkloadManager instance per Java Virtual Machine.
It is the user's responsibility to manage the lifecycle of the WorkloadManager and to
disconnect()
in order to release native system resources.
Uses JNI wrappers to the following C Library APIs:
For additional information, see:
WorkUnit
,
ServerClassification
Constructor and Description |
---|
WorkloadManager(java.lang.String subSystemType,
java.lang.String subSystemName)
Connect to WLM as a work manager to perform Workload Manager work manager functions.
|
Modifier and Type | Method and Description |
---|---|
ServerClassification |
createServerClassification()
Create (and store for later deletion) a ServerClassification.
|
void |
destroyServerClassification(ServerClassification sc)
Destroy a ServerClassification that was previously created/associated to this WorkloadManager.
|
void |
disconnect()
Disconnect the server from WLM.
|
int |
getConnToken() |
public WorkloadManager(java.lang.String subSystemType, java.lang.String subSystemName)
subSystemType
- a string containing the generic subsystem type (CICS, IMS, WEB, etc.).
This is the primary category under which WLM classification rules are grouped. The
string can be up to 4 bytes in length.subSystemName
- a string containing the subsystem name used for classifying work
requests. The character string can be up to 8 bytes in length.ErrnoException
java.lang.SecurityException
- if a a SecurityManager is active and the user doesn't have access to JzosPermission("WorkloadManager")public void disconnect() throws ErrnoException
Destroy and remove any ServerClassifications held in the manager's cache. This method has no effect if the WorkloadManager is already disconnected.
ErrnoException
public ServerClassification createServerClassification() throws ErrnoException
The returned instance can be used when creating a WorkUnit WorkUnit.WorkUnit(ServerClassification, String)
.
All ServerClassifications created via this method will be destroyed when disconnect()
is
called.
ErrnoException
java.lang.IllegalStateException
- if this WorkLoadManager is no longer connected.public void destroyServerClassification(ServerClassification sc) throws ErrnoException
This destroys and deallocates the native storage associated with a ServerClassification using the C-Library __server_classifyDestroy() function.
sc
- the ServerClassification to remove and destroyjava.lang.IllegalStateException
- if the given ServerClassification is not foundErrnoException
public int getConnToken()
java.lang.IllegalStateException
- if the WorkloadManager is not connected