KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > epayment > framework > AbstractPaymentCommand


1 package epayment.framework;
2
3 /**
4  * The <code>AbstractPaymentCommand</code> class provides
5  * the default behavior for the <code>IPaymentCommand</code>
6  * interface.
7  * <p>
8  * This class is strictly an example.
9  *
10  * @author <a HREF="mailto:mike@clarkware.com">Mike Clark</a>
11  * @author <a HREF="http://www.clarkware.com">Clarkware Consulting</a>
12  */

13  
14 public abstract class AbstractPaymentCommand implements IPaymentCommand {
15
16     private IPaymentRequest _request;
17     
18     /**
19      * Constructs an <code>AbstractPaymentCommand</code>
20      * instance.
21      */

22     public AbstractPaymentCommand(IPaymentRequest request) {
23         _request = request;
24     }
25     
26     /**
27      * Executes this command using the specified payment
28      * adapter and returns a payment response.
29      *
30      * @param adapter Payment adapter.
31      * @return response Payment response.
32      * @throws PaymentException If an error occurs.
33      */

34     public abstract IPaymentResponse execute(IGatewayAdapter adapter)
35         throws PaymentException;
36         
37     /**
38      * Returns the payment request.
39      *
40      * @return Payment request.
41      */

42     protected IPaymentRequest getPaymentRequest() {
43         return _request;
44     }
45 }
46
Popular Tags