Package net.engio.mbassy.bus
Class AbstractPubSubSupport<T>
java.lang.Object
net.engio.mbassy.bus.AbstractPubSubSupport<T>
- Type Parameters:
T-
- All Implemented Interfaces:
PubSubSupport<T>,RuntimeProvider
- Direct Known Subclasses:
AbstractSyncAsyncMessageBus,SyncMessageBus
The base class for all message bus implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate final List<IPublicationErrorHandler> private final MessagePublication.Factoryprivate final BusRuntimeprivate final SubscriptionManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MessagePublicationcreateMessagePublication(T message) protected MessagePublication.Factoryprotected Collection<Subscription> getSubscriptionsByMessageType(Class messageType) protected voidvoidSubscribe all handlers of the given listener.toString()booleanunsubscribe(Object listener) Immediately remove all registered message handlers (if any) of the given listener.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.engio.mbassy.bus.common.PubSubSupport
publish
-
Field Details
-
errorHandlers
-
publicationFactory
-
subscriptionManager
-
runtime
-
ERROR_HANDLER_MSG
- See Also:
-
-
Constructor Details
-
AbstractPubSubSupport
-
-
Method Details
-
getPublicationFactory
-
getRegisteredErrorHandlers
-
unsubscribe
Description copied from interface:PubSubSupportImmediately remove all registered message handlers (if any) of the given listener. When this call returns all handlers have effectively been removed and will not receive any messages (provided that running publications (iterators) in other threads have not yet obtained a reference to the listener) A call to this method passing any object that is not subscribed will not have any effect and is silently ignored.- Specified by:
unsubscribein interfacePubSubSupport<T>- Parameters:
listener-- Returns:
- true, if the listener was found and successfully removed false otherwise
-
subscribe
Description copied from interface:PubSubSupportSubscribe all handlers of the given listener. Any listener is only subscribed once -> subsequent subscriptions of an already subscribed listener will be silently ignored- Specified by:
subscribein interfacePubSubSupport<T>- Parameters:
listener-
-
getRuntime
- Specified by:
getRuntimein interfaceRuntimeProvider
-
createMessagePublication
-
getSubscriptionsByMessageType
-
handlePublicationError
-
toString
-