|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.EventObject
|
+--com.ibm.wbi.RequestEvent
The RequestEvent that is passed to each Meg that contains the
input and output streams and Meg data. The RequestEvent should not be
referenced after the handleEvent() method call because it
encapsulates a lot of Request data and can consume a lot of memory over
time. The RequestEvent provides Meg/Plugin management api's as well
as provide ability to spawn new Requests to the Proxy.
| Fields inherited from class java.util.EventObject |
source |
| Constructor Summary | |
RequestEvent(java.lang.Object source)
Construct a new RequestEvent specifying the source. |
|
| Method Summary | |
void |
abort()
Deprecated. Use getTransaction.abort( AbortEvent ). |
abstract MegContext |
getMegContext()
Get the Meg context available with this request. |
abstract MegInputStream |
getMegInputStream()
Get the input stream for reading binary (byte-based) streams. |
abstract MegObject |
getMegObject()
returns the MegObject associated with this RequestEvent, if any. |
abstract java.lang.Class |
getMegObjectType()
returns the class of the MegObject associated with this RequestEvent, if any. |
abstract MegOutputStream |
getMegOutputStream()
Get the output stream for writing binary (byte-based) data. |
abstract MegReader |
getMegReader()
Get the reader for reading character-based streams. |
abstract MegReader |
getMegReader(java.lang.String encoding)
Get the reader for reading character-based streams. |
abstract MegWriter |
getMegWriter()
Get the writer for writing out character-based streams. |
abstract MegWriter |
getMegWriter(java.lang.String encoding)
Get the writer for writing out character-based streams. |
MegInputStream |
getRead()
Deprecated. Use getMegInputStream(). |
abstract RequestInfo |
getRequestInfo()
Get the RequestInfo object that "describes" the Request. |
abstract Transaction |
getTransaction()
Get the transaction object that this RequestEvent belongs to. |
MegOutputStream |
getWrite()
Deprecated. Use getMegOutputStream(). |
boolean |
isAborted()
Deprecated. Use getTransaction.isAborted(). |
void |
mayReject()
Informs WBI that this RequestEvent may be
rejected. |
abstract void |
putMegObject(MegObject mo)
passes the MegObject to the next MEG. |
void |
wontReject()
This undoes the effects of a previous call to mayReject(). |
| Methods inherited from class java.util.EventObject |
getSource, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public RequestEvent(java.lang.Object source)
source - The source of the event.| Method Detail |
public final MegInputStream getRead()
getMegInputStream().
public abstract MegInputStream getMegInputStream()
getMegInputStream in interface ResponseToRequestgetMegReader()
public abstract MegReader getMegReader()
throws java.io.UnsupportedEncodingException,
com.ibm.wbi.NotCharDataException
There can be only one MegReader per
RequestEvent. This MegReader will
always be returned by subsequent calls to
getMegReader() or
getMegReader(String), even if a different encoding
is specified.
getMegReader in interface ResponseToRequestjava.io.UnsupportedEncodingException - If the stream is
encoded using an encoding not supported on this platform.com.ibm.wbi.NotCharDataException - If the stream does not contain
character data.MegReader
public abstract MegReader getMegReader(java.lang.String encoding)
throws java.io.UnsupportedEncodingException,
com.ibm.wbi.NotCharDataException
There can be only one MegReader per
RequestEvent. This MegReader will
always be returned by subsequent calls to
getMegReader() or
getMegReader(String), even if a different encoding
is specified.
encoding - The encoding the reader will use.java.io.UnsupportedEncodingException - If the stream is
encoded using an encoding not supported on this platform.com.ibm.wbi.NotCharDataException - If the stream does not contain
character data.MegReaderpublic final MegOutputStream getWrite()
getMegOutputStream().
public abstract MegOutputStream getMegOutputStream()
getMegWriter()
public abstract MegWriter getMegWriter()
throws java.io.UnsupportedEncodingException,
com.ibm.wbi.NotCharDataException
There can be only one MegWriter per
RequestEvent. This MegWriter will
always be returned by subsequent calls to
getMegWriter() or
getMegWriter(String), even if a different encoding
is specified.
java.io.UnsupportedEncodingException - If the stream is
encoded using an encoding not supported on this platform.com.ibm.wbi.NotCharDataException - If the stream does not contain
character data.MegWriter
public abstract MegWriter getMegWriter(java.lang.String encoding)
throws java.io.UnsupportedEncodingException,
com.ibm.wbi.NotCharDataException
There can be only one MegWriter per
RequestEvent. This MegWriter will
always be returned by subsequent calls to
getMegWriter() or
getMegWriter(String), even if a different encoding
is specified.
encoding - The encoding the writer will use.java.io.UnsupportedEncodingException - If the stream is
encoded using an encoding not supported on this platform.com.ibm.wbi.NotCharDataException - If the stream does not contain
character data.MegWriter
public abstract MegObject getMegObject()
throws MegIOTypeUnavailableException
MegIOTypeUnavailableException - if the InputStream or Reader have already been requested
public abstract void putMegObject(MegObject mo)
throws MegIOTypeUnavailableException
putMegObject()!mo - The MegObjectif - a Stream has already been usedpublic abstract java.lang.Class getMegObjectType()
public abstract RequestInfo getRequestInfo()
MegOutputStream.write(),
MegWriter.write(), or
RequestEvent.putMegObject(). Any modifications
performed after committing to the RequestEvent will be ignored.getRequestInfo in interface ResponseToRequestpublic void abort()
getTransaction.abort( AbortEvent ).
public boolean isAborted()
getTransaction.isAborted().
true if the request was aborted; else false
.public abstract MegContext getMegContext()
null) or be null if the Meg context
does not pertain to the environment we are running under.null if not applicable.public abstract Transaction getTransaction()
getTransaction in interface ResponseToRequest
public void mayReject()
throws java.io.IOException
RequestEvent may be
rejected. This method can only be legally called if none of
getMegInputStream(), getMegReader(),
and getReader() have yet been called. After
calling this method, any amount of data can be read from the
streams before throwing a
RequestRejectedException. Be aware that reading
very large amounts of data from a stream before making the
decision whether to reject or not may have adverse performance
implications. Subclasses of RequestEvent SHOULD implement mayReject() if they can support its functionality.
java.io.IOException - If the method is called illegally, as
above.wontReject(),
RequestRejectedException,
getMegInputStream(),
getMegReader()public void wontReject()
mayReject(). If no previous call to
mayReject() was made, this method has no effect.
It is optional to call this method, because it will
automatically be called when the first write to the
corresponding MegOutputStream or
MegWriter occurs. It may save memory and improve
performance to call this method yourself in certain cases,
however. E.g., you call mayReject(). You get a
MegReader and read some characters from it, and
decide that you will definitely process the request. If your
next action is to write to the MegWriter, then
this method is called automatically and you need do nothing.
However, if you read in the entire rest of the document before
writing anything out (e.g., to send it to some non-streaming
parser), you may benefit from calling this method, because you
will relieve WBI of the burden of keeping an extra copy of
everything you read.Subclasses of RequestEvent SHOULD implement wontReject() if they implement mayReject().
mayReject(),
RequestRejectedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||