com.ibm.wbi.plugin
Class Editor

com.ibm.wbi.plugin.Meg
  |
  +--com.ibm.wbi.plugin.Editor
Direct Known Subclasses:
HttpEditor

public abstract class Editor
extends Meg

An editor has the ability to edit the response produced by a generator.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright information.
 
Fields inherited from class com.ibm.wbi.plugin.Meg
COPYRIGHT, EDITOR, GENERATOR, MONITOR, REQUEST_EDITOR, UNDEFINED
 
Constructor Summary
Editor()
          Constucts a new editor with default characteristics.
Editor(java.lang.String name, java.lang.String condition, int priority)
          Constructs a new editor with the specified characteristics and is enabled.
Editor(java.lang.String name, java.lang.String condition, int priority, boolean enabled)
          Constructs a new editor with the specified characteristics.
 
Method Summary
 int getMegType()
          Get the editor meg type.
 java.util.Vector getMonitors()
          Get a vector of monitors to run after the editor.
abstract  void handleRequest(RequestEvent event)
          Handle the specified request event.
 boolean isMonitors()
          Determine if any monitors are to be run after the editor.
protected  void processRejectedRequest(RequestEvent request)
          Copy the input stream to the output stream, leaving the contents unaffected.
 
Methods inherited from class com.ibm.wbi.plugin.Meg
forwardRequest, getCondition, getEnabled, getName, getPlugin, getPriority, isEnabled, setCondition, setEnabled, setName, setPriority, setup, setup, setup, setup, threadManagerRun
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM copyright information.
Constructor Detail

Editor

public Editor()
Constucts a new editor with default characteristics.

Editor

public Editor(java.lang.String name,
              java.lang.String condition,
              int priority)
Constructs a new editor with the specified characteristics and is enabled.
Parameters:
name - The name of the editor.
condition - The condition under which this editor should be invoked.
priority - The priority of the editor incase of a condition tie.

Editor

public Editor(java.lang.String name,
              java.lang.String condition,
              int priority,
              boolean enabled)
Constructs a new editor with the specified characteristics.
Parameters:
name - The name of the editor.
condition - The condition under which this editor should be invoked.
priority - The priority of the editor incase of a condition tie.
enabled - true if enabled.
Method Detail

getMegType

public final int getMegType()
Get the editor meg type.
Returns:
Meg.EDITOR.
Overrides:
getMegType in class Meg

handleRequest

public abstract void handleRequest(RequestEvent event)
                            throws RequestRejectedException,
                                   java.io.IOException
Handle the specified request event.
Parameters:
event - The request event with an input and output stream.
Throws:
RequestRejectedException - If rejecting request, this must be thrown before the first write() is made to the output stream.
java.io.Exception - can be thrown if an exception was generated by the meg while processing the MegInput/OutputStreams.
Overrides:
handleRequest in class Meg

isMonitors

public final boolean isMonitors()
Determine if any monitors are to be run after the editor.
Returns:
true if monitors exist; else false.

getMonitors

public final java.util.Vector getMonitors()
Get a vector of monitors to run after the editor.
Returns:
Vector of monitors.

processRejectedRequest

protected void processRejectedRequest(RequestEvent request)
                               throws java.io.IOException
Copy the input stream to the output stream, leaving the contents unaffected.
Parameters:
request - the original request that was passed to the editor's handleRequest(...) method
Overrides:
processRejectedRequest in class Meg