|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CommonThrowable
An interface common to exceptions in projects that depend on Java-Common.
This is an interface because it can be implemented by both checked
exceptions (extending java.lang.Exception
) and unchecked
exceptions (extending java.lang.RuntimeException
), although
the later use will probably be not so common. Methods of this interface
provide additional information, besides that already contained in Java
exceptions (such as message, stack trace elements), that can be used to
describe the exception, turn it into a log, or submit it to the support
center. By defining a help ID the exceptions can be tied to JavaHelp system
as well.
Throwable
Method Summary | |
---|---|
void |
caughtIn(java.lang.Object instance,
java.lang.String method)
Call this method if the exception is caught. |
javax.swing.Action[] |
getActions()
Returns a list of suggested actions that can be added to the GUI. |
java.lang.String |
getCaughtIn()
When additional info about the exception is provided via caughtIn(Object, String) method, this method should be
called to obtain the name of the method that caught the exception
together with the name of its declaring class. |
java.lang.String |
getHelpID()
Returns the help identifier for this exception. |
java.lang.String |
getHost()
Return the host this exception was generated on, if the JVM has access to such data. |
java.lang.Object |
getInstance()
Return the data about the instance which raised the exception. |
java.lang.String |
getMessage()
Returns the message carried by exception implementing this interface. |
java.lang.Throwable |
getParent()
Return the parent exception that caused this exception to be thrown. |
java.lang.Thread |
getThread()
Returns the thread of execution in which the constructor of this exception was invoked. |
long |
getTimestamp()
Returns the timestamp of the instantiation of this exception. |
java.lang.String |
getUsername()
Returns the currently logged in user. |
java.lang.Object |
getValue(java.lang.String key)
Returns the value stored under a given key in the map of values. |
java.util.Map |
getValues()
Returns a map that can hold any key-value pairs that contain internal state of the system or specifically the Identifiable
instance raising this exception. |
void |
putValue(java.lang.String key,
java.lang.Object value)
Sets a value with a given key in the map of values. |
Method Detail |
---|
void caughtIn(java.lang.Object instance, java.lang.String method)
method
- method name without parenthesis of prefixed class namejava.lang.String getHelpID()
java.lang.String getUsername()
java.lang.String getHost()
java.lang.Object getInstance()
Identifiable
interface, it should return the
Identifiable
of its logically most "proximate"
Identifiable
instance. Note that while instances of
CoreException
must provide at least the proximate
Identifiable
, instances of AssertionFailed
may return null
in this method.
java.lang.String getCaughtIn()
caughtIn(Object, String)
method, this method should be
called to obtain the name of the method that caught the exception
together with the name of its declaring class. May return
null
, if this information is not available.
java.lang.String getMessage()
java.lang.Throwable getParent()
java.lang.Thread getThread()
long getTimestamp()
System.currentTimeMillis()
.
java.util.Map getValues()
Identifiable
instance raising this exception. Such data may help in debugging.
void putValue(java.lang.String key, java.lang.Object value)
key
- the key under which the value will be stored in the mapvalue
- the value to storejava.lang.Object getValue(java.lang.String key)
key
- the key to look up
null
if no value is
stored under this keyjavax.swing.Action[] getActions()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |