public final class ProcessorServiceAppImpl extends MetadataServiceAppImpl implements ServiceThread.Target, Processor
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAME
Default processor name.
|
static ClassDef |
DEFAULT_RECEPTIONIST_CLASS_DEF
Default receptionist class.
|
static String |
NAME_PROPERTY
Name property.
|
static String |
PROCESSOR_PROPERTIES
Processor properties.
|
static String |
RECEPTIONIST_CLASS_PROPERTY
Used to specify an alternative to the SOM receptionist.
|
SERVICE_APP_PROPERTIES
Constructor and Description |
---|
ProcessorServiceAppImpl() |
Modifier and Type | Method and Description |
---|---|
ServiceStats |
createStats(StatsOwner statsOwner)
Creates a stats instance.
|
Optional<String> |
getEntityName()
Gets the entity name.
|
boolean |
onNewMetadata(Metadata metadata)
Called on new metadata.
|
void |
onServicesNotReady()
Called when some services are not ready.
|
Optional<Collection<PointValue>> |
process(Collection<PointValue> pointValues)
Processes point values.
|
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
fail, getConfig, getConfigProperties, getDataDir, getJoinTimeout, getProperties, getSourceUUID, getThisLogger, getTimer, onAlert, onEvent, onServiceNotAvailableException, onServicesReady, onSignal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onAlert, onEvent, onServicesReady, onSignal
public static final String DEFAULT_NAME
public static final String NAME_PROPERTY
public static final String PROCESSOR_PROPERTIES
public static final ClassDef DEFAULT_RECEPTIONIST_CLASS_DEF
public static final String RECEPTIONIST_CLASS_PROPERTY
public ServiceStats createStats(StatsOwner statsOwner)
createStats
in interface ServiceApp
createStats
in class ServiceAppImpl
statsOwner
- The stats owner.public Optional<String> getEntityName()
getEntityName
in interface MetadataServiceApp
getEntityName
in class MetadataServiceAppImpl
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 Optional<Collection<PointValue>> process(Collection<PointValue> pointValues) throws InterruptedException, ServiceNotAvailableException
process
in interface Processor
pointValues
- The input point values.InterruptedException
- When the service is stopped.ServiceNotAvailableException
- When the service is not available.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.