public class TimeoutException extends PluginException
This Exception is thrown if a plug-in times out waiting for a response.
To avoid resource contention a plug-in should not block a request for long periods of time. Whenever possible, a plug-in should throw TimeOutException when a configurable amount of time has elapsed.
For example, during an approve() request, a plug-in could wait for at most 45 seconds. After that, since if the plug-in hasn't received a response from the back end (payment service provider), it will throw a TimeOutException.
Note that the plug-in should make the waiting period a configurable property in the plug-in deployment descriptor. What may be a short period for some applications, may be a long period for others.
Since plug-ins are stateless session beans (SSB
) (and as such are not supposed
to spawn their own background threads). Plug-ins may not be able to detect a
timeout by themselves. In these cases, the EJB transaction which contains the
plug-in request will be rolled back automatically by the EJB container according
to a pre-configurable timeout.
Constructor and Description |
---|
TimeoutException()
This method is the default constructor.
|
TimeoutException(java.lang.String resourceBundleName,
java.lang.String messageKey,
java.lang.Object[] formatArguments,
java.lang.String defaultText)
This method is a constructor with a localized message.
|
TimeoutException(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.
|
TimeoutException(java.lang.Throwable exception)
This method constructor with a chained exception.
|
getCredit, getFinancialTransaction, getPayment, getPaymentInstruction, setCredit, setFinancialTransaction, setPayment, setPaymentInstruction
addProperties, addProperties, addProperty, dumpException, getClassSource, getDefaultMessage, getFormatArguments, getLocalizedMessage, getLocalizedMessage, getMessage, getMessageKey, getMethodSource, getPreviousException, getProperties, getResourceBundleName, setClassSource, setDefaultMessage, setFormatArguments, setMessageKey, setMethodSource, setPreviousException, setProperties, setResourceBundleName
public TimeoutException()
This method is the default constructor.
public TimeoutException(java.lang.String resourceBundleName, java.lang.String messageKey, java.lang.Object[] formatArguments, java.lang.String defaultText)
This method is a 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 TimeoutException(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 TimeoutException(java.lang.Throwable exception)
This method constructor with a chained exception.
exception
- The exception to be chained