Package uk.ac.diamond.daq.msgbus
Enum Class MsgBus
- All Implemented Interfaces:
Serializable,Comparable<MsgBus>,Constable
Eagerly-initialised singleton (per-process but linked by JMS destination).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUseful to discover which msg types are not handled by any subscribers WITHIN THIS PROCESS ONLY (so only really useful for testing).static classConvenience class allowing import static ...MsgBus.*; of Serializable.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic booleanstatic voidstatic voidSend an object (which need not implement Msg/Serializable) to reqistered subscribers WITHIN THIS PROCESS ONLY.static voidpublish(Serializable msg) Send a Msg object to all consumers of topic, i.e.static voidstatic voidRegister subscriber object to receive deserialized msg objects in zero or more of its @Subscribe annotated methods depending on msg type.static voidunsubscribe(Object subscriber) Deregister subscriber object from receiving msg objects.static MsgBusReturns the enum constant of this class with the specified name.static MsgBus[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
post
Send an object (which need not implement Msg/Serializable) to reqistered subscribers WITHIN THIS PROCESS ONLY. Logs what is posted.- Throws:
IllegalArgumentException- if argument is null.
-
publishAsJson
-
publish
Send a Msg object to all consumers of topic, i.e. each process's MsgBus singleton, which on receiving it will then post it to all registered subscribers with an @Subscribe annotated method accepting arguments of that msg type.- Throws:
IllegalArgumentException- if argument is null.
-
subscribe
Register subscriber object to receive deserialized msg objects in zero or more of its @Subscribe annotated methods depending on msg type.- Throws:
IllegalArgumentException- if argument is null.
-
unsubscribe
Deregister subscriber object from receiving msg objects.- Throws:
IllegalArgumentException- if argument is null.
-
_shutdown
public void _shutdown() -
main
-
isLocalActiveMQ
public static boolean isLocalActiveMQ()- Returns:
- flag for Local ActiveMQ response indicating whether server is active
-