|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.4) E14255-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IEventContext
A helper class for manipulating events being sent or received
over WSRP, for use with the WSRP interceptors. Instances may be
created using either an existing Event object or the QName for the
desired event using the IHandleEventsRequestContext
, IHandleEventsResponseContext
or IInteractionResponseContext
object's getEventContexts(), getEventContext() or
createEventContext() methods. The information contained in the IEventContext can then
be examined and manipulated, and stored as the new set of events using the
IHandleEventsRequestContext, IHandleEventsResponseContext or IInteractionResponseContext
object's setEventContexts() or setEvents() methods.
Events Which Can Be Sent Over WSRP | |||||
---|---|---|---|---|---|
Event Type | Namespace | Local Name | Payload | WSRP Payload | Source Portlet |
CustomEvent | any - see note | any | yes | yes | yes |
FacesEvent | urn:com:oracle:wlp:netuix:event:faces | eventName | no | no | yes |
GenericEvent | urn:com:oracle:wlp:netuix:event:generic | eventName | yes | yes | yes |
InitEvent | urn:com:oracle:wlp:netuix:event:init | init | no | no | yes |
LookAndFeelReinitEvent | urn:com:oracle:wlp:netuix:event:laf-reinit | reinit | no | no | no |
PageFlowEvent | urn:com:oracle:wlp:netuix:event:pageflow | action | yes | yes | yes |
RefreshEvent | urn:com:oracle:wlp:netuix:event:refresh | refresh | no | no | yes |
StrutsEvent | urn:com:oracle:wlp:netuix:event:struts | action | no | no | yes |
WindowActivationEvent | urn:com:oracle:wlp:netuix:event:window | activate | no | no | yes |
WindowDeactivationEvent | urn:com:oracle:wlp:netuix:event:window | deactivate | no | no | yes |
WindowModeChangeEvent | urn:oasis:names:tc:wsrp:v2:types | newMode | yes | no | yes |
WindowStateChangeEvent | urn:oasis:names:tc:wsrp:v2:types | newWindowState | yes | no | yes |
urn:com:oracle:wlp:netuix:event:
unless
the namespace is urn:com:oracle:wlp:netuix:event:custom
(the
default namespace for custom events) or
urn:com:oracle:wlp:netuix:event:portal
(the namespace for events
sent to the portal framework).urn:oasis:names:tc:wsrp:v2:types
cannot be used if the
local part of the event's QName is newMode
or newWindowState
.
Any other local part of the event's QName is fine for the
urn:oasis:names:tc:wsrp:v2:types
namespace, although this namespace
is reserved for use by the WSRP 2.0 specification so caution is advised.NamedStringArray
object.NamedStringArray
- An odered list of
String name / value pairs, which corresponds to the
NamedStringArray schema type defined in the WSRP 2.0 specification
for event payloads. As this type is officially supported by the WSRP 2.0
specification, it is likely to have the highest interoperability with
third-party consumers or producers when using events over WSRP 2.0.XmlPayload
- This class represents arbitrary
XML for an event's payload, as a DOM Element.UNMARSHALLED
: Indicates that the event's payload was originally supplied
in unmarshalled form.WSRPV1
: Indicates that the event's payload was originally supplied
in WSRPV1 marshalled form.WSRPV2
: Indicates that the event's payload was originally supplied
in WSRPV2 marshalled form.IEventManipulator.createEventContext(QName)
method,
the event will not have an origin set at all, but the first method from this
interface that explicitly sets one of the payload's forms will set the origin
appropriately.
WSRPV1
, the correct
WSRPV1 marshalled form should already exist, so nothing is done.WSRPV2
:
NamedStringArray
object.UNMARSHALLED
.
if the unmarshalled payload is null
, the
WSRPV1 marshalled form is set to be empty.XmlPayload
, the WSRPV1 marshalled
form is set to the DOM Element held by the XMLPayload object.NamedStringArray
objects) is
serialized using Java serialization and the WSRPV1 marshalled form
is set to the serialized object. If serialization fails, the WSRPV1
marshalled form is set to be empty.WSRPV2
, the correct
WSRPV2 marshalled form should already exist, so nothing is done.WSRPV1
:
UNMARSHALLED
.
if the unmarshalled payload is null
, the
WSRPV2 marshalled form is set to be empty.XmlPayload
, the WSRPV2 marshalled
form is set to the DOM Element held by the XMLPayload object.NamedStringArray
, the WSRPV2 marshalled
form is set to the NamedStringArray object.getUnmarshalledPayload()
method) and the unmarshalled payload
form is not already available, WebLogic Portal uses the
following logic to convert the marshalled representation of the event payload into an
unmarshalled representation.
This scenario occurs, for example, when an event is sent by a producer portlet and
delivered to a local portlet on the consumer, or when an event is received by a portlet
on a WLP producer. Unmarshalling is avoided whenever possible on the consumer; if
the consumer is merely delivering an event from one producer portlet to another
producer portlet, the event's payload will never be unmarshalled.
Once the unmarshalled form of an event payload is created, it is kept to avoid
having to re-unmarshall the payload if the event is accessed by multiple portlets.
UNMARSHALLED
,
the correct unmarshalled payload form should already exist, so nothing is done.WSRPV1
:
null
.
null
.XmlPayload
object holding the
DOM Element of the XML.WSRPV2
:
null
.
NamedStringArray
object.null
.java.io.Serializable
interface
that all unmarshalled payloads must, the unmarshalled form is set
to the resulting object.XmlPayload
object holding the
DOM Element of the XML.XmlPayload
may be delivered
to the WSRP 2.0 portlet as another (JAXB-unmarshalled) Java object type.
This may or may not be the desired behavior.XmlPayload
object.
This may or may not be the desired behavior.NamedStringArray
object. Provided the
com.bea.wsrp.ext.holders.NamedStringArray class is available on the
WLP WSRP 1.0 producer, it will deserialize properly. Note that
WebLogic Portal versions 10.3 and earlier did not ship with
the com.bea.wsrp.ext.holders.NamedStringArray class, so it would need
to be included in the webapp's classpath.WEB-INF/wlp-framework-common-config.xml
file's
event-payload-jaxb-bindings
entries with all the class
names specified in the WEB-INF/portlet.xml
file's
event-definition
elements' value-type
declarations.
Any classes in the resulting list that do not have valid JAXB bindings are
removed from the list.
JAXB marshalling and unmarshalling of event payloads for WSRP version 2.0 can
be disabled completely (resulting in payloads being
serialized using Java object serialization instead) by setting the
enabled
attribute of the
WEB-INF/wlp-framework-common-config.xml
file's
event-payload-jaxb-bindings
element to false
.
By default, JAXB marshalling and unmarshalling is enabled.
Method Summary | |
---|---|
boolean |
canHavePayload()
Returns true if the event represented by this
IEventContext can have a payload. |
boolean |
canHaveWsrpEventPayload()
Returns true if the event represented by this
IEventContext can have a payload which is sent over
WSRP. |
Class[] |
getDefaultJAXBClasses()
Returns the default JAXB class list which may be used for marshalling or unmarshalling WSRPV2 payload forms. |
Serializable |
getDeserializedJavaObject(String serializedObject)
Base-64-decodes the specified string, then deserializes the serialized Java object represented by the resulting bytes, as used for the serialized Java object marshalled event payload representation. |
Event |
getEvent()
Returns the Event represented by this IEventContext. |
QName |
getQName()
Gets the QName for the event represented by this IEventContext. |
String |
getSerializedJavaObjectForm(Serializable object)
Serializes the specified object into a bytes and base-64 encodes them into a String, as used for the serialized Java object marshalled event payload representation. |
String |
getSourcePortletDefinitionLabel()
Gets the definition label of the portlet that generated this event, if applicable and known, or null otherwise. |
String |
getSourcePortletInstanceLabel()
Gets the instance label of the portlet that generated this event, if applicable and known, or null otherwise. |
Serializable |
getUnmarshalledPayload()
Gets the unmarshalled representation of the event payload. |
Serializable |
getUnmarshalledPayload(Class[] jaxbClasses)
Gets the unmarshalled representation of the event payload, allowing specification of JAXB settings to be used if creating the unmarshalled payload form from the WSRPV2 form. |
Object |
getWSRPV1MarshalledPayload()
Returns the WSRPV1 marshalled representation of the event payload, if applicable. |
Object |
getWSRPV2MarshalledPayload()
Returns the WSRPV2 marshalled representation of the event payload, if applicable. |
Object |
getWSRPV2MarshalledPayload(Class[] jaxbClasses)
Returns the WSRPV2 marshalled representation of the event payload, if applicable, and allows specification JAXB configuration. |
QName |
getWSRPV2MarshalledPayloadXMLType()
Returns the XML type of the WSRPV2 marshalled representation of the event payload, if applicable. |
boolean |
isPayloadOriginUnmarshalled()
Returns true if the origin of the
event's payload is UNMARSHALLED , indicating that the
event was created locally. |
boolean |
isPayloadOriginWSRPV1()
Returns true if the origin of the
event's payload is WSRPV1 , indicating that the
event was received from a remote producer over WSRP 1.0. |
boolean |
isPayloadOriginWSRPV2()
Returns true if the origin of the
event's payload is WSRPV2 , indicating that the
event was received from a remote producer over WSRP 2.0. |
boolean |
isUnmarshalledPayloadAvailable()
Returns true if the event represented by
this IEventContext has an unmarshalled
representation of the event payload. |
boolean |
isWSRPV1MarshalledPayloadAvailable()
Returns true if the event represented by
this IEventContext has a WSRPV1
marshalled representation of the event payload ready to include
in a WSRP version 1.0 SOAP message. |
boolean |
isWSRPV1MarshalledPayloadSerializedJavaObject()
Returns true if the event represented by
this IEventContext has a
WSRPV1 marshalled event
payload representation which is a serialized Java object. |
boolean |
isWSRPV1MarshalledPayloadXML()
Returns true if the event represented by
this IEventContext has a
WSRPV1 marshalled event
payload representation which is an XML DOM Element. |
boolean |
isWSRPV2MarshalledPayloadAvailable()
Returns true if the event represented by
this IEventContext has a WSRPV2
marshalled representation of the event payload ready to include
in a WSRP version 2.0 SOAP message. |
boolean |
isWSRPV2MarshalledPayloadNamedStringArray()
Returns true if the event represented by
this IEventContext has a
WSRPV2 marshalled event
payload representation which is a NamedStringArray. |
boolean |
isWSRPV2MarshalledPayloadSerializedJavaObject()
Returns true if the event represented by
this IEventContext has a
WSRPV2 marshalled event
payload representation which is a serialized Java object. |
boolean |
isWSRPV2MarshalledPayloadXML()
Returns true if the event represented by
this IEventContext has a
WSRPV2 marshalled event
payload representation which is an XML DOM Element. |
Element |
jaxbMarshal(Object object,
Class[] jaxbClasses)
Utility method for manually marshalling an object to an XML DOM element using JAXB. |
Object |
jaxbUnmarshal(Element xml,
Class[] jaxbClasses)
Utility method for manually unmarshalling an XML DOM element to an object using JAXB. |
void |
removeUnmarshalledPayload()
Removes the unmarshalled payload representation, if applicable, so that it would be re-created if needed. |
void |
removeWSRPV1MarshalledPayload()
Removes the WSRPV1 payload representation, if applicable, so that it would be re-created if needed. |
void |
removeWSRPV2MarshalledPayload()
Removes the WSRPV2 payload representation, if applicable, so that it would be re-created if needed. |
void |
setPayload(Serializable payload)
Sets the unmarshalled form of the payload, removes the WSRPV1 and WSRPV2 forms of the payload, and sets the payload origin to UNMARSHALLED ,
if applicable. |
void |
setPayloadOriginUnmarshalled()
Sets the origin of the event's payload to UNMARSHALLED , which affects how other forms of the event
payload are created if needed
for sending over WSRP. |
void |
setPayloadOriginWSRPV1()
Sets the origin of the event's payload to WSRPV1 , which affects how other forms of the event
payload are created if needed for sending over
WSRP 2.0 or delivery to a local
portlet. |
void |
setPayloadOriginWSRPV2()
Sets the origin of the event's payload to WSRPV2 , which affects how other forms of the event
payload are created if needed for sending over
WSRP 1.0 or delivery to a local
portlet. |
void |
setSourcePortletDefinitionLabel(String definitionLabel)
Sets the definition label of the portlet that generated this event, if possible. |
void |
setSourcePortletInstanceLabel(String instanceLabel)
Sets the instance label of the portlet that generated this event, if possible. |
void |
setUnmarshalledPayload(Serializable payload)
Sets the unmarshalled form of the payload, if possible, without affecting the WSRPV1 or WSRPV2 marshalled representations of the event payload or the event payload origin, if applicable. |
void |
setWSRPV1MarshalledPayloadAsSerializedJavaObject(String serializedObject)
Sets the WSRPV1 marshalled representation of the event payload to a serialized Java object if possible, without affecting the WSRPV2 or unmarshalled representations of the event payload or the event payload origin. |
void |
setWSRPV1MarshalledPayloadAsXML(Element domElement)
Sets the WSRPV1 marshalled representation of the event payload to XML if possible, without affecting the WSRPV2 or unmarshalled representations of the event payload or the event payload origin. |
void |
setWSRPV2MarshalledPayloadAsNamedStringArray(NamedStringArray payload)
Sets the WSRPV2 marshalled representation of the event payload to a NamedStringArray if possible, without affecting the WSRPV1 or unmarshalled representations of the event payload or the event payload origin. |
void |
setWSRPV2MarshalledPayloadAsSerializedJavaObject(String serializedObject)
Sets the WSRPV2 marshalled representation of the event payload to a serialized Java object if possible, without affecting the WSRPV1 or unmarshalled representations of the event payload or the event payload origin. |
void |
setWSRPV2MarshalledPayloadAsXML(Element domElement,
QName xmlType)
Sets the WSRPV2 marshalled representation of the event payload to XML if possible, without affecting the WSRPV1 or unmarshalled representations of the event payload or the event payload origin. |
Method Detail |
---|
String getSerializedJavaObjectForm(Serializable object) throws IOException, InvalidClassException, NotSerializableException
object
- the object to serialize.
null
if the object was null
.
InvalidClassException
- when something is wrong with a class
used by serialization
NotSerializableException
- when some object to be serialized does
not implement the java.io.Serializable interface.
IOException
- if an undefined problem occurs serializing the object.setWSRPV1MarshalledPayloadAsSerializedJavaObject(String)
,
setWSRPV2MarshalledPayloadAsSerializedJavaObject(String)
,
getDeserializedJavaObject(String)
Serializable getDeserializedJavaObject(String serializedObject) throws ClassNotFoundException, InvalidClassException, StreamCorruptedException, OptionalDataException, IOException
serializedObject
- base-64-encoded bytes representing the object to deserialize.
null
if the serializedObject
argument was null
.
ClassNotFoundException
- if the serialized Class cannot be found by the
current ClassLoader.
InvalidClassException
- if something is wrong with the serialized class
StreamCorruptedException
- if the control information in the serialized
object is inconsistent
OptionalDataException
- if the bytes do not seem to represent a
serialized Java object
IOExceptions
- if something is wrong with the bytes representing the
serialized object
IOException
getSerializedJavaObjectForm(Serializable)
,
isWSRPV1MarshalledPayloadSerializedJavaObject()
,
isWSRPV2MarshalledPayloadSerializedJavaObject()
,
getWSRPV1MarshalledPayload()
,
getWSRPV2MarshalledPayload()
String getSourcePortletDefinitionLabel()
null
otherwise.
Not all event types are generated by or for
portlets; for example, LookAndFeelReinit events do not have a source
portlet, so the source definition label will always be null for these events.
null
otherwise.void setSourcePortletDefinitionLabel(String definitionLabel)
null
.
Definition labels set by this method will be used for
outgoing events on an IHandleEventsRequestContext.
However, setting the definition label to null will effectively
erase the definition label from events coming into the consumer
from an IInteractionResponseContext or IHandleEventsResponseContext.
If this event type does not carry information
about the source portlet (such as LookAndFeelReinit events),
this method has no effect.
definitionLabel
- the new source portlet definition label
for the event.String getSourcePortletInstanceLabel()
null
otherwise.
Not all event types are generated by or for
portlets; for example, LookAndFeelReinit events do not have a
source portlet, so the source instance label will always be null
for these events.
null
otherwise.void setSourcePortletInstanceLabel(String instanceLabel)
null
.
Instance labels set by this method will be used for
outgoing events on an IHandleEventsRequestContext.
However, setting the instance label to null will effectively
erase the instance label from events coming into the consumer
from an IInteractionResponseContext or IHandleEventsResponseContext.
If this event type does not carry information
about the source portlet (such as LookAndFeelReinit events),
this method has no effect.
instanceLabel
- the new source portlet instance label
for the event.QName getQName()
boolean canHavePayload()
true
if the event represented by this
IEventContext can have a payload.
Note that not all event types that can have payloads
in WebLogic Portal can have the payload sent over WSRP, such as
WindowModeChange and WindowStateChange events.
true
if the event represented by this
IEventContext can have a payload.boolean canHaveWsrpEventPayload()
true
if the event represented by this
IEventContext can have a payload which is sent over
WSRP. Note that not all event types that can have payloads
in WebLogic Portal have the payload sent over WSRP, such as
WindowModeChange and WindowStateChange events.
true
if the event represented by this
IEventContext can have a payload sent over WSRP.boolean isWSRPV1MarshalledPayloadAvailable()
true
if the event represented by
this IEventContext has a WSRPV1
marshalled representation of the event payload ready to include
in a WSRP version 1.0 SOAP message.
true
if the WSRPV1 marshalled representation
of the event payload is available, or false
if the WSRPV1 marshalled representation is not available
or if the event cannot have a payload sent over WSRP.boolean isWSRPV2MarshalledPayloadAvailable()
true
if the event represented by
this IEventContext has a WSRPV2
marshalled representation of the event payload ready to include
in a WSRP version 2.0 SOAP message.
true
if the WSRPV2 marshalled representation
of the event payload is available, or false
if the WSRPV2 marshalled representation is not available
or if the event cannot have a payload sent over WSRP.boolean isUnmarshalledPayloadAvailable()
true
if the event represented by
this IEventContext has an unmarshalled
representation of the event payload. For events which
can have a payload but cannot have a payload sent over WSRP,
such as WindowModeChange and
WindowStateChange events, this method will return
true
.
true
if the unmarshalled representation
of the event payload is available, even if the unmarshalled
representation is null
,
or false
if the unmarshalled
representation of the payload is not available or
if the event cannot have a payload..boolean isWSRPV1MarshalledPayloadSerializedJavaObject()
true
if the event represented by
this IEventContext has a
WSRPV1 marshalled event
payload representation which is a serialized Java object.
true
if the event has a WSRPV1 marshalled form
which is a serialized Java object, or
false
if the event
cannot have an event payload
sent over WSRP, does not have a WSRPV1 marshalled
payload represention, or the WSRPV1 marshalled form is
not a serialized Java object.boolean isWSRPV2MarshalledPayloadSerializedJavaObject()
true
if the event represented by
this IEventContext has a
WSRPV2 marshalled event
payload representation which is a serialized Java object.
true
if the event has a WSRPV2 marshalled form
which is a serialized Java object, or
false
if the event
cannot have an event payload
sent over WSRP, does not have a WSRPV2 marshalled
payload represention, or the WSRPV2 marshalled form is
not a serialized Java object.boolean isWSRPV1MarshalledPayloadXML()
true
if the event represented by
this IEventContext has a
WSRPV1 marshalled event
payload representation which is an XML DOM Element.
true
if the event has a WSRPV1 marshalled form
which is an XML DOM Element, or false
if the event
cannot have an event payload
sent over WSRP, does not have a WSRPV1 marshalled
payload represention, or the WSRPV1 marshalled form is
not an XML DOM Element.boolean isWSRPV2MarshalledPayloadXML()
true
if the event represented by
this IEventContext has a
WSRPV2 marshalled event
payload representation which is an XML DOM Element.
true
if the event has a WSRPV2 marshalled form
which is an XML DOM Element, or false
if the event
cannot have an event payload
sent over WSRP, does not have a WSRPV2 marshalled
payload represention, or the WSRPV2 marshalled form is
not an XML DOM Element.boolean isWSRPV2MarshalledPayloadNamedStringArray()
true
if the event represented by
this IEventContext has a
WSRPV2 marshalled event
payload representation which is a NamedStringArray.
true
if the event has a WSRPV2 marshalled form
which is a NamedStringArray, or false
if the event
cannot have an event payload
sent over WSRP, does not have a WSRPV2 marshalled
payload represention, or the WSRPV2 marshalled form is
not a NamedStringArray.Serializable getUnmarshalledPayload() throws Throwable
XmlPayload
object.
After calling this method, the event's unmarshalled payload form
is considered available, even if the unmarshalled form is null
.
null
if the event payload is empty,
the event cannot have a payload sent over WSRP, or if
default unmarshalling was attempted and failed in the past.
If default unmarshalling failed upon a call to this
method, an exception would be thrown.
Throwable
#getUnmarshalledPayload(String)
,
IEventContext#getDefaultJAXBPackageList()
,
jaxbUnmarshal(Element,Class[])
Serializable getUnmarshalledPayload(Class[] jaxbClasses) throws Throwable
XmlPayload
object.
JAXB Exceptions thrown while creating the JAXBContext
(for example, if one of the specified classes is not JAXB-bindable)
will be thrown, however.
After calling this method, the event's unmarshalled payload form
is considered available, even if the unmarshalled form is null
.
jaxbClasses
- an array of Class objects representing Java objects
with JAXB bindings, for use in
unmarshalling the WSRPV2 representation, if JAXB would be used
in the default unmarshalling algorithm.
If null
, JAXB unmarshalling will be suppressed
completely.
null
if the event payload is empty,
the event cannot have a payload sent over WSRP, or if
default unmarshalling was attempted and failed in the past.
If default unmarshalling failed upon a call to this
method, an exception would be thrown.
Throwable
IEventContext#getDefaultJAXBPackageList()
,
IEventContext#jaxbUnmarshal(Element,String)
Object getWSRPV1MarshalledPayload() throws Throwable
null
is returned. If the WSRPV1 marshalled
representation of the event payload does not exist,
the default marshalling algorithm
will be used to create the WSRPV1 marshalled representation.
If the WSRPV1 marshalled representation of the event payload is
XML, a org.w3c.dom.Element
object will be
returned, containing the root DOM Element of the event
payload's WSRPV1 marshalled representation's XML.
If the WSRPV1 marshalled representation of the event payload is
a serialized Java object, a String will be returned containing
the base-64-encoded bytes representing the serialized Java object.
If the default marshalling algorithm
is used to create the WSRPV1 marshalled form of the event payload,
any exceptions or errors encountered are thrown by this method
(normally, exceptions or errors encountered marshalling
event payloads are only logged, and the marshalled payload
representation is left empty). The most likely exceptions
to be thrown during default marshalling are:
null
(if the WSRPV1 marshalled form is empty), or a
org.w3c.dom.Element or a String.
Throwable
getDeserializedJavaObject(String)
Object getWSRPV2MarshalledPayload() throws Throwable
null
is returned. If the WSRPV2 marshalled
representation of the event payload does not exist,
the default marshalling algorithm
will be used to create the WSRPV2 marshalled representation.
If the WSRPV2 marshalled representation of the event payload is
XML, a org.w3c.dom.Element
object will be
returned, containing the root DOM Element of the event
payload's WSRPV2 marshalled representation's XML.
If the WSRPV2 marshalled representation of the event payload is
a NamedStringArray, a NamedStringArray
object will be returned. Note that NamedStringArray is implemented
in such a way as to un-marshall data from the XML representation
dynamically, and the NamedStringArray holds on to the marshalled
XML until any modifications are made to the NamedStringArray.
If the WSRPV2 marshalled representation of the event payload is
a serialized Java object, a String will be returned containing
the base-64-encoded bytes representing the serialized Java object.
If the default marshalling algorithm
is used to create the WSRPV2 marshalled form of the event payload,
any exceptions or errors encountered are thrown by this method
(normally, exceptions or errors encountered marshalling
event payloads are only logged, and the marshalled payload
representation is left empty). The most likely exceptions
to be thrown during default marshalling are:
#getWSRPV2MarshalledPayload(String)
.
After calling this method, the event's WSRPV2 payload form
is considered available, even if it is empty.
null
(if the WSRPV2 marshalled form is empty), or a
org.w3c.dom.Element, NamedStringArray
,
or a String.
Throwable
getDeserializedJavaObject(String)
,
IEventContext#getWSRPV2MarshalledPayload(String)
,
IEventContext#getDefaultJAXBPackageList()
,
jaxbMarshal(Object,Class[])
Object getWSRPV2MarshalledPayload(Class[] jaxbClasses) throws Throwable
null
is returned. If the WSRPV2 marshalled
representation of the event payload does not exist,
the default marshalling algorithm
will be used to create the WSRPV2 marshalled representation.
If the WSRPV2 marshalled representation of the event payload is
XML, a org.w3c.dom.Element
object will be
returned, containing the root DOM Element of the event
payload's WSRPV2 marshalled representation's XML.
If the WSRPV2 marshalled representation of the event payload is
a NamedStringArray, a NamedStringArray
object will be returned. Note that NamedStringArray is implemented
in such a way as to un-marshall data from the XML representation
dynamically, and the NamedStringArray holds on to the marshalled
XML until any modifications are made to the NamedStringArray.
If the WSRPV2 marshalled representation of the event payload is
a serialized Java object, a String will be returned containing
the base-64-encoded bytes representing the serialized Java object.
If the default marshalling algorithm
is used to create the WSRPV2 marshalled form of the event payload,
any exceptions or errors encountered are thrown by this method
(normally, exceptions or errors encountered marshalling
event payloads are only logged, and the marshalled payload
representation is left empty). The most likely exceptions
to be thrown during default marshalling are:
jaxbClasses
- an array of Class objects representing Java objects
with JAXB bindings, for use in
marshalling the WSRPV2 representation, if JAXB would be used
in the default marshalling algorithm.
If null
, JAXB marshalling will be suppressed
completely.
null
(if the WSRPV2 marshalled form is empty), or a
org.w3c.dom.Element, NamedStringArray
,
or a String.
Throwable
getDeserializedJavaObject(String)
,
getWSRPV2MarshalledPayload()
,
IEventContext#getDefaultJAXBPackageList()
,
IEventContext#jaxbMarshal(Object,String)
QName getWSRPV2MarshalledPayloadXMLType() throws Throwable
null
is returned. If the WSRPV2 marshalled
representation of the event payload does not exist,
the default marshalling algorithm
will be used to create the WSRPV2 marshalled representation.
If the default marshalling algorithm
is used to create the WSRPV2 marshalled form of the event payload,
any exceptions or errors encountered are thrown by this method
(normally, exceptions or errors encountered marshalling
event payloads are only logged, and the marshalled payload
representation is left empty). The most likely exceptions
to be thrown during default marshalling are:
null
if not applicable or
available.
Throwable
void setPayload(Serializable payload) throws IllegalArgumentException
UNMARSHALLED
,
if applicable. If the event cannot have
a payload, this method has no effect.
For WindowModeChange and WindowStateChange
events, this method will set the payload (new mode or state) although these
events cannot have a payload sent over WSRP.
For events which can have payloads sent over WSRP, this method
will set the unmarshalled representation
of the event payload, remove the WSRPV1 and WSRPV2 forms
of the payload, and set the payload origin to UNMARSHALLED
.
If the event is subsequently sent to a WSRP producer and the appropriate
WSRP payload representation is not available, the
default marshalling algorithm
will be used to create the marshalled form from the unmarshalled form.
After calling this method, the event's unmarshalled payload form
is considered available, even if the unmarshalled form is null
.
payload
- the unmarshalled payload to set for the event. If the
event represented by this IEventContext is a WindowModeChangeEvent
or WindowStateChangeEvent, the payload must be a non-null
String
or an IllegalArgumentException will be thrown.
IllegalArgumentException
- if the event represented by this
IEventContext is a WindowModeChangeEvent or WindowStateChangeEvent
and the payload argument was not a non-null String
.removeWSRPV1MarshalledPayload()
,
removeWSRPV2MarshalledPayload()
,
setPayloadOriginUnmarshalled()
void setUnmarshalledPayload(Serializable payload) throws IllegalArgumentException
UNMARSHALLED
.
Note that If the event's origin is UNMARSHALLED
and the event is
subsequently sent to a WSRP producer and the appropriate
WSRP payload representation is not available, the
default marshalling algorithm
will be used to create the marshalled form from the unmarshalled form.
After calling this method, the event's unmarshalled payload form
is considered available, even if the unmarshalled form is null
.
payload
- the unmarshalled payload to set for the event. If the
event represented by this IEventContext is a WindowModeChangeEvent
or WindowStateChangeEvent, the payload must be a non-null
String
or an IllegalArgumentException will be thrown.
IllegalArgumentException
- if the event represented by this
IEventContext is a WindowModeChangeEvent or WindowStateChangeEvent
and the payload argument was not a non-null String
.removeUnmarshalledPayload()
void setWSRPV1MarshalledPayloadAsSerializedJavaObject(String serializedObject)
WSRPV1
.
Note that if the event payload's origin is WSRPV1
and the unmarshalled or WSRPV2 form does not exist, these payload forms
will be created from the WSRPV1 form
if they are needed.
After calling this method, the event's WSRPV1 payload form
is considered available, even if it is empty.
serializedObject
- the String representing a serialized Java object,
as returned by the getSerializedJavaObjectForm(Serializable)
method.
If null
, the WSRPV1 marshalled form of the payload
will be empty, but available (it will not be automatically re-created).getSerializedJavaObjectForm(Serializable)
,
removeWSRPV1MarshalledPayload()
void setWSRPV2MarshalledPayloadAsSerializedJavaObject(String serializedObject)
WSRPV2
.
Note that if the event payload's origin is WSRPV2
and the unmarshalled or WSRPV1 form does not exist, these payload forms
will be created from the WSRPV2 form
if they are needed.
After calling this method, the event's WSRPV2 payload form
is considered available, even if it is empty.
serializedObject
- the String representing a serialized Java object,
as returned by the getSerializedJavaObjectForm(Serializable)
method.
If null
, the WSRPV2 marshalled form of the payload
will be empty, but available (it will not be automatically re-created).getSerializedJavaObjectForm(Serializable)
,
removeWSRPV2MarshalledPayload()
void setWSRPV1MarshalledPayloadAsXML(Element domElement)
WSRPV1
.
Note that if the event payload's origin is WSRPV1
and the unmarshalled or WSRPV2 form does not exist, these payload forms
will be created from the WSRPV1 form
if they are needed.
After calling this method, the event's WSRPV1 payload form
is considered available, even if it is empty.
domElement
- the XML DOM element to set as the WSRPV1 marshalled
payload form.
If null
, the WSRPV1 marshalled form of the payload
will be empty, but available (it will not be automatically re-created).getSerializedJavaObjectForm(Serializable)
,
removeWSRPV1MarshalledPayload()
void setWSRPV2MarshalledPayloadAsXML(Element domElement, QName xmlType)
WSRPV2
.
Note that if the event payload's origin is WSRPV2
and the unmarshalled or WSRPV1 form does not exist, these payload forms
will be created from the WSRPV2 form
if they are needed.
After calling this method, the event's WSRPV2 payload form
is considered available, even if it is empty.
domElement
- the XML DOM element to set as the WSRPV2 marshalled
payload form.
If null
, the WSRPV2 marshalled form of the payload
will be empty, but available (it will not be automatically re-created).xmlType
- the XML type to use when describing the event payload
for WSRP V2.getSerializedJavaObjectForm(Serializable)
,
removeWSRPV2MarshalledPayload()
void setWSRPV2MarshalledPayloadAsNamedStringArray(NamedStringArray payload)
WSRPV2
.
Note that if the event payload's origin is WSRPV2
and the unmarshalled or WSRPV1 form does not exist, these payload forms
will be created from the WSRPV2 form
After calling this method, the event's WSRPV2 payload form
is considered available, even if it is empty.
payload
- the NamedStringArray to set as the WSRPV2 marshalled
representation of the event payload.
If null
, the WSRPV2 marshalled form of the payload
will be empty.removeWSRPV2MarshalledPayload()
boolean isPayloadOriginUnmarshalled()
true
if the origin of the
event's payload is UNMARSHALLED
, indicating that the
event was created locally.
If the event represented by this IEventContext cannot
have a payload sent over WSRP, false
is returned.
true
if this event can have a payload sent over
WSRP and the event's origin is UNMARSHALLED
,
otherwise false
.boolean isPayloadOriginWSRPV1()
true
if the origin of the
event's payload is WSRPV1
, indicating that the
event was received from a remote producer over WSRP 1.0.
If the event represented by this IEventContext cannot
have a payload sent over WSRP, false
is returned.
true
if this event can have a payload sent over
WSRP and the event's origin is WSRPV1
,
otherwise false
.boolean isPayloadOriginWSRPV2()
true
if the origin of the
event's payload is WSRPV2
, indicating that the
event was received from a remote producer over WSRP 2.0.
If the event represented by this IEventContext cannot
have a payload sent over WSRP, false
is returned.
true
if this event can have a payload sent over
WSRP and the event's origin is WSRPV2
,
otherwise false
.void setPayloadOriginUnmarshalled()
UNMARSHALLED
, which affects how other forms of the event
payload are created if needed
for sending over WSRP. If no unmarshalled form of the payload is
available, it is created as null
.
If the event represented by this IEventContext cannot
have a payload sent over WSRP this method has no effect.
void setPayloadOriginWSRPV1()
WSRPV1
, which affects how other forms of the event
payload are created if needed for sending over
WSRP 2.0 or delivery to a local
portlet. If no WSRPV1 form of the payload is
available, it is created as empty.
If the event represented by this IEventContext cannot
have a payload sent over WSRP this method has no effect.
void setPayloadOriginWSRPV2()
WSRPV2
, which affects how other forms of the event
payload are created if needed for sending over
WSRP 1.0 or delivery to a local
portlet. If no WSRPV2 form of the payload is
available, it is created as empty.
If the event represented by this IEventContext cannot
have a payload sent over WSRP this method has no effect.
void removeUnmarshalledPayload() throws IllegalStateException
UNMARSHALLED
,
an IllegalStateException is thrown.
IllegalStateException
- if the event can have a payload sent
over WSRP and the payload's origin is UNMARSHALLED
.isPayloadOriginUnmarshalled()
void removeWSRPV1MarshalledPayload() throws IllegalStateException
WSRPV1
,
an IllegalStateException is thrown.
IllegalStateException
- if the event can have a payload sent
over WSRP and the payload's origin is WSRPV1
.isPayloadOriginWSRPV1()
void removeWSRPV2MarshalledPayload() throws IllegalStateException
WSRPV2
,
an IllegalStateException is thrown.
IllegalStateException
- if the event can have a payload sent
over WSRP and the payload's origin is WSRPV2
.isPayloadOriginWSRPV2()
Event getEvent()
Class[] getDefaultJAXBClasses()
null
is returned.Element jaxbMarshal(Object object, Class[] jaxbClasses) throws javax.xml.bind.JAXBException, ParserConfigurationException
object
- the object to marshaljaxbClasses
- the set of JAXB-bindable classes to use
when creating the JAXBContext for marshalling.
javax.xml.bind.JAXBException
ParserConfigurationException
#getDefaultJAXBPackageList()
Object jaxbUnmarshal(Element xml, Class[] jaxbClasses) throws javax.xml.bind.JAXBException
xml
- the XML DOM element to unmarshaljaxbClasses
- the set of JAXB-bindable classes to use
when creating the JAXBContext for unmarshalling.
javax.xml.bind.JAXBException
#getDefaultJAXBPackageList()
|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.4) E14255-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |