com.ibm.vap.cciadapter
Class CCIAdapter

java.lang.Object
  |
  +--com.ibm.vap.generic.ServerAdapter
        |
        +--com.ibm.vap.cciadapter.CCIAdapter
Direct Known Subclasses:
IMSAdapter

public class CCIAdapter
extends com.ibm.vap.generic.ServerAdapter

This server adapter class is used by the VisualAge Pacbase Runtime to communicate with the server using J2EE connectors through supported protocols. This class implements the ServerAdapter methods using the Common Client Interface currently delivered as a Beta version by IBM. You may then use any connector classes that implements this interface to communicate with the server. In the following exemple we use the CICS Connector (com.ibm.connector2.cics.*). The InteractionSpec that retains all interaction-relevant attributes of a CCI Connector, such as a program name or interaction mode, needs to be instantiate an setup by the user. The ConnectionFactory that holds all connection-relevant attributes of a CCI Connector, such as host name, port number, and timeout specifications, needs also to be instantiate an setup by the user. Then you will need to instantiate cciAdapter class and set it as the current proxy ServerAddapter.

Sample code :

	com.ibm.connector2.cics.ECIManagedConnectionFactory mcf = new com.ibm.connector2.cics.ECIManagedConnectionFactory();
	mcf.setPassword("PASSWORD");
	mcf.setServerName("CICSSTMV");
	mcf.setTPNName("VEC1");
	mcf.setUserName("USER");
	mcf.setConnectionURL("tcp://9.100.400.170:2000");
	com.ibm.connector2.cics.ECIConnectionFactory cf = (com.ibm.connector2.cics.ECIConnectionFactory)mcf.createConnectionFactory();

	com.ibm.connector2.cics.ECIConnectionSpec cs = new com.ibm.connector2.cics.ECIConnectionSpec();
	com.ibm.connector2.cics.ECIInteractionSpec is = new com.ibm.connector2.cics.ECIInteractionSpec();
	is.setCommareaLength(8192);
	is.setFunctionName("CLECIN");
 
	try {
		com.ibm.vap.cciadapter.CCIAdapter cciAdapter = new com.ibm.vap.cciadapter.CCIAdapter(cf,cs,is);
		cciAdapter.setHostCodePage("Cp1147");
		com.ibm.vap.generated.proxies.CustomerProxyLv proxy = new com.ibm.vap.generated.proxies.CustomerProxyLv();
		proxy.setServerAdapter(cciAdapter);
		proxy.selectInstances();
		return proxy.rows();
	} catch (com.ibm.vap.generic.CommunicationError ce) {
		return ce.getMessage();
	}
 

Since:
2.5v11
See Also:
ServerAdapter

Constructor Summary
CCIAdapter()
          Default constructor.
CCIAdapter(com.ibm.vap.cciadapter.ConnectionFactory connectionFactory, com.ibm.vap.cciadapter.ConnectionSpec connection, com.ibm.vap.cciadapter.InteractionSpec interaction)
          Full constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void disconnect()
          Frees resources used for the communication by this server adapter (connections, buffers, etc).
 int getCommareaLength()
          Retreives by introspection the CommareaLength set in the specific IneractionSpec class
 com.ibm.vap.cciadapter.ConnectionFactory getConnectionFactory()
          retrieves the connectionFactory attribut.
 com.ibm.vap.cciadapter.ConnectionSpec getConnectionSpec()
          retrieves the connectionSpec attribut.
 java.lang.String getHostCodePage()
          retrieves the hsot code page attribut.
 com.ibm.vap.cciadapter.InteractionSpec getInteractionSpec()
          retrieves the interactionSpec attribut.
 java.lang.Object getProperty(java.lang.String name)
          Returns the communication parameter for the specified String name.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 com.ibm.vap.generic.Requester requireRequester()
          Returns an instance of requester associated to this server adapter.
 void setConnectionFactory(com.ibm.vap.cciadapter.ConnectionFactory newValue)
          Sets the connectionFactory attribut.
 void setConnectionSpec(com.ibm.vap.cciadapter.ConnectionSpec newValue)
          Sets the connectionSpec attribut.
 void setHostCodePage(java.lang.String newValue)
          Sets the host code page attribut.
 void setInteractionSpec(com.ibm.vap.cciadapter.InteractionSpec newValue)
          Sets the interactionFactory attribut.
 void setProperty(java.lang.String name, java.lang.Object newValue)
          Sets a communication parameter of specified name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CCIAdapter

