com.infoengine.SAK
Class ExternalWebject

java.lang.Object
  extended bycom.infoengine.object.factory.Webject
      extended bycom.infoengine.SAK.Webject
          extended bycom.infoengine.SAK.ExternalWebject
All Implemented Interfaces:
Cloneable, Serializable

public class ExternalWebject
extends Webject

This class provides methods to construct and execute externally defined webjects in applications and JSP pages.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.infoengine.SAK.Webject
 
Field Summary
private  ByteArrayOutputStream baos
           
private  boolean setOSCalled
           
 
Fields inherited from class com.infoengine.SAK.Webject
inputStream, outputStream, service, task, webjectProcessor
 
Fields inherited from class com.infoengine.object.factory.Webject
CLASS, DISPLAY, EXTERNAL, GROUP, GROUP_IN, GROUP_OUT, MESSAGE, OBJECT, OUTPUT, TASK, text, TYPE, UNKNOWN
 
Constructor Summary
ExternalWebject()
          Constructs an external webject with no name.
ExternalWebject(String name)
          Constructs an external webject with a specific name.
 
Method Summary
 void invoke()
          Invokes the webject in the server context.
 void invoke(Task task)
          Invokes the webject in the server context.
 void setOutputStream(OutputStream os)
          Sets the output stream to a specific stream.
 void setUseClass(String className)
          Sets the Java class that implements the webject.
 String toString()
          Returns a string containing the output currently associated with this webject.
 
Methods inherited from class com.infoengine.SAK.Webject
addParam, copyOutputGroups, getInputStream, getOutputStream, getProcessor, getProcessorClassName, getService, getWebjectImpl, initialize, logWebject, run, setInputStream, setInputStream, setInputStream, setOutputStream, setParam, setService
 
Methods inherited from class com.infoengine.object.factory.Webject
addKey, addMessage, addMeta, addMetaValue, addOutput, addParam, addUniqueKey, addUniqueValue, addValue, addValue, addWebject, clearParams, clone, deepClone, getClassName, getGroupInName, getGroupInNames, getGroupOutName, getGroupOutNames, getKey, getKeys, getMessages, getMetaValue, getName, getNode, getOutput, getParam, getParam, getParamNames, getParams, getParams, getPassword, getType, getUserName, getValue, getValues, getWebjects, newStructure, paramValue, paramValue, paramValues, printTree, removeAllWebjects, removeParam, removeParams, removeWebject, setClassName, setName, setNode, setParam, setPassword, setType, setUserName, setValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

baos

private ByteArrayOutputStream baos

setOSCalled

private boolean setOSCalled
Constructor Detail

ExternalWebject

public ExternalWebject()
Constructs an external webject with no name.


ExternalWebject

public ExternalWebject(String name)
Constructs an external webject with a specific name.

Parameters:
name - The name to be assigned to the webject.
Method Detail

setUseClass

public void setUseClass(String className)
Sets the Java class that implements the webject.

Parameters:
className - The name of the Java class that implements this webject.

toString

public String toString()
Returns a string containing the output currently associated with this webject. Usually, the output is generated as a result of calling the invoke method.

Overrides:
toString in class Webject
Returns:
A String containing the output associated with the webject.

invoke

public void invoke()
            throws IEException,
                   IOException
Invokes the webject in the server context. Output generated by the webject can be retrieved using the toString method.

Overrides:
invoke in class Webject
Throws:
IEException - if the webject is not executed successfully.
IOException - if an I/O error occurs while the webject is generating output.

invoke

public void invoke(Task task)
            throws IEException,
                   IOException
Invokes the webject in the server context. Output generated by the webject can be retrieved using the toString method.

Overrides:
invoke in class Webject
Parameters:
task - The task associated with the webject.
Throws:
IEException - if the webject is not executed successfully.
IOException - if an I/O error occurs while the webject is generating output.

setOutputStream

public void setOutputStream(OutputStream os)
Sets the output stream to a specific stream.

Overrides:
setOutputStream in class Webject
Parameters:
os - The OutputStream to use to catch the webject's output (if any).