implements RecoveryListener
{
/** {@inheritDoc} */
public void recover(final Node node, SimpleCompletionHandler handler) {
final long nodeId = node.getId();
final TaskService taskService = getTaskService();
try {
if (logger.isLoggable(Level.INFO)) {
logger.log(Level.INFO, "Node:{0} recovering for node:{1}",
localNodeId, nodeId);
}
/*
* Schedule persistent tasks to perform recovery.
*/
transactionScheduler.runTask(
new AbstractKernelRunnable("ScheduleRecoveryTasks") {
public void run() {
/*
* For each session on the failed node, notify
* the session's ClientSessionListener and
* clean up the session's persistent data and
* bindings.
*/
taskService.scheduleTask(
new HandleNextDisconnectedSessionTask(nodeId));
/*
* Remove client session server proxy and
* associated binding for failed node, as
* well as protocol descriptors for the
* failed node.
*/
taskService.scheduleTask(
new RemoveNodeSpecificDataTask(nodeId));
} },
taskOwner);
handler.completed();