com.bea.wsrp.model.markup
Interface IEventContext


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.

Every event has a QName identifying the type of event.

Events Which Can be Sent Over WSRP

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:

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

Note: CustomEvents can have any namespace with the following exceptions:

WSRP Handling of WindowModeChange and WindowStateChange Events

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.

Encoding Event Payloads over WSRP

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.

Every event which can have a payload sent over WSRP has three possible representations of the event payload:

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.

WSRPV1 Marshalled Event Payload Form

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.

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.

WSRPV2 Marshalled Event Payload Form

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:

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.

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.

Special Unmarshalled Event Payload Objects

Two special Java objects are used for WSRP event payloads: 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.

Event Payload Origin

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:

The payload's origin information is used whenever it is necessary to create another form (unmarshalled, WSRPV1 or WSRPV2) of the payload's representation.

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.

Default Event Payload Marshalling Mechanism

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.

Default Algorithm for Creating the WSRPV1 Marshalled Form

  1. If the payload's origin is WSRPV1, the correct WSRPV1 marshalled form should already exist, so nothing is done.
  2. Otherwise, if the payload's origin is WSRPV2:
    1. If the WSRPV2 marshalled form is empty, the WSRPV1 marshalled form is set to be empty.
    2. If the WSRPV2 marshalled form is a NamedStringArray, it is serialized using Java serialization and the WSRPV1 marshalled form is set to the serialized representation of the NamedStringArray object.
    3. Otherwise, if the WSRPV2 marshalled form is a serialized Java object, the WSRPV1 marshalled form is set to the serialized Java object from the WSRPV2 marshalled form.
    4. Otherwise, the WSRPV2 marshalled form is raw XML, and the WSRPV1 marshalled form is set to the DOM Element from the WSRPV2 marshalled form.
  3. Otherwise, the payload's origin is UNMARSHALLED. if the unmarshalled payload is null, the WSRPV1 marshalled form is set to be empty.
  4. Otherwise, if the unmarshalled payload is an instance of XmlPayload, the WSRPV1 marshalled form is set to the DOM Element held by the XMLPayload object.
  5. Otherwise, serialization will be used to create the WSRPV1 marshalled form. If the WSRPV2 marshalled form exists and has a serialized Java object representation, the WSRPV1 marshalled form is set to the serialized Java object from the WSRPV2 marshalled form. This is done to avoid any unnecessary re-serialization of the object if it has already been serialized.
  6. Otherwise, the unmarshalled payload (including 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.

Default Algorithm for Creating the WSRPV2 Marshalled Form

  1. If the payload's origin is WSRPV2, the correct WSRPV2 marshalled form should already exist, so nothing is done.
  2. Otherwise, if the payload's origin is WSRPV1:
    1. If the WSRPV1 marshalled form is empty, the WSRPV2 marshalled form is set to be empty.
    2. Otherwise, if the WSRPV1 marshalled form is a serialized Java object, the WSRPV2 marshalled form is set to the serialized Java object from the WSRPV1 marshalled form.
    3. Otherwise, the WSRPV1 marshalled form is raw XML, and the WSRPV2 marshalled form is set to the DOM Element from the WSRPV1 marshalled form.
  3. Otherwise, the payload's origin is UNMARSHALLED. if the unmarshalled payload is null, the WSRPV2 marshalled form is set to be empty.
  4. Otherwise, if the unmarshalled payload is an instance of XmlPayload, the WSRPV2 marshalled form is set to the DOM Element held by the XMLPayload object.
  5. Otherwise, if the unmarshalled payload is an instance of NamedStringArray, the WSRPV2 marshalled form is set to the NamedStringArray object.
  6. Otherwise, if JAXB marshalling is enabled, JAXB marshalling is attempted on the unmarshalled payload object. If JAXB marshalling is successful the WSRPV2 marshalled form is set to the resulting DOM Element.
  7. Otherwise, if the WSRPV1 marshalled form is available and is a representation of a serialized Java object, the WSRPV2 marshalled form is set to the serialized Java object from the WSRPV1 form. This is done to avoid any unnecessary re-serialization of the object if it has already been serialized.
  8. Otherwise, the unmarshalled payload is serialized using Java serialization and the WSRPV2 marshalled form is set to the serialized object. If serialization fails, the WSRPV2 marshalled form is set to be empty.

Default Event Payload Unmarshalling Mechanism

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.

Default Algorithm for Creating the Unmarshalled Form

  1. If the payload's origin is UNMARSHALLED, the correct unmarshalled payload form should already exist, so nothing is done.
  2. If the payload's origin is WSRPV1:
    1. If the WSRPV1 marshalled form is empty, the unmarshalled form is set to null.
    2. If the WSRPV1 marshalled form is a serialized Java object, the object is deserialized and the the unmarshalled form is set to the resulting object. If deserialiazation fails, the unmarshalled form is set to null.
    3. Otherwise, the WSRPV1 marshalled form is XML, and the unmarshalled form is set to an XmlPayload object holding the DOM Element of the XML.
  3. Otherwise, the payload's origin is WSRPV2:
    1. If the WSRPV2 marshalled form is empty, the unmarshalled form is set to null.
    2. If the WSRPV2 marshalled form is a NamedStringArray, the unmarshalled form is set to the NamedStringArray   object.
    3. Otherwise, if the WSRPV2 marshalled form is a serialized Java object, the object is deserialized and the the unmarshalled form is set to the resulting object. If deserialiazation fails, the unmarshalled form is set to null.
    4. Otherwise, the WSRPV2 marshalled form is XML. If JAXB unmarshalling JAXB unmarshalling is enabled, JAXB unmarshalling is attempted on the XML element. If JAXB unmarshalling was successful and the resulting object implements the java.io.Serializable interface that all unmarshalled payloads must, the unmarshalled form is set to the resulting object.
    5. Otherwise, the unmarshalled form is set to an XmlPayload object holding the DOM Element of the XML.

Potential Issues Converting Between WSRP 1.0 and WSRP 2.0 Event Payload Representations

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.

WSRP 1.0 Portlets sending events to WSRP 2.0 portlets

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:
  1. If the event payload's WSRPV1 marshalled representation was raw XML, the WSRP 2.0 producer may use JAXB to unmarshall the payload into a Java object. So the WSRP 1.0 portlet sending an event with a payload of type 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.
  2. If the event payload's WSRPV1 marshalled representation was a serialized Java object, as long as the WSRP 2.0 producer is a WebLogic Portal producer and the serialized Java object's class is available on the producer, the event payload object will be unmarshalled successfully. However, if the WSRP 2.0 producer is a third-party producer, it will likely not understand the WLP-specific serialized Java object schema. In this case it may be useful to deserialize the object on the consumer and use JAXB or another mechanism to convert the event payload to XML. Note that this would require having the event payload object's class on the consumer for deserialization, and if using JAXB to re-marshal the payload, the JAXB binding classes for the event payload object would also be required on the consumer.

WSRP 2.0 Portlets sending events to WSRP 1.0 portlets

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:
  1. If JAXB marshalling was used to create the WSRPV2 marshalled representation of an event payload sent from a WSRP 2.0 producer portlet, the event payload will get unmarshalled for the WSRP 1.0 portlet as an XmlPayload object. This may or may not be the desired behavior.
  2. If the WSRP 2.0 portlet sent an event with a payload whose WSRPV2 marshalled representation was a NamedStringArray, the WSRP 1.0 producer portlet will receive a Java-serialized representation of the 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.

JAXB Marshalling and Unmarshalling

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.

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

getSerializedJavaObjectForm

String getSerializedJavaObjectForm(Serializable object)
                                   throws IOException,
                                          InvalidClassException,
                                          NotSerializableException
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.

Parameters
object - the object to serialize.
Returns
the bytes representing the serialized object, base-64 encoded into a String, or null if the object was null.
Throws
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.
See Also
setWSRPV1MarshalledPayloadAsSerializedJavaObject(String), setWSRPV2MarshalledPayloadAsSerializedJavaObject(String), getDeserializedJavaObject(String)

getDeserializedJavaObject

Serializable getDeserializedJavaObject(String serializedObject)
                                       throws ClassNotFoundException,
                                              InvalidClassException,
                                              StreamCorruptedException,
                                              OptionalDataException,
                                              IOException
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.

Parameters
serializedObject - base-64-encoded bytes representing the object to deserialize.
Returns
the deserialized Java object, or null if the serializedObject argument was null.
Throws
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
See Also
getSerializedJavaObjectForm(Serializable), isWSRPV1MarshalledPayloadSerializedJavaObject(), isWSRPV2MarshalledPayloadSerializedJavaObject(), getWSRPV1MarshalledPayload(), getWSRPV2MarshalledPayload()

getSourcePortletDefinitionLabel

String getSourcePortletDefinitionLabel()
Gets the definition label of the portlet that generated this event, if applicable and known, or 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.

Returns
the definition label of the portlet that generated this event, if applicable and known, or null otherwise.

setSourcePortletDefinitionLabel

void setSourcePortletDefinitionLabel(String definitionLabel)
Sets the definition label of the portlet that generated this event, if possible. If this event is coming into the consumer from a remote portlet from an IInteractionResponseContext or IHandleEventsResponseContext, this definition label will be replaced with the definition label of the consumer's proxy portlet for the remote portlet that generated the event, unless the definition label is set to 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.

Parameters
definitionLabel - the new source portlet definition label for the event.

getSourcePortletInstanceLabel

String getSourcePortletInstanceLabel()
Gets the instance label of the portlet that generated this event, if applicable and known, or 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.

Returns
the instance label of the portlet that generated this event, if applicable and known, or null otherwise.

setSourcePortletInstanceLabel

void setSourcePortletInstanceLabel(String instanceLabel)
Sets the instance label of the portlet that generated this event, if possible. If this event is coming into the consumer from a remote portlet from an IInteractionResponseContext or IHandleEventsResponseContext, this instance label will be replaced with the instance label of the consumer's proxy portlet for the remote portlet that generated the event, unless the instance label is set to 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.

Parameters
instanceLabel - the new source portlet instance label for the event.

getQName

QName getQName()
Gets the QName for the event represented by this IEventContext.

Returns
the QName of the event represented by this IEventContext.

canHavePayload

boolean canHavePayload()
Returns 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.

Returns
true if the event represented by this IEventContext can have a payload.

canHaveWsrpEventPayload

boolean canHaveWsrpEventPayload()
Returns 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.

Returns
true if the event represented by this IEventContext can have a payload sent over WSRP.

isWSRPV1MarshalledPayloadAvailable

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.

Returns
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.

isWSRPV2MarshalledPayloadAvailable

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.

Returns
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.

isUnmarshalledPayloadAvailable

boolean isUnmarshalledPayloadAvailable()
Returns 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.

Returns
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..

isWSRPV1MarshalledPayloadSerializedJavaObject

boolean isWSRPV1MarshalledPayloadSerializedJavaObject()
Returns true if the event represented by this IEventContext has a WSRPV1 marshalled event payload representation which is a serialized Java object.

Returns
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.

isWSRPV2MarshalledPayloadSerializedJavaObject

boolean isWSRPV2MarshalledPayloadSerializedJavaObject()
Returns true if the event represented by this IEventContext has a WSRPV2 marshalled event payload representation which is a serialized Java object.

Returns
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.

isWSRPV1MarshalledPayloadXML

boolean isWSRPV1MarshalledPayloadXML()
Returns true if the event represented by this IEventContext has a WSRPV1 marshalled event payload representation which is an XML DOM Element.

Returns
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.

isWSRPV2MarshalledPayloadXML

boolean isWSRPV2MarshalledPayloadXML()
Returns true if the event represented by this IEventContext has a WSRPV2 marshalled event payload representation which is an XML DOM Element.

Returns
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.

isWSRPV2MarshalledPayloadNamedStringArray

boolean isWSRPV2MarshalledPayloadNamedStringArray()
Returns true if the event represented by this IEventContext has a WSRPV2 marshalled event payload representation which is a NamedStringArray.

Returns
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.

getUnmarshalledPayload

Serializable getUnmarshalledPayload()
                                    throws Throwable
Gets the unmarshalled representation of the event payload. If this event can't have a payload, null is returned. If this event is a WindowModeChange or WindowStateChange event, the new mode or state is returned as a String, although these event types cannot have their payload sent over WSRP.

For events with payloads sent over WSRP, if the unmarshalled representation of the event payload is already available, it is returned. If the unmarshalled representation of the event payload isn't available, unmarshalling is performed using the default behavior for unmarshalling event payloads.

Any exceptions or errors thrown by default unmarshalling are thrown by this method (normally, exceptions or errors encountered unmarshalling event payloads are only logged, and the unmarshalled payload representation is set to null). The most likely exceptions to be thrown during default unmarshalling are:

Other exceptions or errors may be thrown, usually by Java object deserialization, but note that exceptions thrown by any attempted JAXB unmarshalling for WSRPV2 marshalled payloads will not be thrown, as such exceptions will lead to the unmarshalled representation being returned as raw XML in an XmlPayload object.

After calling this method, the event's unmarshalled payload form is considered available, even if the unmarshalled form is null.

Returns
the unmarshalled representation of the event payload, which can be 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.
Throws
Throwable
See Also
#getUnmarshalledPayload(String), IEventContext#getDefaultJAXBPackageList(), jaxbUnmarshal(Element,Class[])

getUnmarshalledPayload

Serializable getUnmarshalledPayload(Class[] jaxbClasses)
                                    throws Throwable
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. If this event can't have a payload, null is returned. If this event is a WindowModeChange or WindowStateChange event, the new mode or state is returned as a String, although these event types cannot have their payload sent over WSRP.

For events with payloads sent over WSRP, if the unmarshalled representation of the event payload is already available, it is returned. If the unmarshalled representation of the event payload isn't available, unmarshalling is performed using the default behavior for unmarshalling event payloads; if JAXB unmarshalling is attempted it will be done with the JAXB settings specified to this method.

Any exceptions or errors thrown by default unmarshalling are thrown by this method (normally, exceptions or errors encountered unmarshalling event payloads are only logged, and the unmarshalled payload representation is set to null). The most likely exceptions to be thrown during default unmarshalling are:

Other exceptions or errors may be thrown, usually by Java object deserialization, but note that exceptions thrown by any attempted JAXB unmarshalling for WSRPV2 marshalled payloads will not be thrown, as such exceptions will lead to the unmarshalled representation being returned as raw XML in an 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.

Parameters
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.
Returns
the unmarshalled representation of the event payload, which can be 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.
Throws
Throwable
See Also
IEventContext#getDefaultJAXBPackageList(), IEventContext#jaxbUnmarshal(Element,String)

getWSRPV1MarshalledPayload

Object getWSRPV1MarshalledPayload()
                                  throws Throwable
Returns the WSRPV1 marshalled representation of the event payload, if applicable. If the event represented by this IEventContext cannot have a payload sent over WSRP, 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:

Other exceptions or errors may be thrown.

After calling this method, the event's WSRPV1 payload form is considered available, even if it is empty.

Returns
the WSRPV1 marshalled representation of the event payload. The returned object will either be null (if the WSRPV1 marshalled form is empty), or a org.w3c.dom.Element or a String.
Throws
Throwable
See Also
getDeserializedJavaObject(String)

getWSRPV2MarshalledPayload

Object getWSRPV2MarshalledPayload()
                                  throws Throwable
Returns the WSRPV2 marshalled representation of the event payload, if applicable. If the event represented by this IEventContext cannot have a payload sent over WSRP, 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:

Other exceptions or errors may be thrown, but note that exceptions thrown by any attempted JAXB marshalling for the WSRPV2 marshalled form will not be thrown, as any such exceptions will lead to the WSRPV2 marshalled form being a serialized Java object.

If the default marshalling algorithm is used to create the WSRPV2 marshalled form of the event payload and JAXB is used, the default list of JAXB packages will be used for JAXB unmarshalling. To use a different JAXB package list, see #getWSRPV2MarshalledPayload(String).

After calling this method, the event's WSRPV2 payload form is considered available, even if it is empty.

Returns
the WSRPV2 marshalled representation of the event payload. The returned object will either be null (if the WSRPV2 marshalled form is empty), or a org.w3c.dom.Element, NamedStringArray, or a String.
Throws
Throwable
See Also
getDeserializedJavaObject(String), IEventContext#getWSRPV2MarshalledPayload(String), IEventContext#getDefaultJAXBPackageList(), jaxbMarshal(Object,Class[])

getWSRPV2MarshalledPayload

Object getWSRPV2MarshalledPayload(Class[] jaxbClasses)
                                  throws Throwable
Returns the WSRPV2 marshalled representation of the event payload, if applicable, and allows specification JAXB configuration. If the event represented by this IEventContext cannot have a payload sent over WSRP, 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:

Other exceptions or errors may be thrown, but note that exceptions thrown by any attempted JAXB marshalling for the WSRPV2 marshalled form will not be thrown, as any such exceptions will lead to the WSRPV2 marshalled form being a serialized Java 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 WSRPV2 payload form is considered available, even if it is empty.

Parameters
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.
Returns
the WSRPV2 marshalled representation of the event payload. The returned object will either be null (if the WSRPV2 marshalled form is empty), or a org.w3c.dom.Element, NamedStringArray, or a String.
Throws
Throwable
See Also
getDeserializedJavaObject(String), getWSRPV2MarshalledPayload(), IEventContext#getDefaultJAXBPackageList(), IEventContext#jaxbMarshal(Object,String)

getWSRPV2MarshalledPayloadXMLType

QName getWSRPV2MarshalledPayloadXMLType()
                                        throws Throwable
Returns the XML type of the WSRPV2 marshalled representation of the event payload, if applicable. If the event represented by this IEventContext cannot have a payload sent over WSRP, 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:

Other exceptions or errors may be thrown, but note that exceptions thrown by any attempted JAXB marshalling for the WSRPV2 marshalled form will not be thrown, as any such exceptions will lead to the WSRPV2 marshalled form being a serialized Java 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 WSRPV2 payload form is considered available, even if it is empty.

Returns
the XML type of the WSRPV2 marshalled representation of the event payload, or null if not applicable or available.
Throws
Throwable

setPayload

void setPayload(Serializable payload)
                throws IllegalArgumentException
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. 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.

Parameters
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.
Throws
IllegalArgumentException - if the event represented by this IEventContext is a WindowModeChangeEvent or WindowStateChangeEvent and the payload argument was not a non-null String.
See Also
removeWSRPV1MarshalledPayload(), removeWSRPV2MarshalledPayload(), setPayloadOriginUnmarshalled()

setUnmarshalledPayload

void setUnmarshalledPayload(Serializable payload)
                            throws IllegalArgumentException
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. 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, without changing the WSRPV1 or WSRPV2 payload representations or the event's origin. If the event previously had no payload origin, calling this method will set the payload origin to 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.

Parameters
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.
Throws
IllegalArgumentException - if the event represented by this IEventContext is a WindowModeChangeEvent or WindowStateChangeEvent and the payload argument was not a non-null String.
See Also
removeUnmarshalledPayload()

setWSRPV1MarshalledPayloadAsSerializedJavaObject

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. If the event cannot have a payload sent over WSRP, this method has no effect.

If the event previously had no payload origin, calling this method will set the payload origin to 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.

Parameters
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).
See Also
getSerializedJavaObjectForm(Serializable), removeWSRPV1MarshalledPayload()

