public final class ClockServiceAppImpl extends MetadataServiceAppImpl implements ServiceThread.Target
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAME
Name of the default 'Origin'.
|
static String |
GENERATED_TRACES
Traces subdirectory.
|
static String |
MIDNIGHT_ENABLED_PROPERTY
Enables the generation of 'Midnight' events.
|
static String |
NAME_PROPERTY
Identifies the 'Origin' entry in the Metadata associated with the
service instance.
|
SERVICE_APP_PROPERTIES
Constructor and Description |
---|
ClockServiceAppImpl() |
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getEntityName()
Gets the entity name.
|
boolean |
onEvent(Event event)
Called when a event has been received.
|
boolean |
onNewMetadata(Metadata metadata)
Called on new metadata.
|
void |
onServicesNotReady()
Called when some services are not ready.
|
void |
run()
Runs.
|
boolean |
setUp(MetadataService service)
Sets up the application.
|
void |
start()
Starts the application.
|
void |
stop()
Stops the application.
|
void |
tearDown()
Tears down the application.
|
getMetadata, getService, loadMetadata, setUp
createStats, fail, getConfig, getConfigProperties, getDataDir, getJoinTimeout, getProperties, getSourceUUID, getThisLogger, getTimer, onAlert, onServiceNotAvailableException, onServicesReady, onSignal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createStats, onAlert, onServicesReady, onSignal
public static final String DEFAULT_NAME
public static final String GENERATED_TRACES
public static final String MIDNIGHT_ENABLED_PROPERTY
public static final String NAME_PROPERTY
public Optional<String> getEntityName()
getEntityName
in interface MetadataServiceApp
getEntityName
in class MetadataServiceAppImpl
public boolean onEvent(Event event)
Caution: this is called while synchronized on the service.
onEvent
in interface ServiceApp
onEvent
in class ServiceAppImpl
event
- The event.public boolean onNewMetadata(Metadata metadata)
Overidden as needed.
Called by the framework and by overriding classes at the end of the override.
onNewMetadata
in interface MetadataServiceApp
onNewMetadata
in class MetadataServiceAppImpl
metadata
- The new metadata.public void onServicesNotReady()
This is called by the pending actions processing when it not known if all registered services are ready. This may be used by a service thread to trigger some state refresh when the pending actions processing is completed; at that time, all the registered services will be ready.
onServicesNotReady
in interface ServiceApp
onServicesNotReady
in class ServiceAppImpl
public void run() throws InterruptedException
Similar to same in Runnable but may throw exceptions.
run
in interface ServiceThread.Target
InterruptedException
public boolean setUp(MetadataService service)
Overidden as needed.
Called by the framework and by overriding classes at the beginning of the override.
setUp
in interface MetadataServiceApp
setUp
in class MetadataServiceAppImpl
service
- The service holding this application.public void start()
Overidden as needed by the application.
Called by the framework.
Should return only when the application is started.
start
in interface ServiceApp
start
in class ServiceAppImpl
public void stop()
Overidden as needed by the application.
Called by the framework.
stop
in interface ServiceApp
stop
in class ServiceAppImpl
public void tearDown()
Overidden as needed by the application.
Called by the framework and by overriding classes at the end of the override.
tearDown
in interface ServiceApp
tearDown
in class ServiceAppImpl
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.