KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > epayment > processor > PaymentProcessorConfigurator


1 package epayment.processor;
2
3 import epayment.framework.IGatewayAdapter;
4
5 /**
6  * The <code>PaymentProcessorConfigurator</code> class
7  * is responsible for configuring the run-time
8  * environment of the <code>PaymentProcessor</code>.
9  * <p>
10  * This class is strictly an example.
11  *
12  * @author <a HREF="mailto:mike@clarkware.com">Mike Clark</a>
13  * @author <a HREF="http://www.clarkware.com">Clarkware Consulting</a>
14  */

15
16 public class PaymentProcessorConfigurator {
17
18     /**
19      * Constructs a <code>PaymentProcessorConfigurator</code>.
20      */

21     public PaymentProcessorConfigurator() {
22     }
23     
24     /**
25      * Configures the specified payment processor.
26      *
27      * @param processor Payment processor to configure.
28      * @throws IOException If a configuration error occurred.
29      */

30     public void configure(PaymentProcessor processor) {
31             
32         //
33
// Production applications should use a dynamic
34
// configuration mechanism with an adapter factory
35
// to construct the appropriate adapter.
36
//
37
IGatewayAdapter adapter = null;
38         
39         /*
40         adapter = makeAdapter("XYZGatewayAdapter");
41         adapter.setHost(someHostName);
42         */

43         
44         processor.setGatewayAdapter(adapter);
45     }
46 }
47
Popular Tags