Skip to content

Instantly share code, notes, and snippets.

@alalwww
Last active December 29, 2015 15:49
Show Gist options
  • Save alalwww/7693440 to your computer and use it in GitHub Desktop.
Save alalwww/7693440 to your computer and use it in GitHub Desktop.
抽象化
public abstract class AbstractShachiku implements Runnable
{
protected asbtract void work();
@Override
public final void run()
{
syukkin();
}
private final void syukkin()
{
try
{
work();
}
catch(RuntimeException ignore)
{
run();
}
kitaku();
}
private final void kitaku()
{
Thread.sleep(4 * 60 * 60 * 1000);
syukkin();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment