public final class OpaqueEvent extends com.streamscape.sdo.IAbstractEvent implements OpaqueDatagram, PayloadEvent
Title: Structured Data Objects: Opaque Event
Description: A basic object that represents an Opaque Event.
An opaque event is a special type of Structured Data Object called an Opaque Event Datagram
, or simply
Eventgram. It implements the OpaqueDatagram
interface and is optimized for high performance transmission
of serialized data within the Service Event Fabric. The optimization reduces the size of the datagram header at
the expense of decreasing functionality. An opaque does not allow for setting user defined properties and does not support
extended header properties or annotations. Further optimization is achieved by omitting serial version information and
transmission access information.
The opaque datagram object is intended to be converted into a serialized data packet and sent over the network
using a messaging transport. The payload may be an arbitrary Java Object
or a Structured Data Object
that is set and retrieved by setData(java.lang.Object)
and getData()
methods respectably. Whatever the object that is
the payload of a data event, it must be registered as a known Semantic Type
by the runtime. The implementer
may make use of system objects in order to create special typed events:
An opaque event has the following system properties:
eventSource
- The fabric address of the component that generated the event. Set by the dispatcher.eventId
- The event identifier (and Subject) that identifies this event type.eventKey
- A key that uniquely identifies this event instance.eventGroupId
- An identifier that may be used to group or sequence events.durable
- A flag that indicates whether the event is durable. Durable is a hint to persist or cache events.timeStamp
- The time stamp of when the event was raised to the dispatcher. Set by the dispatcher.AccessControl
- The access control object used to protect this event datagram. Access may not be set.Copyright: Copyright (c) 2010
Company: StreamScape Technologies
SEMANTIC_TYPE_NAME
DEFAULT_SERIAL_VERSION_ID
Modifier and Type | Method and Description |
---|---|
void |
checkPayloadClass(java.lang.Class payloadClass) |
static boolean |
doMatchesPayloadClass(java.lang.Class dataClass,
java.lang.Class newDataClass) |
boolean |
equals(java.lang.Object other) |
java.lang.Object |
getData()
Returns the event payload.
|
java.lang.Class |
getPayloadClass()
Returns a class of the event payload.
|
boolean |
matchesPayloadClass(java.lang.Class dataClass,
java.lang.Class newDataClass) |
void |
setData(java.lang.Object newData)
Sets the specified payload of this event.
|
clone, getDurable, getEventGroupId, getEventId, getEventKey, getEventSource, getSerialVersionUID, getTimestamp, getTransmitAccess, isCoalesced, setDurable, setEventGroupId, setEventId, setEventKey
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setEventGroupId, setEventKey
clone, getDurable, getEventGroupId, getEventId, getEventKey, getEventSource, getTimestamp, getTransmitAccess
getSerialVersionUID
public void setData(java.lang.Object newData) throws SDOException
setData
in interface OpaqueDatagram
newData
- the data to be set.SDORuntimeException
- if the event is coalesced (locked for editing).SDOException
- if the specified newData
is null
or
if the specified data has wrong type.public void checkPayloadClass(java.lang.Class payloadClass) throws SDOException
SDOException
public boolean matchesPayloadClass(java.lang.Class dataClass, java.lang.Class newDataClass)
public java.lang.Class getPayloadClass()
getPayloadClass
in interface PayloadEvent
public java.lang.Object getData() throws SDOException
Since the OpaqueEvent
is optimized for fast work this method always directly returns the event data,
not a copy! (in contrast to the method DataEvent.getData()
).
So the subscriber should not change the returned data, because such a change can affect the initial event instance or
other subscribers of this event in the current node.
getData
in interface OpaqueDatagram
SDOException
- if some internal error occurs.public boolean equals(java.lang.Object other)
equals
in class com.streamscape.sdo.IAbstractEvent
public static boolean doMatchesPayloadClass(java.lang.Class dataClass, java.lang.Class newDataClass)
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.