public class TimeoutGuard extends Object
Modifier and Type | Field and Description |
---|---|
protected org.apache.logging.log4j.Logger |
log |
Constructor and Description |
---|
TimeoutGuard(int timeout,
String description)
Create a new TimeoutGuard and activate immediately
|
TimeoutGuard(String description)
Create a new TimeoutGuard
|
Modifier and Type | Method and Description |
---|---|
protected void |
abort()
Implement this method to stop the process and cleanup the resources you are 'guarding'.
|
void |
activateGuard(int timeout)
Sets and activates the timeout
|
boolean |
cancel()
Cancels timer, and returns true if thread has been killed by this guard or interrupted by another.
|
String |
getDescription() |
void |
setDescription(String string) |
boolean |
threadKilled() |
public TimeoutGuard(String description)
description
- name of the guardpublic TimeoutGuard(int timeout, String description)
timeout
- in secondsdescription
- name of the guardpublic void activateGuard(int timeout)
timeout
- in secondspublic boolean cancel()
protected void abort()
public String getDescription()
public void setDescription(String string)
public boolean threadKilled()
Copyright © 2023 Frank!Framework. All rights reserved.