01: package epayment.processor;
02:
03: import epayment.framework.IGatewayAdapter;
04:
05: /**
06: * The <code>PaymentProcessorConfigurator</code> class
07: * is responsible for configuring the run-time
08: * environment of the <code>PaymentProcessor</code>.
09: * <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: }
|