Modifier and Type | Field and Description |
---|---|
private ServiceLocatorImpl |
locator |
private java.util.Set<java.lang.annotation.Annotation> |
requiredQualifiers |
private java.lang.reflect.Type |
topicType |
Constructor and Description |
---|
TopicImpl(ServiceLocatorImpl locator,
java.lang.reflect.Type topicType,
java.util.Set<java.lang.annotation.Annotation> requiredQualifiers) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.annotation.Annotation> |
getTopicQualifiers()
The qualifiers associated with this Topic.
|
java.lang.reflect.Type |
getTopicType()
Gets the type of the topic, in order to match the message
to subscribers
|
Topic<T> |
named(java.lang.String name)
Returns an Topic that is further qualified
with the given name
|
<U> Topic<U> |
ofType(java.lang.reflect.Type type)
Returns an Topic that is of the given type.
|
void |
publish(T message)
Publishes a message to all subscribers
|
Topic<T> |
qualifiedWith(java.lang.annotation.Annotation... qualifiers)
A set of qualifiers to further restrict this Topic to.
|
private final ServiceLocatorImpl locator
private final java.lang.reflect.Type topicType
private final java.util.Set<java.lang.annotation.Annotation> requiredQualifiers
TopicImpl(ServiceLocatorImpl locator, java.lang.reflect.Type topicType, java.util.Set<java.lang.annotation.Annotation> requiredQualifiers)
public void publish(T message)
Topic
public Topic<T> named(java.lang.String name)
Topic
public <U> Topic<U> ofType(java.lang.reflect.Type type)
Topic
public Topic<T> qualifiedWith(java.lang.annotation.Annotation... qualifiers)
Topic
qualifiedWith
in interface Topic<T>
qualifiers
- The qualifiers to further restrict this Topic topublic java.lang.reflect.Type getTopicType()
Topic
getTopicType
in interface Topic<T>
public java.util.Set<java.lang.annotation.Annotation> getTopicQualifiers()
Topic
getTopicQualifiers
in interface Topic<T>