setWSRPV2MarshalledPayloadAsSerializedJavaObject

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. If the event cannot have a payload sent over WSRP, this method has no effect.

If the event previously had no payload origin, calling this method will set the payload origin to 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.

Parameters
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).
See Also
getSerializedJavaObjectForm(Serializable), removeWSRPV2MarshalledPayload()

setWSRPV1MarshalledPayloadAsXML

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. If the event cannot have a payload sent over WSRP, this method has no effect.

If the event previously had no payload origin, calling this method will set the payload origin to 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.

Parameters
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).
See Also
getSerializedJavaObjectForm(Serializable), removeWSRPV1MarshalledPayload()

setWSRPV2MarshalledPayloadAsXML

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. If the event cannot have a payload sent over WSRP, this method has no effect.

If the event previously had no payload origin, calling this method will set the payload origin to 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.

Parameters
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.
See Also
getSerializedJavaObjectForm(Serializable), removeWSRPV2MarshalledPayload()

setWSRPV2MarshalledPayloadAsNamedStringArray

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. If the event cannot have a payload sent over WSRP, this method has no effect.

If the event previously had no payload origin, calling this method will set the payload origin to 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.

Parameters
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.
See Also
removeWSRPV2MarshalledPayload()

isPayloadOriginUnmarshalled

