View Javadoc

1   package com.github.smokestack.jca.cci;
2   
3   import javax.resource.ResourceException;
4   import javax.resource.cci.IndexedRecord;
5   import javax.resource.cci.MappedRecord;
6   import javax.resource.cci.RecordFactory;
7   
8   import org.apache.commons.lang.builder.ReflectionToStringBuilder;
9   import org.apache.commons.lang.builder.ToStringStyle;
10  
11  import com.github.smokestack.exception.NeedsMockDefinitionException;
12  
13  public class MockRecordFactory implements RecordFactory {
14  
15  	public MockRecordFactory() {
16  	}
17  
18  	/* (non-Javadoc)
19  	 * @see javax.resource.cci.RecordFactory#createIndexedRecord(java.lang.String)
20  	 */
21  	public IndexedRecord createIndexedRecord(String recordName) throws ResourceException {
22  		return _createIndexedRecord(recordName);
23  	}
24  
25  	public IndexedRecord _createIndexedRecord(String recordName) throws ResourceException {
26  		throw new NeedsMockDefinitionException();
27  	}
28  
29  	/* (non-Javadoc)
30  	 * @see javax.resource.cci.RecordFactory#createMappedRecord(java.lang.String)
31  	 */
32  	public MappedRecord createMappedRecord(String recordName) throws ResourceException {
33  		return _createMappedRecord(recordName);
34  	}
35  
36  	public MappedRecord _createMappedRecord(String recordName) throws ResourceException {
37  		throw new NeedsMockDefinitionException();
38  	}
39  
40  	@Override
41  	public String toString(){
42  		return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
43  	}
44  }