public final class NullEventMessageImpl extends Object implements EventMessage
This is public because package-private is classloader-package-private. Do not use in deployed code.
Modifier and Type | Field and Description |
---|---|
static EventMessage |
NULL_EVENT_MESSAGE |
Modifier and Type | Method and Description |
---|---|
EventMessage |
instance(int instanceId) |
boolean |
isEnabled()
Allows a caller to guard against performing expensive marshalling of message parameters, in cases where it doesn’t have access to the
SasFacility . |
void |
report()
Enqueue this message for reporting to SAS.
|
EventMessage |
staticParam(EnumParameter param0)
Add a 32-bit fixed-length parameter to the message, specified as an enumerated type.
|
EventMessage |
staticParam(int param0)
Add a 32-bit fixed-length parameter to the message.
|
EventMessage |
staticParam(Integer param0)
Add a 32-bit fixed-length parameter to the message, specified as an Integer.
|
EventMessage |
threadSafeParam(byte[] param)
Add a parameter that will not be copied, even after
Message.report() is called and therefore must not be modified by calling code. |
EventMessage |
timestamp(long timestamp) |
EventMessage |
varParam(Object param0)
Add one variable length parameter.
|
EventMessage |
varParams(Object param0,
Object param1)
Add two variable-length parameters.
|
EventMessage |
varParams(Object param0,
Object param1,
Object param2)
Add three variable-length parameters.
|
public static final EventMessage NULL_EVENT_MESSAGE
public EventMessage instance(int instanceId)
instance
in interface Message<EventMessage>
public boolean isEnabled()
Message
Allows a caller to guard against performing expensive marshalling of message parameters, in cases where it doesn’t have access to the SasFacility
.
isEnabled
in interface Message<EventMessage>
public EventMessage timestamp(long timestamp)
timestamp
in interface EventMessage
timestamp
- the timestamp to setpublic EventMessage threadSafeParam(byte[] param)
Message
Add a parameter that will not be copied, even after Message.report()
is called and therefore must not be modified by calling code.
Callers should use this for parameters which it plans to modify and has therefore defensively copied or marshalled into a new byte array.
Use of Message.isEnabled()
is recommended before marshalling to avoid unnecessary memory and CPU use.
threadSafeParam
in interface Message<EventMessage>
param
- a message parameter that the caller guarantees will not be subsequently modifiedpublic EventMessage varParam(Object param0)
Message
Add one variable length parameter.
Warning: Parameters passed to this and other variable-length parameter methods must not be modified until the Message.report()
method is called.
See discussion in the Javadoc for this interface (Message
).
varParam
in interface Message<EventMessage>
param0
- an parameter to be added to this messagepublic EventMessage varParams(Object param0, Object param1)
Message
Add two variable-length parameters.
Parameters will be handled as for #param(Object)
.
See warning on interface Javadoc about when parameters are marshalled.
varParams
in interface Message<EventMessage>
public EventMessage varParams(Object param0, Object param1, Object param2)
Message
Add three variable-length parameters.
Parameters will be handled as for #param(Object)
.
See warning on interface Javadoc about when parameters are marshalled.
varParams
in interface Message<EventMessage>
public EventMessage staticParam(int param0)
Message
Add a 32-bit fixed-length parameter to the message.
staticParam
in interface Message<EventMessage>
param0
- a 32-bit integer containing the parameterpublic EventMessage staticParam(EnumParameter param0)
Message
Add a 32-bit fixed-length parameter to the message, specified as an enumerated type.
The implementation adds the parameter using EnumParameter.value()
.
staticParam
in interface Message<EventMessage>
param0
- an enum parameter from a generated enum typepublic EventMessage staticParam(Integer param0)
Message
Add a 32-bit fixed-length parameter to the message, specified as an Integer.
staticParam
in interface Message<EventMessage>
param0
- an enum parameter from a generated enum typepublic void report()
Message
Enqueue this message for reporting to SAS.
Variable-length parameters added with #param(Object)
and the multi-parameter methods are marshalled into
the message when this method is called so they can be freely modified from this call on.
Parameters added with Message.threadSafeParam(byte[])
are not copied therefore must not be modified even after this method is called
because the actual reporting to SAS will be done asynchronously.
report
in interface Message<EventMessage>