boolean isPayloadOriginUnmarshalled()
Returns 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.

Returns
true if this event can have a payload sent over WSRP and the event's origin is UNMARSHALLED, otherwise false.

isPayloadOriginWSRPV1

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. If the event represented by this IEventContext cannot have a payload sent over WSRP, false is returned.

Returns
true if this event can have a payload sent over WSRP and the event's origin is WSRPV1, otherwise false.

isPayloadOriginWSRPV2

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. If the event represented by this IEventContext cannot have a payload sent over WSRP, false is returned.

Returns
true if this event can have a payload sent over WSRP and the event's origin is WSRPV2, otherwise false.

setPayloadOriginUnmarshalled

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. 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.


setPayloadOriginWSRPV1

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. 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.


setPayloadOriginWSRPV2

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. 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.


removeUnmarshalledPayload

void removeUnmarshalledPayload()
                               throws IllegalStateException
Removes the unmarshalled payload representation, if applicable, so that it would be re-created if needed. If the event represented by this IEventContext cannot have a payload sent over WSRP, this method has no effect. If the payload's origin is UNMARSHALLED, an IllegalStateException is thrown.

Throws
IllegalStateException - if the event can have a payload sent over WSRP and the payload's origin is UNMARSHALLED.
See Also
isPayloadOriginUnmarshalled()

