Java Doc for CciTemplate.java in  » J2EE » spring-framework-2.0.6 » org » springframework » jca » cci » core » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.jca.cci.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.jca.cci.core.CciTemplate

CciTemplate
public class CciTemplate implements CciOperations(Code)
This is the central class in the CCI core package. It simplifies the use of CCI and helps to avoid common errors. It executes core CCI workflow, leaving application code to provide parameters to CCI and extract results. This class executes EIS queries or updates, catching ResourceExceptions and translating them to the generic exception hierarchy defined in the org.springframework.dao package.

Code using this class can pass in and receive javax.resource.cci.Record instances, or alternatively implement callback interfaces for creating input Records and extracting result objects from output Records (or CCI ResultSets).

Can be used within a service implementation via direct instantiation with a ConnectionFactory reference, or get prepared in an application context and given to services as bean reference. Note: The ConnectionFactory should always be configured as a bean in the application context, in the first case given to the service directly, in the second case to the prepared template.
author:
   Thierry Templier
author:
   Juergen Hoeller
since:
   1.2
See Also:   RecordCreator
See Also:   RecordExtractor
See Also:   org.springframework.dao
See Also:   org.springframework.jca.cci.connection
See Also:   org.springframework.jca.cci.object




Constructor Summary
public  CciTemplate()
     Construct a new CciTemplate for bean usage.
public  CciTemplate(ConnectionFactory connectionFactory)
     Construct a new CciTemplate, given a ConnectionFactory to obtain Connections from.
public  CciTemplate(ConnectionFactory connectionFactory, ConnectionSpec connectionSpec)
     Construct a new CciTemplate, given a ConnectionFactory to obtain Connections from.

Method Summary
public  voidafterPropertiesSet()
    
public  IndexedRecordcreateIndexedRecord(String name)
     Create an indexed Record through the ConnectionFactory's RecordFactory.
public  MappedRecordcreateMappedRecord(String name)
     Create a mapped Record from the ConnectionFactory's RecordFactory.
protected  RecordcreateRecord(RecordCreator recordCreator)
     Invoke the given RecordCreator, converting JCA ResourceExceptions to Spring's DataAccessException hierarchy.
protected  ObjectdoExecute(InteractionSpec spec, Record inputRecord, Record outputRecord, RecordExtractor outputExtractor)
     Execute the specified interaction on an EIS with CCI.
public  Objectexecute(ConnectionCallback action)
    
public  Objectexecute(InteractionCallback action)
    
public  Recordexecute(InteractionSpec spec, Record inputRecord)
    
public  voidexecute(InteractionSpec spec, Record inputRecord, Record outputRecord)
    
public  Recordexecute(InteractionSpec spec, RecordCreator inputCreator)
    
public  Objectexecute(InteractionSpec spec, Record inputRecord, RecordExtractor outputExtractor)
    
public  Objectexecute(InteractionSpec spec, RecordCreator inputCreator, RecordExtractor outputExtractor)
    
public  ConnectionFactorygetConnectionFactory()
     Return the CCI ConnectionFactory used by this template.
public  ConnectionSpecgetConnectionSpec()
     Return the CCI ConnectionSpec used by this template, if any.
public  CciTemplategetDerivedTemplate(ConnectionSpec connectionSpec)
     Create a template derived from this template instance, inheriting the ConnectionFactory and other settings but overriding the ConnectionSpec used for obtaining Connections.
public  RecordCreatorgetOutputRecordCreator()
     Return a RecordCreator that should be used for creating default output Records.
protected  RecordFactorygetRecordFactory(ConnectionFactory connectionFactory)
     Return a RecordFactory for the given ConnectionFactory.
public  voidsetConnectionFactory(ConnectionFactory connectionFactory)
     Set the CCI ConnectionFactory to obtain Connections from.
public  voidsetConnectionSpec(ConnectionSpec connectionSpec)
     Set the CCI ConnectionSpec that this template instance is supposed to obtain Connections for.
public  voidsetOutputRecordCreator(RecordCreator creator)
     Set a RecordCreator that should be used for creating default output Records.


Constructor Detail
CciTemplate
public CciTemplate()(Code)
Construct a new CciTemplate for bean usage.

Note: The ConnectionFactory has to be set before using the instance.
See Also:   CciTemplate.setConnectionFactory




CciTemplate
public CciTemplate(ConnectionFactory connectionFactory)(Code)
Construct a new CciTemplate, given a ConnectionFactory to obtain Connections from. Note: This will trigger eager initialization of the exception translator.
Parameters:
  connectionFactory - JCA ConnectionFactory to obtain Connections from



CciTemplate
public CciTemplate(ConnectionFactory connectionFactory, ConnectionSpec connectionSpec)(Code)
Construct a new CciTemplate, given a ConnectionFactory to obtain Connections from. Note: This will trigger eager initialization of the exception translator.
Parameters:
  connectionFactory - JCA ConnectionFactory to obtain Connections from
Parameters:
  connectionSpec - the CCI ConnectionSpec to obtain Connections for(may be null)




Method Detail
afterPropertiesSet
public void afterPropertiesSet()(Code)



