public abstract class AbstractService extends AbstractWaveReady<Service> implements Service, ServiceMessages
| Type | Property and Description |
|---|---|
ObservableMap<String,ServiceTask<?>> |
pendingTasks
Return The Pending tasks map.
|
| Modifier and Type | Field and Description |
|---|---|
private static JRLogger |
LOGGER
The class logger.
|
private ObservableMap<String,ServiceTask<?>> |
pendingTasks
The map that stores pending tasks, useful to access to Worker implementation.
|
private static String |
RATIO_SEPARATOR
The string used to separate the workdone and total work of a service task.
|
PROCESS_WAVE_METHOD_NAMECOUNT_LINES_ERROR, NO_RETURN_WAVE_CONSUMED, NO_RETURNED_WAVE_ITEM, NO_RETURNED_WAVE_TYPE_DEFINED, NO_WAVE_TYPE_DEFINED, SERVICE_TASK_ERROR, SERVICE_TASK_HAS_FAILED, SERVICE_TASK_RETURN_CONSUMESCALL_ANNOTATED_METHOD_ERROR, COMMAND_NOT_FOUND_ERROR, COMMAND_NOT_FOUND_MESSAGE, COMPONENT_INJECTION_FAILURE, CUSTOM_METHOD_NOT_FOUND, LISTEN_WAVE_TYPE, MODEL_NOT_FOUND_ERROR, MODEL_NOT_FOUND_MESSAGE, NO_WAVE_LISTENER, NOTIFIER_CONSUMES, SEND_WAVE, SERVICE_NOT_FOUND_ERROR, SERVICE_NOT_FOUND_MESSAGE, UNLISTEN_WAVE_TYPE, USE_DEFAULT_WAVE_HANDLER, WAVE_BEAN_CREATION_ERROR, WAVE_DISPATCH_ERROR, WAVE_HANDLING_ERROR, WAVE_LOST, WAVE_LOST_CONTEXT, WAVE_SENDING_ERROR| Constructor and Description |
|---|
AbstractService() |
| Modifier and Type | Method and Description |
|---|---|
private void |
bindMessage(ServiceTask<?> task,
StringProperty messageProperty)
Bind a task to a string property that will display the task message.
|
private void |
bindProgressBar(ServiceTask<?> task,
ProgressBar progressBar)
Bind a task to a progress bar widget to follow its progression.
|
private void |
bindTitle(ServiceTask<?> task,
StringProperty titleProperty)
Bind a task to a string property that will display the task title.
|
protected void |
finalize() |
ServiceTask<?> |
getPendingTask(String taskKey)
Retrieve a task from the pending list.
|
Collection<ServiceTask<?>> |
getPendingTaskList()
Get pending task list.
|
protected abstract void |
initService()
Custom method used to initialize the service.
|
ObservableMap<String,ServiceTask<?>> |
pendingTasksProperty()
Return The Pending tasks map.
|
void |
ready()
The component is now ready to do custom initialization tasks.
|
void |
removePendingTask(String taskKey)
Remove a task from the pending list.
|
<T> ServiceTask<T> |
returnData(Wave sourceWave)
Do a specific action by processing the wave.
|
private <T> ServiceTask<T> |
runTask(Wave sourceWave,
Method method,
Object[] parameterValues)
Run the wave type method.
|
void |
updateMessage(Wave wave,
String message)
Update the current message of the service task related to the given wave.
|
void |
updateProgress(Wave wave,
double workDone,
double totalWork)
Update the progress of the service task related to the given wave.
|
void |
updateProgress(Wave wave,
double workDone,
double totalWork,
double progressIncrement)
Update the progress of the service task related to the given wave.
|
void |
updateProgress(Wave wave,
long workDone,
long totalWork)
Update the progress of the service task related to the given wave.
|
void |
updateProgress(Wave wave,
long workDone,
long totalWork,
double progressIncrement)
Update the progress of the service task related to the given wave.
|
void |
updateTitle(Wave wave,
String title)
Update the current message of the service task related to the given wave.
|
attachUi, callCommand, callCommand, getReturnCommand, getReturnWaveType, listen, listen, listen, processWave, registerCallback, registerCallback, registerCallback, release, returnData, sendWave, sendWave, setup, unlistengetCommand, getFirstKeyPart, getKey, getListKeyPart, getLocalFacade, getModel, getSecondKeyPart, getService, getThirdKeyPart, setKey, setLocalFacadeclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetReturnCommand, getReturnWaveType, listen, listen, listen, registerCallback, registerCallback, registerCallback, sendWave, sendWave, unlistengetKey, getLocalFacade, release, setKey, setLocalFacade, setupattachUi, getModelgetService, returnDatacallCommand, callCommand, getCommandServiceTaskpendingTasksProperty in interface Serviceprivate static final String RATIO_SEPARATOR
private static final JRLogger LOGGER
private final ObservableMap<String,ServiceTask<?>> pendingTasks
public final void ready()
throws CoreException
ready in class AbstractWaveReady<Service>CoreException - if an error occurredprotected abstract void initService()
protected void finalize()
throws Throwable
public <T> ServiceTask<T> returnData(Wave sourceWave)
returnData in interface ServiceT - The type of the object to return must be compatible with the WaveType contract that call this servicesourceWave - the wave that hold all related dataprivate <T> ServiceTask<T> runTask(Wave sourceWave, Method method, Object[] parameterValues)
T - the type of the returned typesourceWave - the source waveparameterValues - values to pass to the methodmethod - method to callprivate void bindProgressBar(ServiceTask<?> task, ProgressBar progressBar)
task - the service task that we need to follow the progressionprogressBar - graphical progress barprivate void bindTitle(ServiceTask<?> task, StringProperty titleProperty)
task - the service task that we need to follow the progressiontitleProperty - the title presenterprivate void bindMessage(ServiceTask<?> task, StringProperty messageProperty)
task - the service task that we need to follow the progressionmessageProperty - the message presenterpublic ObservableMap<String,ServiceTask<?>> pendingTasksProperty()
ServiceTaskpendingTasksProperty in interface Servicepublic Collection<ServiceTask<?>> getPendingTaskList()
getPendingTaskList in interface Servicepublic void removePendingTask(String taskKey)
removePendingTask in interface ServicetaskKey - the key of the task, commonly the WaveUIDpublic ServiceTask<?> getPendingTask(String taskKey)
getPendingTask in interface ServicetaskKey - the key of the task, commonly the WaveUIDpublic void updateProgress(Wave wave, long workDone, long totalWork)
wave - the wave that trigger the service task callworkDone - the amount of overall work donetotalWork - the amount of total work to dopublic void updateProgress(Wave wave, long workDone, long totalWork, double progressIncrement)
wave - the wave that trigger the service task callworkDone - the amount of overall work donetotalWork - the amount of total work to doprogressIncrement - the value increment used to filter useless progress eventpublic void updateProgress(Wave wave, double workDone, double totalWork)
wave - the wave that trigger the service task callworkDone - the amount of overall work donetotalWork - the amount of total work to dopublic void updateProgress(Wave wave, double workDone, double totalWork, double progressIncrement)
wave - the wave that trigger the service task callworkDone - the amount of overall work donetotalWork - the amount of total work to doprogressIncrement - the value increment used to filter useless progress eventpublic void updateMessage(Wave wave, String message)
wave - the wave that trigger the service task callmessage - the current message of the service task processedCopyright © 2011–2014 JRebirth OSS. All rights reserved.