public abstract class AbstractApp<R> extends com.google.inject.AbstractModule implements EmbeddedServerController
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractApp.AlertRequestHandler<R>
The alert request handler
|
protected class |
AbstractApp.AlertSender<T extends IRogMessage> |
protected class |
AbstractApp.EventSender<T extends IRogMessage>
Implements the event sender
|
static class |
AbstractApp.HeartbeatRequestHandler<R>
The heartbeat request handler
|
protected class |
AbstractApp.HeartbeatSender<T extends IRogMessage>
Implements the heartbeat sender
|
static class |
AbstractApp.LogoutRequestHandler<R>
The logout request handler
|
protected class |
AbstractApp.MessageSenderImpl<T extends IRogMessage>
Message sender base implementation
|
protected class |
AbstractApp.PeerRequestSender<T extends IRogMessage>
Implements the request sender
|
static class |
AbstractApp.PostMessageProcessingTimesRequestHandler<R>
The post message processing times request handler
|
protected class |
AbstractApp.RequestExecutor<I extends IRogMessage & IRogCopyableNode,O extends IRogMessage,H extends MessageHandler<I,O,R>,S extends MessageSender<O>>
The request executor
|
protected class |
AbstractApp.ResponseSender<T extends IRogMessage>
Implements the response sender
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractApp(String appName,
String appNameForConfig,
int appPart,
int appMajorVersion,
int appMinorVersion)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAppGuiceModule(String moduleClassName,
Set<com.google.inject.AbstractModule> modules) |
void |
addCommandHandlerContainer(Set<Object> containers)
Get command handler containers
|
void |
addEventHandlerContainer(Set<Object> containers)
Get event handler containers
|
protected void |
configure()
Guice module configurer
|
protected <I extends IRogMessage & IRogCopyableNode,O extends IRogMessage,H extends MessageHandler<I,O,R>,S extends MessageSender<O>> |
createRequestExecutor(String method,
I request,
MessageHeader requestHeader,
O response,
MessageHeader responseHeader,
H handler,
S sender)
Request executor creator
|
protected void |
doAddChannelDescriptorsForStreamingPeers(MessageBusDescriptor busDescriptor)
Invoked to add channel descriptors for streaming peers
|
protected void |
doAddChannelsForStreamingPeers(AepEngineDescriptor engineDescriptor)
Invoked to add channels for streaming peers
|
protected void |
doAddCommandHandlerContainers(Set<Object> containers)
Invoked to add command handler containers
|
protected void |
doAddEventHandlerContainers(Set<Object> containers)
Invoked to add event handler containers
|
protected abstract void |
doAddGuiceModules(Set<com.google.inject.AbstractModule> modules)
Invoked to add service specific guice modules during initialization
|
protected void |
doFinalize()
Invoked to do service specific finalize
|
protected abstract String |
doGetMainClassName()
Invoked to get the name of the main app class
|
protected abstract Map<String,AbstractClient> |
doGetPeerAsyncClients()
Invoked to get the names and clients of the peer apps
|
protected abstract List<AbstractClient> |
doGetPeerClients()
Invoked to get the clients of the peer apps
|
protected void |
doInitialize()
Invoked to do service specific initialization
|
protected abstract void |
doRegisterFactories()
Invoked to register service specific factories
|
void |
finalize()
App finalizer
|
int |
getThreadPoolCapacity()
Thread pool capacity gauge stat reporter
|
int |
getThreadPoolUsed()
Thread pool used gauge stat reporter
|
protected Tracer |
heartbeatTracer() |
void |
initialize()
Initalize the application
|
protected abstract boolean |
joinChannel(String channelName)
Invoked to check if engine should join the specified channel
|
protected static String |
localizeAppName(String env,
String str) |
String |
messageStats(String command,
String[] args)
Message type stats command handler
|
protected Tracer |
messageTracer()
Return the message tracer
|
protected void |
onActivated()
Invoked to notify that the app has activated (become primary)
|
void |
onAlert(AlertRequest request) |
void |
onAlertsChannelDown(AepChannelDownEvent event) |
void |
onAlertsChannelUp(AepChannelUpEvent event) |
void |
onEngineStarted(AepEngineStartedEvent event) |
void |
onEngineStopped(AepEngineStoppedEvent event) |
void |
onEventsChannelDown(AepChannelDownEvent event) |
void |
onEventsChannelUp(AepChannelUpEvent event) |
void |
onFirstMessage(FirstRequest request) |
void |
onHeartbeat(HeartbeatRequest request) |
void |
onHeartbeatsChannelDown(AepChannelDownEvent event) |
void |
onHeartbeatsChannelUp(AepChannelUpEvent event) |
void |
onLogout(LogoutRequest request) |
protected void |
onMessageProcessingComplete(MessageView message)
Invoked on completion of message handler
|
protected void |
onMessageProcessingStart(MessageView message)
Invoked on invocation of message handler
|
protected void |
onMessageSchedule(MessageView message)
Invoked when a message is scheduled for inbound dispatch
|
protected void |
onMessageSend(MessageView message,
boolean response)
Invoked when a message is sent outbound
|
void |
onMessagingPrestart(AepMessagingPrestartEvent event) |
protected void |
onMessagingStarted()
Invoked after messaging is successfully started
|
void |
onMessagingStarted(AepMessagingStartedEvent event) |
void |
onNull(NullMessage message) |
void |
onPing(PingRequest request) |
void |
onPostMessageProcessingTimes(PostMessageProcessingTimesRequest request) |
void |
onRequestsChannelDown(AepChannelDownEvent event) |
void |
onRequestsChannelUp(AepChannelUpEvent event) |
void |
onResponsesChannelDown(AepChannelDownEvent event) |
void |
onResponsesChannelUp(AepChannelUpEvent event) |
protected void |
onStarted()
Invoked to notify that the app has started
|
protected void |
onStopped(Throwable cause)
Invoked to notify that the app has stopped
|
protected void |
onSubmitForRemoteExecution(MessageView message)
Invoked prior to submitting a request to a separate thread for remote
execution
|
void |
prepEngineDescriptor(AepEngineDescriptor engineDescriptor)
App engine descriptor injector
|
String |
resetStats(String command,
String[] args)
Stats reset command handler
|
String |
scheduleAlertLogCompaction(String command,
String[] args)
Schedule compaction (on next write) on the alert log
|
String |
scheduleMpsLogCompaction(String command,
String[] args)
Schedule compaction (on next write) on the mps log
|
String |
setAlertLogCompactionThreshold(String command,
String[] args)
Set alert log compaction threshold
|
void |
setAppEngine(AepEngine engine)
App engine injector
|
void |
setAppLoader(SrvAppLoader loader)
App loader injector
|
String |
setMpsLogCompactionThreshold(String command,
String[] args)
Set mps log compaction threshold
|
void |
start()
Start the embedded server
|
String |
startAlertLogging(String command,
String[] args)
Start alert logging
|
String |
startMpsLogging(String command,
String[] args)
Start message processing time logging
|
void |
stop()
Stop the embedded server
|
String |
stopAlertLogging(String command,
String[] args)
Stop alert logging
|
String |
stopMpsLogging(String command,
String[] args)
Stop message processing time logging
|
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBindingprotected AepEngine _engine
protected MessageChannel _eventsChannel
protected MessageChannel _responsesChannel
protected MessageChannel _heartbeatsChannel
protected MessageChannel _alertsChannel
protected Properties _krt
protected ExecutorService _requestExecutor
protected ScheduledThreadPoolExecutor _heartbeatExecutor
protected com.google.inject.Injector _injector
@Inject protected Tracer _tracer
@Inject protected IMessageTracer _messageTracer
@Inject protected IHeartbeatTracer _heartbeatTracer
@Inject protected Alerter _alerter
@Inject protected MessageProcessingStatsCollector _messageProcessingStatsCollector
protected final Tracer TRACER
protected final IMessageTracer MESSAGE_TRACER
protected final IHeartbeatTracer HEARTBEAT_TRACER
protected final IMessageProcessingStatsTracer MSGPROCSTATS_TRACER
protected final IAlertTracer ALERT_TRACER
protected final ICdcTracer MAIN_CDC_TRACER
protected final ICdcTracer MPS_CDC_TRACER
protected final ICdcTracer ALERT_CDC_TRACER
protected final IDbTracer MAIN_DB_TRACER
protected final IDbTracer MPS_DB_TRACER
protected final IDbTracer ALERT_DB_TRACER
public static final String REQUEST_CHANNEL_NAME
public static final String RESPONSE_CHANNEL_NAME
public static final String HEARTBEAT_CHANNEL_NAME
public static final String ALERT_CHANNEL_NAME
public static final String EVENT_CHANNEL_NAME
public static final String LOOPBACK_URL
protected final Tracer heartbeatTracer()
protected final Tracer messageTracer()
protected final void addAppGuiceModule(String moduleClassName, Set<com.google.inject.AbstractModule> modules)
protected abstract String doGetMainClassName()
protected abstract Map<String,AbstractClient> doGetPeerAsyncClients()
protected abstract List<AbstractClient> doGetPeerClients()
protected void doAddChannelDescriptorsForStreamingPeers(MessageBusDescriptor busDescriptor)
protected abstract boolean joinChannel(String channelName)
protected void doAddChannelsForStreamingPeers(AepEngineDescriptor engineDescriptor) throws Exception
Exceptionprotected abstract void doAddGuiceModules(Set<com.google.inject.AbstractModule> modules)
protected abstract void doRegisterFactories()
protected void doAddEventHandlerContainers(Set<Object> containers)
protected void doAddCommandHandlerContainers(Set<Object> containers)
protected void doInitialize()
protected void onStarted()
protected void onActivated()
throws Exception
Exception - An exception thrown by this method will result
in the app being stopped.
Note: This event is dispatched before the first message is scheduled with the underlying engine and before messaging is started.
protected void onMessagingStarted()
protected void onSubmitForRemoteExecution(MessageView message)
protected void onMessageProcessingStart(MessageView message)
protected void onMessageProcessingComplete(MessageView message)
protected void onMessageSend(MessageView message, boolean response)
protected void onMessageSchedule(MessageView message)
protected void onStopped(Throwable cause)
protected void doFinalize()
protected void configure()
configure in class com.google.inject.AbstractModuleprotected final <I extends IRogMessage & IRogCopyableNode,O extends IRogMessage,H extends MessageHandler<I,O,R>,S extends MessageSender<O>> AbstractApp.RequestExecutor<I,O,H,S> createRequestExecutor(String method, I request, MessageHeader requestHeader, O response, MessageHeader responseHeader, H handler, S sender)
public final int getThreadPoolCapacity()
public final int getThreadPoolUsed()
public final void setAppLoader(SrvAppLoader loader) throws Exception
Exceptionpublic final void addCommandHandlerContainer(Set<Object> containers) throws Exception
Exceptionpublic final void addEventHandlerContainer(Set<Object> containers) throws Exception
Exceptionpublic final void prepEngineDescriptor(AepEngineDescriptor engineDescriptor) throws Exception
Exceptionpublic final void setAppEngine(AepEngine engine) throws Exception
Exceptionpublic final void initialize()
throws Exception
Exceptionpublic final String startMpsLogging(String command, String[] args) throws Exception
Exceptionpublic final String scheduleMpsLogCompaction(String command, String[] args) throws Exception
Exceptionpublic final String setMpsLogCompactionThreshold(String command, String[] args) throws Exception
Exceptionpublic final String stopMpsLogging(String command, String[] args) throws Exception
Exceptionpublic final String messageStats(String command, String[] args) throws Exception
Exceptionpublic final String resetStats(String command, String[] args) throws Exception
Exceptionpublic final String startAlertLogging(String command, String[] args) throws Exception
Exceptionpublic final String scheduleAlertLogCompaction(String command, String[] args) throws Exception
Exceptionpublic final String setAlertLogCompactionThreshold(String command, String[] args) throws Exception
Exceptionpublic final String stopAlertLogging(String command, String[] args) throws Exception
Exceptionpublic final void onEngineStarted(AepEngineStartedEvent event)
public final void onMessagingPrestart(AepMessagingPrestartEvent event)
public final void onMessagingStarted(AepMessagingStartedEvent event)
public final void onRequestsChannelUp(AepChannelUpEvent event)
public final void onRequestsChannelDown(AepChannelDownEvent event)
public final void onResponsesChannelUp(AepChannelUpEvent event)
public final void onResponsesChannelDown(AepChannelDownEvent event)
public final void onEventsChannelUp(AepChannelUpEvent event)
public final void onEventsChannelDown(AepChannelDownEvent event)
public final void onHeartbeatsChannelUp(AepChannelUpEvent event)
public final void onHeartbeatsChannelDown(AepChannelDownEvent event)
public final void onAlertsChannelUp(AepChannelUpEvent event)
public final void onAlertsChannelDown(AepChannelDownEvent event)
public final void onNull(NullMessage message)
public final void onFirstMessage(FirstRequest request)
public final void onPing(PingRequest request)
public final void onHeartbeat(HeartbeatRequest request)
public final void onAlert(AlertRequest request)
public final void onPostMessageProcessingTimes(PostMessageProcessingTimesRequest request)
public final void onLogout(LogoutRequest request)
public final void onEngineStopped(AepEngineStoppedEvent event)
public final void start()
throws Exception
EmbeddedServerControllerstart in interface EmbeddedServerControllerExceptionpublic final void stop()
EmbeddedServerControllerstop in interface EmbeddedServerControllerCopyright © 2016 Neeve Research, LLC. All Rights Reserved.