public abstract class AbstractClient extends Object implements Client
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractClient.Builder<T extends AbstractClient.Builder<T>> |
| Modifier and Type | Field and Description |
|---|---|
protected ScheduledExecutorService |
executor |
| Constructor and Description |
|---|
AbstractClient(ScheduledExecutorService executor,
Set<Module> modules) |
| Modifier and Type | Method and Description |
|---|---|
Application.Builder |
buildApplication(String applicationId)
Create a new application instance
|
protected void |
handleApplicationClosed(String applicationId,
AbstractApplication application) |
protected void |
handleConnected() |
protected void |
handleDisconnected() |
protected AbstractApplication |
internalBuildApplication(Application.Builder builder,
String applicationId) |
protected void |
internalCloseApplication(String applicationId,
Set<Topic> topics,
AbstractApplication application) |
protected abstract AbstractApplication |
internalCreateApplication(Application.Builder builder,
String applicationId) |
protected abstract void |
internalUnsubscribe(String applicationId,
Collection<Topic> topics) |
protected void |
notifyAddApplication(String applicationId) |
protected void |
notifyConnected() |
protected void |
notifyDisconnected() |
protected void |
notifyRemoveApplication(String applicationId) |
Transport |
transport()
Get control over the transport
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloseprotected final ScheduledExecutorService executor
public AbstractClient(ScheduledExecutorService executor, Set<Module> modules)
public Transport transport()
Clientprotected void notifyAddApplication(String applicationId)
protected void notifyRemoveApplication(String applicationId)
protected void notifyConnected()
protected void notifyDisconnected()
protected void handleConnected()
protected void handleDisconnected()
public Application.Builder buildApplication(String applicationId)
Client
This method only returns a new builder which will
create a new instance once Application.Builder.build() is called.
Before that the application is not built and no resources are claimed.
Application IDs are unique. If an application ID is already allocated it
cannot be allocated a second time. The second call to Application.Builder.build() will fail.
However this application ID only allocated once the call to Application.Builder.build()
succeeded.
buildApplication in interface ClientapplicationId - The ID of the application to createApplication.Builder instanceprotected AbstractApplication internalBuildApplication(Application.Builder builder, String applicationId)
protected abstract AbstractApplication internalCreateApplication(Application.Builder builder, String applicationId)
protected abstract void internalUnsubscribe(String applicationId, Collection<Topic> topics) throws Exception
Exceptionprotected void internalCloseApplication(String applicationId, Set<Topic> topics, AbstractApplication application)
protected void handleApplicationClosed(String applicationId, AbstractApplication application)
Copyright © 2017. All rights reserved.