File: PaymentProcessorConfigurator.java

package info (click to toggle)
libjdepend-java 2.9-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 800 kB
  • ctags: 781
  • sloc: java: 3,873; xml: 549; sh: 6; makefile: 6
file content (46 lines) | stat: -rw-r--r-- 1,142 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package epayment.processor;

import epayment.framework.IGatewayAdapter;

/**
 * The <code>PaymentProcessorConfigurator</code> class
 * is responsible for configuring the run-time
 * environment of the <code>PaymentProcessor</code>.
 * <p>
 * This class is strictly an example.
 *
 * @author <a href="mailto:mike@clarkware.com">Mike Clark</a>
 * @author <a href="http://www.clarkware.com">Clarkware Consulting</a>
 */

public class PaymentProcessorConfigurator {

	/**
	 * Constructs a <code>PaymentProcessorConfigurator</code>.
	 */
	public PaymentProcessorConfigurator() {
	}
	
	/**
	 * Configures the specified payment processor.
	 *
	 * @param processor Payment processor to configure.
	 * @throws IOException If a configuration error occurred.
	 */
	public void configure(PaymentProcessor processor) {
			
		//
		// Production applications should use a dynamic 
		// configuration mechanism with an adapter factory
		// to construct the appropriate adapter.
		//
		IGatewayAdapter adapter = null;
		
		/*
		adapter = makeAdapter("XYZGatewayAdapter");
		adapter.setHost(someHostName);
		*/
		
		processor.setGatewayAdapter(adapter);
	}	
}