public class PluginException extends BaseException
This class is the base exception for the plug-in exception hierarchy.
All of the specific plug-in exceptions extend this exception. Some exceptions, depending on the failed transaction, include the associated financial container objects. This allows the Payment Plug-in Controller to obtain additional data the plug-in intends to store on these containers.
For example, if a FinancialException
is thrown by a plug-in during the processing of the method
approve
, the plug-in should add the relevant information associated with
Payment
. It should include:
the reason code, the reference number, tracking ID. The plug-in might also need to record
additional extended data in the FinancialTransaction
. This information is extremely relevant and should allow the
Customer Support personnel to solve the failure situation.
If a plug-in throws an exception that extends directly from PluginException
,
the Payment Plug-in Controller will not persist any transactional data. It will roll back
any changes. Plug-in writers should use this feature with caution. Predefined exceptions
extending PluginException
are recommended instead.
In the predefined exceptions, the following exceptions will cause Payment Plug-in Controller to roll back any change in database:
CommunicationException
InternalErrorException
InvalidDataException
ConfigurationException
FunctionNotSupportedException
PluginException
InvalidPaymentInstructionException
:
Payment Plug-in Controller will set the FinancialTransaction
failed and set the PaymentInstruction
invalid.
FinancialException
:
Payment Plug-in Controller will set the FinancialTransaction
failed.
TimeoutException
:
Payment Plug-in Controller will set the FinancialTransaction
pending.
Plug-ins should not log exceptions since the Payment Plug-in Controller or other higher components will take care of the task. The exception and all its associated contextual information will be logged.
If there is any specific information that needs to be added to an exception, plug-ins
can add it through
addProperties(Map)
,
addProperties(Properties)
or
addProperty(String, Object)
.
Constructor and Description |
---|
PluginException()
This method is the default constructor.
|
PluginException(java.lang.String resourceBundleName,
java.lang.String messageKey,
java.lang.Object[] formatArguments,
java.lang.String defaultText)
This method is the constructor with a localized message.
|
PluginException(java.lang.String resourceBundleName,
java.lang.String messageKey,
java.lang.Object[] formatArguments,
java.lang.String defaultText,
java.lang.Throwable exception)
This method constructor with a localized message and a chained exception.
|
PluginException(java.lang.Throwable exception)
This method is the constructor with a chained exception.
|
Modifier and Type | Method and Description |
---|---|
Credit |
getCredit()
This method gets the
Credit container associated with the exception context. |
FinancialTransaction |
getFinancialTransaction()
This method gets the
FinancialTransaction container associated with the exception. |
Payment |
getPayment()
This method gets the
Payment container associated with the exception context. |
PaymentInstruction |
getPaymentInstruction()
This method gets the
PaymentInstruction container associated with the exception. |
void |
setCredit(Credit theCredit)
This method sets the
Credit container. |
void |
setFinancialTransaction(FinancialTransaction thePaymentTransaction)
This method sets the
PaymentTransaction container associated with the exception context. |
void |
setPayment(Payment thePayment)
This method sets the
Payment container associated with the exception context. |
void |
setPaymentInstruction(PaymentInstruction thePaymentInstruction)
This method sets the
PaymentInstruction container associated with the exception context. |
addProperties, addProperties, addProperty, dumpException, getClassSource, getDefaultMessage, getFormatArguments, getLocalizedMessage, getLocalizedMessage, getMessage, getMessageKey, getMethodSource, getPreviousException, getProperties, getResourceBundleName, setClassSource, setDefaultMessage, setFormatArguments, setMessageKey, setMethodSource, setPreviousException, setProperties, setResourceBundleName
public PluginException()
This method is the default constructor.
public PluginException(java.lang.String resourceBundleName, java.lang.String messageKey, java.lang.Object[] formatArguments, java.lang.String defaultText)
This method is the constructor with a localized message.
resourceBundleName
- The name of the resource bundle to be used to generate a localized
exception messagemessageKey
- The key to identify the resource to generate a localized exceptionformatArguments
- An array of arguments to build the localized messagedefaultText
- The message that is shown if the localized message cannot be generatedpublic PluginException(java.lang.String resourceBundleName, java.lang.String messageKey, java.lang.Object[] formatArguments, java.lang.String defaultText, java.lang.Throwable exception)
This method constructor with a localized message and a chained exception.
resourceBundleName
- The name of the resource bundle to be used to generate a localized
exception messagemessageKey
- The key to identify the resource to generate a localized exceptionformatArguments
- An array of arguments to build the localized messagedefaultText
- The message that is shown if the localized message cannot be generatedexception
- The exception to be chainedpublic PluginException(java.lang.Throwable exception)
This method is the constructor with a chained exception.
exception
- The exception to be chainedpublic void setCredit(Credit theCredit)
Credit
container.theCredit
- Credit
container to be setpublic Credit getCredit()
This method gets the Credit
container associated with the exception context.
The Credit
container might not be present.
Credit
container if any;
null
if no Credit
container is associated with the
exceptionpublic void setPayment(Payment thePayment)
Payment
container associated with the exception context.thePayment
- The Payment
container to be setpublic Payment getPayment()
This method gets the Payment
container associated with the exception context.
The Payment
container might not be present.
Payment
container if any;
null
if no Payment
container is associated with the
exceptionpublic void setPaymentInstruction(PaymentInstruction thePaymentInstruction)
PaymentInstruction
container associated with the exception context.thePaymentInstruction
- The PaymentInstruction
container to setpublic PaymentInstruction getPaymentInstruction()
PaymentInstruction
container associated with the exception.
The PaymentInstruction
container might not be present.
PaymentInstruction
container if any;
null
if no PaymentInstruction
container is associated
to the exceptionpublic void setFinancialTransaction(FinancialTransaction thePaymentTransaction)
PaymentTransaction
container associated with the exception context.thePaymentTransaction
- The PaymentTransaction
container to be setpublic FinancialTransaction getFinancialTransaction()
FinancialTransaction
container associated with the exception.
The FinancialTransaction
container might not be present.
FinancialTransaction
container if any;
null
if no FinancialTransaction
container is associated
to the exception