removeWSRPV1MarshalledPayload

void removeWSRPV1MarshalledPayload()
                                   throws IllegalStateException
Removes the WSRPV1 payload representation, if applicable, so that it would be re-created if needed. If the event represented by this IEventContext cannot have a payload sent over WSRP, this method has no effect. If the payload's origin is WSRPV1, an IllegalStateException is thrown.

Throws
IllegalStateException - if the event can have a payload sent over WSRP and the payload's origin is WSRPV1.
See Also
isPayloadOriginWSRPV1()

removeWSRPV2MarshalledPayload

void removeWSRPV2MarshalledPayload()
                                   throws IllegalStateException
Removes the WSRPV2 payload representation, if applicable, so that it would be re-created if needed. If the event represented by this IEventContext cannot have a payload sent over WSRP, this method has no effect. If the payload's origin is WSRPV2, an IllegalStateException is thrown.

Throws
IllegalStateException - if the event can have a payload sent over WSRP and the payload's origin is WSRPV2.
See Also
isPayloadOriginWSRPV2()

getEvent

Event getEvent()
Returns the Event represented by this IEventContext. Any further modifications made to the IEventContext will not be reflected in the returned Event, but will be reflected in the Event object returned by another call to getEvent().

Returns
the Event represented by this IEventContext.

getDefaultJAXBClasses

Class[] getDefaultJAXBClasses()
Returns the default JAXB class list which may be used for marshalling or unmarshalling WSRPV2 payload forms.

Returns
the default JAXB class list used for marshalling or unmarshalling WSRPV2 payload forms. If JAXB marshalling and unmarshalling is disabled, null is returned.

jaxbMarshal

Element jaxbMarshal(Object object,
                    Class[] jaxbClasses)
                    throws javax.xml.bind.JAXBException,
                           ParserConfigurationException
Utility method for manually marshalling an object to an XML DOM element using JAXB.

Parameters
object - the object to marshal
jaxbClasses - the set of JAXB-bindable classes to use when creating the JAXBContext for marshalling.
Returns
the XML DOM element representing the object.
Throws
javax.xml.bind.JAXBException
ParserConfigurationException
See Also
#getDefaultJAXBPackageList()

jaxbUnmarshal

Object jaxbUnmarshal(Element xml,
                     Class[] jaxbClasses)
                     throws javax.xml.bind.JAXBException
Utility method for manually unmarshalling an XML DOM element to an object using JAXB.

Parameters
xml - the XML DOM element to unmarshal
jaxbClasses - the set of JAXB-bindable classes to use when creating the JAXBContext for unmarshalling.
Returns
the object representing the unmarshalled XML.
Throws
javax.xml.bind.JAXBException
See Also
#getDefaultJAXBPackageList()


Copyright © 2011, Oracle. All rights reserved.