createIndexedRecord
public IndexedRecord createIndexedRecord(String name) throws DataAccessException(Code)
Create an indexed Record through the ConnectionFactory's RecordFactory.
Parameters:
  name - the name of the record the Record
throws:
  DataAccessException - if creation of the Record failed
See Also:   CciTemplate.getRecordFactory(javax.resource.cci.ConnectionFactory)
See Also:   javax.resource.cci.RecordFactory.createIndexedRecord(String)



createMappedRecord
public MappedRecord createMappedRecord(String name) throws DataAccessException(Code)
Create a mapped Record from the ConnectionFactory's RecordFactory.
Parameters:
  name - record name the Record
throws:
  DataAccessException - if creation of the Record failed
See Also:   CciTemplate.getRecordFactory(javax.resource.cci.ConnectionFactory)
See Also:   javax.resource.cci.RecordFactory.createMappedRecord(String)



createRecord
protected Record createRecord(RecordCreator recordCreator) throws DataAccessException(Code)
Invoke the given RecordCreator, converting JCA ResourceExceptions to Spring's DataAccessException hierarchy.
Parameters:
  recordCreator - the RecordCreator to invoke the created Record
throws:
  DataAccessException - if creation of the Record failed
See Also:   CciTemplate.getRecordFactory(javax.resource.cci.ConnectionFactory)
See Also:   RecordCreator.createRecord(javax.resource.cci.RecordFactory)



doExecute
protected Object doExecute(InteractionSpec spec, Record inputRecord, Record outputRecord, RecordExtractor outputExtractor) throws DataAccessException(Code)
Execute the specified interaction on an EIS with CCI. All other interaction execution methods go through this.
Parameters:
  spec - the CCI InteractionSpec instance that definesthe interaction (connector-specific)
Parameters:
  inputRecord - the input record
Parameters:
  outputRecord - output record (can be null)
Parameters:
  outputExtractor - object to convert the output record to a result object the output data extracted with the RecordExtractor object
throws:
  DataAccessException - if there is any problem



execute
public Object execute(ConnectionCallback action) throws DataAccessException(Code)



execute
public Object execute(InteractionCallback action) throws DataAccessException(Code)



execute
public Record execute(InteractionSpec spec, Record inputRecord) throws DataAccessException(Code)



execute
public void execute(InteractionSpec spec, Record inputRecord, Record outputRecord) throws DataAccessException(Code)



execute
public Record execute(InteractionSpec spec, RecordCreator inputCreator) throws DataAccessException(Code)



execute
public Object execute(InteractionSpec spec, Record inputRecord, RecordExtractor outputExtractor) throws DataAccessException(Code)



execute
public Object execute(InteractionSpec spec, RecordCreator inputCreator, RecordExtractor outputExtractor) throws DataAccessException(Code)



getConnectionFactory
public ConnectionFactory getConnectionFactory()(Code)
Return the CCI ConnectionFactory used by this template.



getConnectionSpec
public ConnectionSpec getConnectionSpec()(Code)
Return the CCI ConnectionSpec used by this template, if any.



getDerivedTemplate
public CciTemplate getDerivedTemplate(ConnectionSpec connectionSpec)(Code)
Create a template derived from this template instance, inheriting the ConnectionFactory and other settings but overriding the ConnectionSpec used for obtaining Connections.
Parameters:
  connectionSpec - the CCI ConnectionSpec that the derived templateinstance is supposed to obtain Connections for the derived template instance
See Also:   CciTemplate.setConnectionSpec



getOutputRecordCreator
public RecordCreator getOutputRecordCreator()(Code)
Return a RecordCreator that should be used for creating default output Records.



getRecordFactory
protected RecordFactory getRecordFactory(ConnectionFactory connectionFactory) throws ResourceException(Code)
Return a RecordFactory for the given ConnectionFactory.

Default implementation returns the connector's RecordFactory if available, falling back to a NotSupportedRecordFactory placeholder. This allows to invoke a RecordCreator callback with a non-null RecordFactory reference in any case.
Parameters:
  connectionFactory - the CCI ConnectionFactory the CCI RecordFactory for the ConnectionFactory
throws:
  ResourceException - if thrown by CCI methods
See Also:   org.springframework.jca.cci.connection.NotSupportedRecordFactory




setConnectionFactory
public void setConnectionFactory(ConnectionFactory connectionFactory)(Code)
Set the CCI ConnectionFactory to obtain Connections from.



setConnectionSpec
public void setConnectionSpec(ConnectionSpec connectionSpec)(Code)
Set the CCI ConnectionSpec that this template instance is supposed to obtain Connections for.



setOutputRecordCreator
public void setOutputRecordCreator(RecordCreator creator)(Code)
Set a RecordCreator that should be used for creating default output Records.

Default is none: When no explicit output Record gets passed into an execute method, CCI's Interaction.execute variant that returns an output Record will be called.

Specify a RecordCreator here if you always need to call CCI's Interaction.execute variant with a passed-in output Record. Unless there is an explicitly specified output Record, CciTemplate will then invoke this RecordCreator to create a default output Record instance.
See Also:   javax.resource.cci.Interaction.execute(javax.resource.cci.InteractionSpecRecord)
See Also:   javax.resource.cci.Interaction.execute(javax.resource.cci.InteractionSpecRecordRecord)




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.