|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.2) E14255-01 |
||||||||
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. <p/> Every event has a QName identifying the type of event. <p/>
The table below lists all events which can be sent over WSRP. Some events such as NotificationEvents cannot be sent over WSRP and are not listed; when such events are slated to be sent over WSRP they are removed from the list of events. The columns for the table are:
<p/>
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 |
<p/> Note: CustomEvents can have any namespace with the following exceptions:
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.WindowModeChangeEvent and WindowStateChangeEvents can have a payload in Oracle WebLogic Portal, but the WSRP 2.0 specification does not allow these events to have a payload sent over WSRP. (For Oracle WebLogic Portal's proprietary implementation of events sent over WSRP 1.0, WindowModeChange and WindowStateChange events also do not have a payload sent over WSRP.) When these events are sent over WSRP, Oracle WebLogic Portal uses the new portlet mode or new portlet state information encoded in the WSRP request or response to populate the payload of the event. Setting the payload of a WindowModeChangeEvent or WindowStateChangeEvent using the IEventContext will not cause the portlet to be put into a new mode or state, as the event is only a notification of a change having occured. Furthermore, setting the payload of a WindowModeChangeEvent or WindowStateChangeEvent on an IHandleEventsRequestContext will have no effect as the payload will not be encoded in the HandleEventsRequest WSRP SOAP message. <p/>
For events which can have a payload sent over WSRP, the event payload object must be sent in XML form (referred to as the "marshalled" form) to be included in the WSRP SOAP message. The WSRP 2.0 specification does not dictate a particular scheme for encoding event payloads to ensure interoperability, so it is possible that an event could be received from a portlet on a third-party WSRP producer and that WebLogic Portal would not know how to convert the event's payload to a Java object. For this reason and to enhance performance, Oracle WebLogic Portal avoids converting the marshalled form of event payloads to Java objects whenever possible. This allows a Oracle WebLogic Portal consumer to distribute events between portlets on third-party producers even though the consumer cannot understand the event payload. When event payload conversion into or from the marshalled form is necessary, WebLogic Portal follows the default proceedures discussed below. The IEventContext object may be used in conjunction with the WSRP interceptors to marshal and unmarshal event payloads, avoiding the default marshalling and unmarshalling operations discussed below. <p/> Every event which can have a payload sent over WSRP has three possible representations of the event payload:
<p/> Each of these representations is created only as it is needed, but once the representation has been created it is stored with the event and is never re-created unless methods on this class are used. For example, if an event were received over WSRP 1.0, the event created on the consumer would hold only the WSRPV1 marshalled form of the event payload. If the event was then delivered to a local portlet on the consumer, the unmarshalled form of the event payload would be created from the WSRPV1 marshalled form, so the event would then have both the unmarshalled form and the WSRPV1 marshalled form of the event payload. If the event were then sent to another WSRP version 1.0 producet portlet, the existing WSRPV1 marshalled form would be used without being re-created. However, if the event were subsequently also sent to a WSRP version 2.0 producer portlet, the WSRPV2 marshalled form would be created for use in the WSRP 2.0 SOAP message. The event object would then carry all three possible representations of the event payload. <p/>
The WSRP 1.0 specification does not support events but WebLogic Portal uses a proprietary extension for sending events between portlets over WSRP 1.0. <p/> Over WSRP 1.0, previous versions of WebLogic Portal supported two over-the-wire encodings ("marshalled forms") of event payloads in WSRP SOAP messages:
To remain backward-compatible with older versions of WebLogic Portal, this version only uses these two mechanisms for encoding event payloads over WSRP 1.0. <p/>
The WSRP 2.0 specification includes full support for inter-portlet events. Over WSRP 2.0, the WSRP specification supports two means of encoding event payloads: a WSRP 2.0 NamedStringArray schema type, or as any other XML. WebLogic Portal also supports a proprietary XML tag for encoding an event payload as a serialized Java object in WSRP 2.0. Therefore WebLogic Portal supports three over-the-wire encodings ("marshalled forms") of event payloads for WSRP 2.0:
NamedStringArray
object.<p/> To maximize interoperability with third-party WSRP 2.0 producers and consumers, WebLogic Portal utilizes Java Architecture for XML Binding (JAXB) to convert Java objects to raw XML for the WSRPV2 marshalled form whenever possible, hopefully eliminating the need to have the exact Java class on the third-party consumer or producer for deserialization. To remain backward-compatible with older versions of WebLogic Portal over WSRP 1.0, JAXB is not used to create the WSRPV1 marshalled form. See the discussion on JAXB marshalling and unmarshalling for details on configuration of JAXB bindings. <p/> Due to slight incompatibilities between the way event payload marshalling and unmarshalling happens for WSRP 1.0 and WSRP 2.0, there are potential issues when using a WebLogic Portal consumer which is sending events between remote portlets where some portlets are using WSRP 1.0 and some are using WSRP 2.0. See the discussion of these potential issues for more information. <p/>
Two special Java objects are used for WSRP event payloads:
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.When these special types are used as an event's payload (unmarshalled form), they get special handling when creating the marshalled representations of the event payload, and default unmarshalling may return these objects as the event's payload (unmarshalled form) as described below. The NamedStringArray object also happens to be used in the WSRPV2 marshalled form, as the object is able to convert itself to and from XML dynamically. <p/>
Every event which can have a payload sent over WSRP also stores information about the origin of its payload-- how the payload came in when the event was created. The origin can have three settings:
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.<p/> The payload's origin information is used whenever it is necessary to create another form (unmarshalled, WSRPV1 or WSRPV2) of the payload's representation. <p/> If the event was created with the 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. <p/>
When creating the marshalled form of an event payload, WebLogic Portal uses the following logic. This occurs whenever the needed marshalled form (WSRPV1 for WSRP 1.0 or WSRPV2 for WSRP 2.0) does not already exist but is needed, such as when the event is sent from the consumer to a producer, or when a portlet on a WLP producer sends an event. Once the marshalled form of the event payload has been created, it is stored with the event to avoid re-marshalling if the event is to be sent to another WSRP portlet on the same WSRP version. <p/>
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.When an event's payload is requested by a portlet (or the IEventContext.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. <p/>
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.When WebLogic Portal is used as a WSRP consumer of portlets accessed over both WSRP 1.0 and WSRP 2.0, issues can arrise in translating event payloads to the other version of WSRP. These issues are detailed below, but by using WSRP interceptors and this IEventContext object the behavior can be customized. <p/>
When a portlet on a WSRP 1.0 (WebLogic Portal) producer sends an event that is delivered to a portlet on a WSRP 2.0 producer the following issues can arrise:
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.<p/>
When a portlet on a WSRP 2.0 producer sends an event that is delivered to a portlet on a WSRP 1.0 (WebLogic Portal) producer, the following issues can arrise:
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.When JAXB marshalling / unmarshalling of Java objects is performed for WSRPV2 marshalled forms of event payloads, the JAXB context is configured with a list of classes with JAXB bindings. This list is constructed by WebLogic Portal by combining all entries specified in the 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. <p/> 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. <p/>
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 serializationNotSerializableException
- 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 classStreamCorruptedException
- if the control information in the serialized object is inconsistentOptionalDataException
- if the bytes do not seem to represent a serialized Java objectIOExceptions
- if something is wrong with the bytes representing the serialized objectIOException
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. <p/> 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. <p/> 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. <p/> 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. <p/> 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. <p/> 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. <p/> 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. <p/> 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. <p/> 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. <p/> 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)
. <p/> 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. <p/> 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. <p/> 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. <p/> 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. <p/> 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. <p/> 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. <p/> 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. <p/> 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
. <p/> 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. <p/> 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
. <p/> 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. <p/> 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
. <p/> 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. <p/> 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
. <p/> 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. <p/> 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
. <p/> 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. <p/> 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
. <p/> 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 <p/> 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.2) E14255-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2010, Oracle. All rights reserved.