public CCIAdapter()
Default constructor.

CCIAdapter

public CCIAdapter(com.ibm.vap.cciadapter.ConnectionFactory connectionFactory,
                  com.ibm.vap.cciadapter.ConnectionSpec connection,
                  com.ibm.vap.cciadapter.InteractionSpec interaction)
Full constructor.
Parameters:
connectionFactory - javax.resource.cci.ConnectionFactory
connection - javax.resource.cci.ConnectionSpec
interaction - javax.resource.cci.InteractionSpec
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

disconnect

public void disconnect()
Frees resources used for the communication by this server adapter (connections, buffers, etc). This method is never called by the VisualAge Pacbase Runtime, but can be used by the client program.
Overrides:
disconnect in class com.ibm.vap.generic.ServerAdapter

getCommareaLength

public int getCommareaLength()
Retreives by introspection the CommareaLength set in the specific IneractionSpec class
Returns:
the commarea length

getConnectionFactory

public com.ibm.vap.cciadapter.ConnectionFactory getConnectionFactory()
retrieves the connectionFactory attribut.
Returns:
javax.resource.cci.ConnectionFactory

getConnectionSpec

public com.ibm.vap.cciadapter.ConnectionSpec getConnectionSpec()
retrieves the connectionSpec attribut.
Returns:
javax.resource.cci.ConnectionSpec

getHostCodePage

public java.lang.String getHostCodePage()
retrieves the hsot code page attribut.
Returns:
the value of the host encoding page code

getInteractionSpec

public com.ibm.vap.cciadapter.InteractionSpec getInteractionSpec()
retrieves the interactionSpec attribut.
Returns:
javax.resource.cci.InteractionSpec

getProperty

public java.lang.Object getProperty(java.lang.String name)
Returns the communication parameter for the specified String name. This method can be overriden by the specific server adapter. It is the responsibility of the specific server adapter to return the property value or throw a communication exception.
Overrides:
getProperty in class com.ibm.vap.generic.ServerAdapter
Parameters:
name - the property name
Returns:
the property value

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

requireRequester

public com.ibm.vap.generic.Requester requireRequester()
                                               throws com.ibm.vap.generic.CommunicationError
Returns an instance of requester associated to this server adapter. The returned requester is initialized using the properties set in this server adapter.
Overrides:
requireRequester in class com.ibm.vap.generic.ServerAdapter
Returns:
a requester which can be used to send/receive requests
Throws:
com.ibm.vap.generic.CommunicationError - if a CCIRequester can't be instantiate

setConnectionFactory

public void setConnectionFactory(com.ibm.vap.cciadapter.ConnectionFactory newValue)
Sets the connectionFactory attribut.
Parameters:
javax.resource.cci.ConnectionFactory -  

setConnectionSpec

public void setConnectionSpec(com.ibm.vap.cciadapter.ConnectionSpec newValue)
Sets the connectionSpec attribut.
Parameters:
javax.resource.cci.ConnectionSpec -  

setHostCodePage

public void setHostCodePage(java.lang.String newValue)
Sets the host code page attribut.
Parameters:
String - representation of the hsot code page

setInteractionSpec

public void setInteractionSpec(com.ibm.vap.cciadapter.InteractionSpec newValue)
Sets the interactionFactory attribut.
Parameters:
javax.resource.cci.InteractionSpec -  

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object newValue)
Sets a communication parameter of specified name. This method can be overriden by a specific server adapter. It is the responsibility of the specific server adapter set the property value or throw a communication exception.
Overrides:
setProperty in class com.ibm.vap.generic.ServerAdapter
Parameters:
name - the property name
newValue - the property value


Licensed Materials - Property of IBM - 5655-F37 - (C) Copyright IBM Corp. 1983, 2003. All Rights Reserved.
IBM, VisualAge and Pacbase are trademarks of International Business Machines Corporation registered in the United States, other countries, or both.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States,other countries, or both.
Other company, product or service names may be the trademarks or service marks of others.