com.ibm.commerce.payments.plugin

Class TimeoutException

  • All Implemented Interfaces:
    java.io.Serializable


    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.

    See Also:
    Serialized Form
    • Constructor Detail

      • TimeoutException

        public TimeoutException()

        This method is the default constructor.

      • TimeoutException

        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.

        Parameters:
        resourceBundleName - The name of the resource bundle to be used to generate a localized exception message
        messageKey - The key to identify the resource to generate a localized exception
        formatArguments - An array of arguments to build the localized message
        defaultText - The message that is shown if the localized message cannot be generated
      • TimeoutException

        public 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.

        Parameters:
        resourceBundleName - The name of the resource bundle to be used to generate a localized exception message
        messageKey - The key to identify the resource to generate a localized exception
        formatArguments - An array of arguments to build the localized message
        defaultText - The message that is shown if the localized message cannot be generated
        exception - The exception to be chained
      • TimeoutException

        public TimeoutException(java.lang.Throwable exception)

        This method constructor with a chained exception.

        Parameters:
        exception - The exception to be chained