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()
Application
A 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 Application
public abstract AbstractData data(Topic topic)
Application
data
in interface Application
topic
- the topic the controller is bound to, must never be null
public void close() throws Exception
close
in interface AutoCloseable
Exception
protected abstract void publish(Topic topic, Payload payload) throws Exception
Exception
public CompletionStage<?> subscribe(Topic topic, MessageHandler handler, ErrorHandler<? extends Throwable> errorHandler) throws Exception
Exception
protected abstract CompletionStage<?> internalSubscribe(Topic topic, MessageHandler handler, ErrorHandler<? extends Throwable> errorHandler) throws Exception
Exception
Copyright © 2017. All rights reserved.