|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--com.ibm.mqe.MQeException
Describes an exceptional circumstance which has occurred within MQe code.
This class is used to create an MQeException object.
This class is a descendant of MQe
class.
There are five forms of Constructors.
Note : The value of the codeValue parameter should be one of the constants defined in MQe class.
For example : MQeExcept_NotFound.
Field Summary |
Constructor Summary | |
MQeException()
Creates an object that has the codeValue of 0 and does not have an error message. |
|
MQeException(int codeValue)
Creates an object that has a codeValue and does not have an error message. |
|
MQeException(int codeValue,
java.lang.String msg)
Creates an object that has a codeValue and an error message. |
|
MQeException(int codeValue,
java.lang.String msg,
java.lang.String data)
Creates an object that has a codeValue, an error message and keyword data. |
|
MQeException(java.lang.String msg)
Creates an object with an error message alone. |
Method Summary | |
int |
code()
Extracts the code value of the MQeException, the value that was set when the exception was created. |
java.lang.String |
toString()
Over-rides the superclass toString() to add (code=xxx) information at the end of the string. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MQeException()
Creates an object that has the codeValue of 0 and does not have an error message.
public MQeException(int codeValue)
Creates an object that has a codeValue and does not have an error message.
codeValue
- Integer value, normally one of the MQe.Except_... constants.
None
public MQeException(int codeValue, java.lang.String msg)
Creates an object that has a codeValue and an error message.
codeValue
- Integer value, normally one of the MQe.Except_... constants.msg
- String associated with the exception.
None
if (data == null) throw new MQeException(MQe.Except_Data, "Data missing");
public MQeException(int codeValue, java.lang.String msg, java.lang.String data)
Creates an object that has a codeValue, an error message and keyword data. The Exception will be generated containing this keyword, which can be searched for, by calling keyword( String keywrd, String defalut) method.
codeValue
- Integer value, normally one of the MQe.Except_... constants.msg
- String associated with the exception.data
- Keyword data to be included in exception.public MQeException(java.lang.String msg)
Creates an object with an error message alone.
msg
- String associated with the exception.Method Detail |
public java.lang.String toString()
toString
in class java.lang.Throwable
public int code()
Extracts the code value of the MQeException, the value that was set when the exception was created.
try {// The Try Block code. } catch (Exception e) { if (e instanceof com.ibm.mqe.MQeException) switch (((MQeException) e).code()) { case MQe.Except_Data: System.err.println("Data format error"); break; case MQe.Except_NotFound: System.err.println("Data not specified"); break; } else System.err.println("Error:" + e.toString()); }
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |