public abstract class AbstractApplication extends Object implements Application
Application.Builder| Modifier and Type | Field and Description |
|---|---|
protected String |
applicationId |
protected Set<Topic> |
subscriptions |
protected TransportAsync |
transport |
| Constructor and Description |
|---|
AbstractApplication(AbstractClient client,
String applicationId,
Executor executor) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkClosed() |
void |
close() |
abstract AbstractData |
data(Topic topic)
Lookup a data controller to an application topic
|
protected void |
handleConnected() |
protected void |
handleDisconnected() |
protected abstract CompletionStage<?> |
internalSubscribe(Topic topic,
MessageHandler handler,
ErrorHandler<? extends Throwable> errorHandler) |
protected abstract void |
publish(Topic topic,
Payload payload) |
CompletionStage<?> |
subscribe(Topic topic,
MessageHandler handler,
ErrorHandler<? extends Throwable> errorHandler) |
Transport |
transport()
Lookup a transport controller
|
protected final Set<Topic> subscriptions
protected final String applicationId
protected final TransportAsync transport
public AbstractApplication(AbstractClient client, String applicationId, Executor executor)
protected void handleConnected()
protected void handleDisconnected()
protected void checkClosed()
public Transport transport()
ApplicationA transport controller for the client's underlying transport mechanism.
Note: Each application has its own instance and thus can set events handler independent of the root client or other applications.
transport in interface Applicationpublic abstract AbstractData data(Topic topic)
Applicationdata in interface Applicationtopic - the topic the controller is bound to, must never be nullpublic void close() throws Exception
close in interface AutoCloseableExceptionprotected abstract void publish(Topic topic, Payload payload) throws Exception
Exceptionpublic CompletionStage<?> subscribe(Topic topic, MessageHandler handler, ErrorHandler<? extends Throwable> errorHandler) throws Exception
Exceptionprotected abstract CompletionStage<?> internalSubscribe(Topic topic, MessageHandler handler, ErrorHandler<? extends Throwable> errorHandler) throws Exception
ExceptionCopyright © 2017. All rights reserved.