public interface ChannelAccessClient
Channel Access client. A client is the top-level object provided by this library and provides access to channels.
Several clients might run independently within one JVM, but typically you should only use a single client to save resources. Separate clients are only needed if you want to use different configuration options in parallel.
A client may keep strong or weak references to its
ChannelAccessChannels
. Therefore, code should
always retain a strong reference to a channel as long as it wants to keep
that channel alive when the implementation uses weak references. However, it
should also destroy a channel explicitly when it does not need it any longer,
so that an implementation that keeps a strong reference kann still free the
resources associated with a channel.
While different implementations of a Channel Access client are possible, this
library only provides a single implementation, the
DefaultChannelAccessClient
. This implementation can be configured and
should be suitable for most purposes.
ChannelAccessChannel
,
ChannelAccessClientConfiguration
,
DefaultChannelAccessClient
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys this client.
|
ChannelAccessChannel |
getChannel(java.lang.String channelName)
Returns a reference to the channel with the given name.
|
ChannelAccessClientConfiguration |
getConfiguration()
Returns the configuration for this Channel Access client.
|
void destroy()
ChannelAccessChannel getChannel(java.lang.String channelName)
channelName
- network name of the channel. The name is serialized using the
configured charset (see
ChannelAccessClientConfiguration.getCharset()
).java.lang.IllegalStateException
- if this client has been destroyed.SerializedChannelNameTooLargeException
- if the serialized form of the channelName
is too
long to sent it in a search request.ChannelAccessClientConfiguration getConfiguration()
Copyright © 2014–2017 aquenos GmbH. All rights reserved.