|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.util.Carp
A convenience class for dying and generating error messages, complete with "carp" and "croak", borrowed from PERL.
Now extended to control a graceful shutdown. Calls to
dieGracefully
cause this class to detach a node from
the network. UNIX signals (TERM, INT, HUP) detach all virtual nodes.
Constructor Summary | |
---|---|
Carp()
|
Method Summary | |
---|---|
static void |
carp(String msg)
Print a message to standard error. |
static void |
carp(Throwable e)
Print an exception's message to standard error. |
static void |
croak()
Kill the whole jvm or throw a RuntimeException . |
static void |
croak(String msg)
Print a message to standard error and croak. |
static void |
croak(Throwable e)
Print an exception's message to standard error and croak. |
static void |
die()
Carp the current stack trace, then croak. |
static void |
die(String msg)
Carp a message and current stack trace, then croak. |
static void |
die(Throwable e)
Carp an exception's message and stack trace, then croak. |
static void |
dieGracefully(Throwable e,
NodeId node_id)
Dispatches an event to the DD stages of the specified virtual node telling them to disconnect the node from the overlay network. |
static void |
dumpStack()
Print out the stack trace of the current thread. |
static void |
error(String msg)
Print a message and current stack trace to standard error. |
static void |
error(Throwable e)
Print an exception's message and stack trace to standard error. |
static boolean |
getThrowException()
Returns the flag that controls whether croak and
die should throw a RuntimeException
(true ) or call System.exit
(false ). |
static void |
out(String msg)
Print a message to standard out. |
static void |
setThrowException(boolean throwException)
Sets the flag that controls whether croak and
die should throw a RuntimeException
(true ) or call System.exit
(false ). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Carp()
Method Detail |
public static void setThrowException(boolean throwException)
croak
and
die
should throw a RuntimeException
(true
) or call System.exit
(false
).
public static boolean getThrowException()
croak
and
die
should throw a RuntimeException
(true
) or call System.exit
(false
).
public static void dieGracefully(Throwable e, NodeId node_id)
If the _throwException
flag is false
, this
method just calls croak
.
public static void out(String msg)
public static void carp(String msg)
public static void carp(Throwable e)
public static void error(String msg)
public static void error(Throwable e)
public static void croak()
RuntimeException
.
public static void croak(String msg)
public static void croak(Throwable e)
public static void die()
public static void die(String msg)
public static void die(Throwable e)
public static void dumpStack()
Carp.dumpStack
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |