added language element to programlisting for syntax highlighting

This commit is contained in:
Thomas Risberg
2009-04-13 15:04:07 +00:00
parent 077d7f4bce
commit 38e5deefda
13 changed files with 271 additions and 270 deletions

View File

@@ -94,7 +94,7 @@
<para>In a managed mode, you access a <interfacename>ConnectionFactory</interfacename>
from JNDI; its properties will be configured in the application server.</para>
<programlisting><![CDATA[<bean id="eciConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<programlisting language="xml"><![CDATA[<bean id="eciConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="eis/cicseci"/>
</bean>]]></programlisting>
@@ -105,7 +105,7 @@
implementation of your connector, exposing the application-level
CCI <interfacename>ConnectionFactory</interfacename>.</para>
<programlisting><![CDATA[<bean id="eciManagedConnectionFactory" class="com.ibm.connector2.cics.ECIManagedConnectionFactory">
<programlisting language="xml"><![CDATA[<bean id="eciManagedConnectionFactory" class="com.ibm.connector2.cics.ECIManagedConnectionFactory">
<property name="serverName" value="TXSERIES"/>
<property name="connectionURL" value="tcp://localhost/"/>
<property name="portNumber" value="2006"/>
@@ -142,7 +142,7 @@
in the application server (in managed mode) or on the corresponding local
<classname>ManagedConnectionFactory</classname> implementation.</para>
<programlisting><![CDATA[public interface ConnectionFactory implements Serializable, Referenceable {
<programlisting language="java"><![CDATA[public interface ConnectionFactory implements Serializable, Referenceable {
...
Connection getConnection() throws ResourceException;
Connection getConnection(ConnectionSpec connectionSpec) throws ResourceException;
@@ -156,7 +156,7 @@
uses the <literal>getConnection</literal> variant without argument,
else the one with the <interfacename>ConnectionSpec</interfacename> argument.</para>
<programlisting><![CDATA[<bean id="managedConnectionFactory"
<programlisting language="xml"><![CDATA[<bean id="managedConnectionFactory"
class="com.sun.connector.cciblackbox.CciLocalTxManagedConnectionFactory">
<property name="connectionURL" value="jdbc:hsqldb:hsql://localhost:9001"/>
<property name="driverName" value="org.hsqldb.jdbcDriver"/>
@@ -190,7 +190,7 @@
proxies that behave accordingly, all sharing the same underlying physical
connection.</para>
<programlisting><![CDATA[<bean id="eciManagedConnectionFactory"
<programlisting language="xml"><![CDATA[<bean id="eciManagedConnectionFactory"
class="com.ibm.connector2.cics.ECIManagedConnectionFactory">
<property name="serverName" value="TEST"/>
<property name="connectionURL" value="tcp://localhost/"/>
@@ -235,7 +235,7 @@
developer can use a dedicated implementation of the
<interfacename>RecordCreator</interfacename> interface.</para>
<programlisting><![CDATA[public interface RecordCreator {
<programlisting language="java"><![CDATA[public interface RecordCreator {
Record createRecord(RecordFactory recordFactory) throws ResourceException, DataAccessException;
}]]></programlisting>
@@ -249,7 +249,7 @@
shows how to use the <interfacename>RecordCreator</interfacename> interface
and indexed/mapped records.</para>
<programlisting><![CDATA[public class MyRecordCreator implements RecordCreator {
<programlisting language="java"><![CDATA[public class MyRecordCreator implements RecordCreator {
public Record createRecord(RecordFactory recordFactory) throws ResourceException {
IndexedRecord input = recordFactory.createIndexedRecord("input");
@@ -264,14 +264,14 @@
Spring's <classname>CciTemplate</classname> for extracting data from the output
<interfacename>Record</interfacename>.</para>
<programlisting><![CDATA[public interface RecordExtractor {
<programlisting language="java"><![CDATA[public interface RecordExtractor {
Object extractData(Record record) throws ResourceException, SQLException, DataAccessException;
}]]></programlisting>
<para>The following sample shows how to use the <interfacename>RecordExtractor</interfacename> interface.</para>
<programlisting><![CDATA[public class MyRecordExtractor implements RecordExtractor {
<programlisting language="java"><![CDATA[public class MyRecordExtractor implements RecordExtractor {
public Object extractData(Record record) throws ResourceException {
CommAreaRecord commAreaRecord = (CommAreaRecord) record;
@@ -299,7 +299,7 @@
operations on an EIS. The CCI <interfacename>Interaction</interfacename>
interface provides two execute method signatures:</para>
<programlisting><![CDATA[public interface javax.resource.cci.Interaction {
<programlisting language="java"><![CDATA[public interface javax.resource.cci.Interaction {
...
boolean execute(InteractionSpec spec, Record input, Record output) throws ResourceException;
@@ -333,7 +333,7 @@
will be used. These methods directly correspond to those on the
<interfacename>Interaction</interfacename> interface.</para>
<programlisting><![CDATA[public class CciTemplate implements CciOperations {
<programlisting language="java"><![CDATA[public class CciTemplate implements CciOperations {
public Record execute(InteractionSpec spec, Record inputRecord)
throws DataAccessException { ... }
@@ -349,7 +349,7 @@
The corresponding <classname>CciTemplate</classname> methods are the
following:</para>
<programlisting><![CDATA[public class CciTemplate implements CciOperations {
<programlisting language="java"><![CDATA[public class CciTemplate implements CciOperations {
public Record execute(InteractionSpec spec, RecordCreator inputCreator)
throws DataAccessException { ... }
@@ -379,7 +379,7 @@
instances to pass into corresponding
<literal>CciTemplate.execute(..)</literal> methods.</para>
<programlisting><![CDATA[public class CciTemplate implements CciOperations {
<programlisting language="java"><![CDATA[public class CciTemplate implements CciOperations {
public IndexedRecord createIndexedRecord(String name) throws DataAccessException { ... }
@@ -401,7 +401,7 @@
for a passed-in <interfacename>ConnectionFactory</interfacename>, exposing
it to concrete data access implementations in subclasses.</para>
<programlisting><![CDATA[public abstract class CciDaoSupport {
<programlisting language="java"><![CDATA[public abstract class CciDaoSupport {
public void setConnectionFactory(ConnectionFactory connectionFactory) { ... }
public ConnectionFactory getConnectionFactory() { ... }
@@ -432,12 +432,12 @@
property must be directly specified on the <classname>CciTemplate</classname>.
This could be done in the application code like so:</para>
<programlisting><![CDATA[cciTemplate.setOutputRecordCreator(new EciOutputRecordCreator());]]></programlisting>
<programlisting langauge="java"><![CDATA[cciTemplate.setOutputRecordCreator(new EciOutputRecordCreator());]]></programlisting>
<para>Or (recommended) in the Spring configuration, if the <classname>CciTemplate</classname>
is configured as a dedicated bean instance:</para>
<programlisting><![CDATA[<bean id="eciOutputRecordCreator" class="eci.EciOutputRecordCreator"/>
<programlisting language="xml"><![CDATA[<bean id="eciOutputRecordCreator" class="eci.EciOutputRecordCreator"/>
<bean id="cciTemplate" class="org.springframework.jca.cci.core.CciTemplate">
<property name="connectionFactory" ref="eciConnectionFactory"/>
@@ -593,7 +593,7 @@
can be useful for example to get an associated <interfacename>RecordFactory</interfacename>
instance and create indexed/mapped records, for example.</para>
<programlisting><![CDATA[public interface ConnectionCallback {
<programlisting language="java"><![CDATA[public interface ConnectionCallback {
Object doInConnection(Connection connection, ConnectionFactory connectionFactory)
throws ResourceException, SQLException, DataAccessException;
@@ -604,7 +604,7 @@
operations on it, plus the corresponding CCI <interfacename>ConnectionFactory</interfacename>.
</para>
<programlisting><![CDATA[public interface InteractionCallback {
<programlisting language="java"><![CDATA[public interface InteractionCallback {
Object doInInteraction(Interaction interaction, ConnectionFactory connectionFactory)
throws ResourceException, SQLException, DataAccessException;
@@ -628,14 +628,14 @@
<interfacename>InteractionSpec</interfacename> must be done to specify which CICS
program to access and how to interact with it.</para>
<programlisting><![CDATA[ECIInteractionSpec interactionSpec = new ECIInteractionSpec();
<programlisting langauge="java"><![CDATA[ECIInteractionSpec interactionSpec = new ECIInteractionSpec();
interactionSpec.setFunctionName("MYPROG");
interactionSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);]]></programlisting>
<para>Then the program can use CCI via Spring's template and specify
mappings between custom objects and CCI <literal>Records</literal>.</para>
<programlisting><![CDATA[public class MyDaoImpl extends CciDaoSupport implements MyDao {
<programlisting language="java"><![CDATA[public class MyDaoImpl extends CciDaoSupport implements MyDao {
public OutputObject getData(InputObject input) {
ECIInteractionSpec interactionSpec = ...;
@@ -663,7 +663,7 @@ interactionSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);]]></pr
<para>As discussed previously, callbacks can be used to work
directly on CCI connections or interactions.</para>
<programlisting><![CDATA[public class MyDaoImpl extends CciDaoSupport implements MyDao {
<programlisting language="java"><![CDATA[public class MyDaoImpl extends CciDaoSupport implements MyDao {
public OutputObject getData(InputObject input) {
ObjectOutput output = (ObjectOutput) getCciTemplate().execute(
@@ -691,7 +691,7 @@ interactionSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);]]></pr
<interfacename>Interaction</interfacename> will be managed and closed by the
<classname>CciTemplate</classname> in this case.</para>
<programlisting><![CDATA[public class MyDaoImpl extends CciDaoSupport implements MyDao {
<programlisting language="java"><![CDATA[public class MyDaoImpl extends CciDaoSupport implements MyDao {
public String getData(String input) {
ECIInteractionSpec interactionSpec = ...;
@@ -714,7 +714,7 @@ interactionSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);]]></pr
<para>For the examples above, the corresponding configuration of the
involved Spring beans could look like this in non-managed mode:</para>
<programlisting><![CDATA[<bean id="managedConnectionFactory" class="com.ibm.connector2.cics.ECIManagedConnectionFactory">
<programlisting language="xml"><![CDATA[<bean id="managedConnectionFactory" class="com.ibm.connector2.cics.ECIManagedConnectionFactory">
<property name="serverName" value="TXSERIES"/>
<property name="connectionURL" value="local:"/>
<property name="userName" value="CICSUSER"/>
@@ -732,7 +732,7 @@ interactionSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);]]></pr
<para>In managed mode (that is, in a J2EE environment), the configuration
could look as follows:</para>
<programlisting><![CDATA[<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<programlisting language="xml"><![CDATA[<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="eis/cicseci"/>
</bean>
@@ -781,7 +781,7 @@ interactionSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);]]></pr
<para>Here are the signatures of these methods:</para>
<programlisting><![CDATA[public abstract class MappingRecordOperation extends EisOperation {
<programlisting language="java"><![CDATA[public abstract class MappingRecordOperation extends EisOperation {
...
protected abstract Record createInputRecord(RecordFactory recordFactory, Object inputObject)
throws ResourceException, DataAccessException { ... }
@@ -795,7 +795,7 @@ interactionSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);]]></pr
a single execute method, passing in an application-level input object
and receiving an application-level output object as result:</para>
<programlisting><![CDATA[public abstract class MappingRecordOperation extends EisOperation {
<programlisting language="java"><![CDATA[public abstract class MappingRecordOperation extends EisOperation {
...
public Object execute(Object inputObject) throws DataAccessException {
...
@@ -808,7 +808,7 @@ interactionSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);]]></pr
The following constructor must be used to instantiate an operation
object with a specific <interfacename>InteractionSpec</interfacename>:</para>
<programlisting><![CDATA[InteractionSpec spec = ...;
<programlisting langauge="java"><![CDATA[InteractionSpec spec = ...;
MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnectionFactory(), spec);
...]]></programlisting>
</section>
@@ -827,7 +827,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
convert an input object into an input COMMAREA and the output COMMAREA
into an output object.</para>
<programlisting><![CDATA[public abstract class MappingCommAreaOperation extends MappingRecordOperation {
<programlisting language="java"><![CDATA[public abstract class MappingCommAreaOperation extends MappingRecordOperation {
...
protected abstract byte[] objectToBytes(Object inObject)
throws IOException, DataAccessException;
@@ -914,7 +914,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
convert the CCI result record to an instance of the
<classname>Person</classname> class.</para>
<programlisting><![CDATA[public class PersonMappingOperation extends MappingRecordOperation {
<programlisting language="java"><![CDATA[public class PersonMappingOperation extends MappingRecordOperation {
public PersonMappingOperation(ConnectionFactory connectionFactory) {
setConnectionFactory(connectionFactory);
@@ -949,7 +949,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
person identifier as argument. Note that operation object could be
set up as shared instance, as it is thread-safe.</para>
<programlisting><![CDATA[public class MyDaoImpl extends CciDaoSupport implements MyDao {
<programlisting language="java"><![CDATA[public class MyDaoImpl extends CciDaoSupport implements MyDao {
public Person getPerson(int id) {
PersonMappingOperation query = new PersonMappingOperation(getConnectionFactory());
@@ -961,7 +961,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
<para>The corresponding configuration of Spring beans could look
as follows in non-managed mode:</para>
<programlisting><![CDATA[<bean id="managedConnectionFactory"
<programlisting language="xml"><![CDATA[<bean id="managedConnectionFactory"
class="com.sun.connector.cciblackbox.CciLocalTxManagedConnectionFactory">
<property name="connectionURL" value="jdbc:hsqldb:hsql://localhost:9001"/>
<property name="driverName" value="org.hsqldb.jdbcDriver"/>
@@ -990,7 +990,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
<para>In managed mode (that is, in a J2EE environment), the configuration
could look as follows:</para>
<programlisting><![CDATA[<bean id="targetConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<programlisting language="xml"><![CDATA[<bean id="targetConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="eis/blackbox"/>
</bean>
@@ -1021,7 +1021,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
initialized to specify which CICS program to access and how to interact
with it.</para>
<programlisting><![CDATA[public abstract class EciMappingOperation extends MappingCommAreaOperation {
<programlisting language="java"><![CDATA[public abstract class EciMappingOperation extends MappingCommAreaOperation {
public EciMappingOperation(ConnectionFactory connectionFactory, String programName) {
setConnectionFactory(connectionFactory);
@@ -1044,7 +1044,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
then be subclassed to specify mappings between custom objects and
<literal>Records</literal>.</para>
<programlisting><![CDATA[public class MyDaoImpl extends CciDaoSupport implements MyDao {
<programlisting language="java"><![CDATA[public class MyDaoImpl extends CciDaoSupport implements MyDao {
public OutputObject getData(Integer id) {
EciMappingOperation query = new EciMappingOperation(getConnectionFactory(), "MYPROG") {
@@ -1068,7 +1068,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
<para>The corresponding configuration of Spring beans could look
as follows in non-managed mode:</para>
<programlisting><![CDATA[<bean id="managedConnectionFactory" class="com.ibm.connector2.cics.ECIManagedConnectionFactory">
<programlisting language="xml"><![CDATA[<bean id="managedConnectionFactory" class="com.ibm.connector2.cics.ECIManagedConnectionFactory">
<property name="serverName" value="TXSERIES"/>
<property name="connectionURL" value="local:"/>
<property name="userName" value="CICSUSER"/>
@@ -1086,7 +1086,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
<para>In managed mode (that is, in a J2EE environment), the configuration
could look as follows:</para>
<programlisting><![CDATA[<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<programlisting language="xml"><![CDATA[<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="eis/cicseci"/>
</bean>
@@ -1106,7 +1106,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
example with a CICS ECI connector), global transactions (for example with an
IMS connector).</para>
<programlisting><![CDATA[<connector>
<programlisting language="xml"><![CDATA[<connector>
<resourceadapter>
@@ -1131,7 +1131,7 @@ MyMappingRecordOperation eisOperation = new MyMappingRecordOperation(getConnecti
executes such local CCI transactions, fully compliant with Spring's generic
<interfacename>PlatformTransactionManager</interfacename> abstraction.</para>
<programlisting><![CDATA[<bean id="eciConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<programlisting language="xml"><![CDATA[<bean id="eciConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="eis/cicseci"/>
</bean>