public interface AssetTree
extends net.openhft.chronicle.core.io.Closeable
| Modifier and Type | Method and Description |
|---|---|
Asset |
acquireAsset(String fullName)
Get or create an asset
|
default <K,V> MapView<K,V,V> |
acquireMap(String uri,
Class<K> kClass,
Class<V> vClass)
Acquire a map view for a URI.
|
default <E> Publisher<E> |
acquirePublisher(String uri,
Class<E> eClass)
Acquire a publisher to a single URI.
|
default <E> Reference<E> |
acquireReference(String uri,
Class<E> eClass)
Acquire a reference to a single URI
|
default <S> S |
acquireService(String uri,
Class<S> serviceType)
Acquire a generic service by URI and serviceType.
|
default <E> Set<E> |
acquireSet(String uri,
Class<E> eClass)
Acquire a set view for a URI.
|
default Subscription |
acquireSubscription(RequestContext requestContext)
Acquire the Subscription view for a URI.
|
default <T,E> TopicPublisher<T,E> |
acquireTopicPublisher(String uri,
Class<T> topicClass,
Class<E> messageClass)
Acquire a Topic Publisher view for a URI.
|
default <E> E |
acquireView(RequestContext requestContext)
Acquire a generic view by ResourceContext.
|
default AssetTree |
disableManagement()
Disable JMX management of this Asset Tree
|
default AssetTree |
enableManagement()
Enable JMX management of this Asset Tree
|
default AssetTree |
enableManagement(int port)
Enable JMX management of this Asset Tree
|
Asset |
getAsset(String fullName)
Get an existing Asset by fullName or return null.
|
default Subscription |
getSubscription(RequestContext requestContext)
Get a Subscription view for a URI if ti exists.
|
default <E> void |
registerSubscriber(String uri,
Class<E> eClass,
Subscriber<E> subscriber)
Register a subscriber to a URI with an expected type of message by class.
|
default <T,E> void |
registerTopicSubscriber(String uri,
Class<T> topicClass,
Class<E> messageClass,
TopicSubscriber<T,E> subscriber)
Register a topic subscriber to a URI with an expected type of message by topic class and message class
|
Asset |
root()
Get the root asset.
|
default <E> void |
unregisterSubscriber(String uri,
Subscriber<E> subscriber)
Remove a subscription.
|
default <T,E> void |
unregisterTopicSubscriber(String uri,
TopicSubscriber<T,E> subscriber)
Remove a topic subscription.
|
Asset root()
@Nullable Asset getAsset(String fullName)
fullName - of the Asset@NotNull Asset acquireAsset(@NotNull String fullName) throws AssetNotFoundException
fullName - of the asset to obtainAssetNotFoundException@NotNull default <E> Set<E> acquireSet(@NotNull String uri, Class<E> eClass) throws AssetNotFoundException
uri - to search foreClass - element class.AssetNotFoundException - the view could not be constructed.@NotNull default <K,V> MapView<K,V,V> acquireMap(@NotNull String uri, Class<K> kClass, Class<V> vClass) throws AssetNotFoundException
uri - to search forkClass - key class of the map.vClass - value class of the map.AssetNotFoundException - the view could not be constructed.@NotNull default <E> Publisher<E> acquirePublisher(@NotNull String uri, Class<E> eClass) throws AssetNotFoundException
uri - to search foreClass - element class.AssetNotFoundException - the view could not be constructed.@NotNull default <E> Reference<E> acquireReference(@NotNull String uri, Class<E> eClass) throws AssetNotFoundException
uri - to search foreClass - type of the state referencedAssetNotFoundException - the view could not be constructed.@NotNull default <T,E> TopicPublisher<T,E> acquireTopicPublisher(@NotNull String uri, Class<T> topicClass, Class<E> messageClass) throws AssetNotFoundException
uri - to search fortopicClass - class of topic descriptions e.g. String.class.messageClass - class of messages to send on that topic..AssetNotFoundException - the view could not be constructed.default <E> void registerSubscriber(@NotNull
String uri,
Class<E> eClass,
Subscriber<E> subscriber)
throws AssetNotFoundException
uri - of the asset to subscribe to.eClass - the type of event/message to subscribe tosubscriber - to notify which this type of message is sent.AssetNotFoundException - the view could not be constructed.default <T,E> void registerTopicSubscriber(@NotNull
String uri,
Class<T> topicClass,
Class<E> messageClass,
TopicSubscriber<T,E> subscriber)
throws AssetNotFoundException
uri - of the asset to subscribe to.topicClass - the type of topic to subscribe tomessageClass - the type of event/message to subscribe tosubscriber - to notify which this type of message is sent.AssetNotFoundException - the view could not be constructed.@NotNull default Subscription acquireSubscription(@NotNull RequestContext requestContext) throws AssetNotFoundException
requestContext - to find the subscriptionAssetNotFoundException - the view could not be constructed.default <E> void unregisterSubscriber(@NotNull
String uri,
Subscriber<E> subscriber)
uri - of the asset subscribed to.subscriber - to removedefault <T,E> void unregisterTopicSubscriber(@NotNull
String uri,
TopicSubscriber<T,E> subscriber)
throws AssetNotFoundException
uri - of the asset subscribed to.subscriber - to removeAssetNotFoundException@Nullable default Subscription getSubscription(@NotNull RequestContext requestContext)
requestContext - to find the subscriptionAssetNotFoundException - the view could not be constructed.@NotNull
default <S> S acquireService(@NotNull
String uri,
Class<S> serviceType)
throws AssetNotFoundException
uri - to search forserviceType - type of the serviceAssetNotFoundException - if not found, and could not be created.@NotNull
default <E> E acquireView(@NotNull
RequestContext requestContext)
throws AssetNotFoundException
requestContext - to use to search or create the view.AssetNotFoundException - if the view could not be created.default AssetTree enableManagement()
default AssetTree enableManagement(int port)
port - to enable a simple web service ondefault AssetTree disableManagement()
Copyright © 2015. All rights reserved.