Line | |
---|
1 | package gov.va.med.edp.vistalink;
|
---|
2 |
|
---|
3 | import org.springframework.dao.DataAccessResourceFailureException;
|
---|
4 |
|
---|
5 | import javax.resource.cci.ConnectionFactory;
|
---|
6 | import java.util.HashMap;
|
---|
7 | import java.util.Map;
|
---|
8 |
|
---|
9 | import gov.va.med.edp.vistalink.ConnectionFactoryLocator;
|
---|
10 |
|
---|
11 | public class MockConnectionFactoryLocator extends HashMap implements ConnectionFactoryLocator, Map {
|
---|
12 | public ConnectionFactory getConnectionFactory(String stationNumber) throws DataAccessResourceFailureException {
|
---|
13 | ConnectionFactory connectionFactory = (ConnectionFactory) get(stationNumber) ;
|
---|
14 | if (connectionFactory == null) throw new DataAccessResourceFailureException("unable to locate connection factory for station number " + stationNumber);
|
---|
15 | return connectionFactory;
|
---|
16 | }
|
---|
17 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.