Class NullEventMessageImpl
- java.lang.Object
-
- com.opencloud.rhino.facilities.sas.NullEventMessageImpl
-
- All Implemented Interfaces:
EventMessage
,Message<EventMessage>
public final class NullEventMessageImpl extends Object implements EventMessage
This is public because package-private is classloader-package-private. Do not use in deployed code.
-
-
Field Summary
Fields Modifier and Type Field Description static EventMessage
NULL_EVENT_MESSAGE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 theSasFacility
.void
report()
Enqueue this message for reporting to SAS.EventMessage
staticParam(int param0)
Add a 32-bit fixed-length parameter to the message.EventMessage
staticParam(EnumParameter param0)
Add a 32-bit fixed-length parameter to the message, specified as an enumerated type.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 afterMessage.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.
-
-
-
Field Detail
-
NULL_EVENT_MESSAGE
public static final EventMessage NULL_EVENT_MESSAGE
-
-
Method Detail
-
instance
public EventMessage instance(int instanceId)
- Specified by:
instance
in interfaceMessage<EventMessage>
-
isEnabled
public boolean isEnabled()
Description copied from interface:Message
Allows a caller to guard against performing expensive marshalling of message parameters, in cases where it doesn’t have access to the
SasFacility
.- Specified by:
isEnabled
in interfaceMessage<EventMessage>
- Returns:
- true if SAS tracing is enabled on the SAS facility this message was created from
-
timestamp
public EventMessage timestamp(long timestamp)
- Specified by:
timestamp
in interfaceEventMessage
- Parameters:
timestamp
- the timestamp to set- Returns:
- this to allow method chaining
-
threadSafeParam
public EventMessage threadSafeParam(byte[] param)
Description copied from interface: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.- Specified by:
threadSafeParam
in interfaceMessage<EventMessage>
- Parameters:
param
- a message parameter that the caller guarantees will not be subsequently modified- Returns:
- this, to allow method chaining
-
varParam
public EventMessage varParam(Object param0)
Description copied from interface: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
).- Specified by:
varParam
in interfaceMessage<EventMessage>
- Parameters:
param0
- an parameter to be added to this message- Returns:
- this, to allow method chaining
-
varParams
public EventMessage varParams(Object param0, Object param1)
Description copied from interface:Message
Add two variable-length parameters. Parameters will be handled as for
#param(Object)
.See warning on interface Javadoc about when parameters are marshalled.
- Specified by:
varParams
in interfaceMessage<EventMessage>
- Returns:
- this, to allow method chaining
-
varParams
public EventMessage varParams(Object param0, Object param1, Object param2)
Description copied from interface:Message
Add three variable-length parameters. Parameters will be handled as for
#param(Object)
.See warning on interface Javadoc about when parameters are marshalled.
- Specified by:
varParams
in interfaceMessage<EventMessage>
- Returns:
- this, to allow method chaining
-
staticParam
public EventMessage staticParam(int param0)
Description copied from interface:Message
Add a 32-bit fixed-length parameter to the message.
- Specified by:
staticParam
in interfaceMessage<EventMessage>
- Parameters:
param0
- a 32-bit integer containing the parameter- Returns:
- this, to allow method chaining
-
staticParam
public EventMessage staticParam(EnumParameter param0)
Description copied from interface:Message
Add a 32-bit fixed-length parameter to the message, specified as an enumerated type.
The implementation adds the parameter using
EnumParameter.value()
.- Specified by:
staticParam
in interfaceMessage<EventMessage>
- Parameters:
param0
- an enum parameter from a generated enum type- Returns:
- this, to allow method chaining
-
staticParam
public EventMessage staticParam(Integer param0)
Description copied from interface:Message
Add a 32-bit fixed-length parameter to the message, specified as an Integer.
- Specified by:
staticParam
in interfaceMessage<EventMessage>
- Parameters:
param0
- an enum parameter from a generated enum type- Returns:
- this, to allow method chaining
-
report
public void report()
Description copied from interface: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.- Specified by:
report
in interfaceMessage<EventMessage>
-
-