This content has been marked as final.
Show 2 replies
-
1. Re: Can i use Oracle Tuxedo JCA Adapter in WildFly 9 to call my tuxedo backend service?
jesper.pedersen Jan 12, 2016 3:31 PM (in response to mhsu4568)Maybe Mickey can help you - https://developer.jboss.org/message/948726
Otherwise get started with http://www.ironjacamar.org/doc/userguide/1.2/en-US/html/ch10.html#tools_rarinfo
-
2. Re: Can i use Oracle Tuxedo JCA Adapter in WildFly 9 to call my tuxedo backend service?
erhard Jan 16, 2016 8:34 AM (in response to mhsu4568)Hi,
Yes you can use WildFly 9 with "Oracle Tuxedo JCA Adapter". We are using it with EAP 6 in production and I tried it with EAP 7.0.0.Beta, so I assume its working with Wildfly 9. When it come to cost, you need to be aware, that the Tuxedo Adapter needs to be licenced as well. I don't know any other Tuxedo adapters that work.
You can use code similar to the following (this is not production-code!):
import javax.annotation.Resource; import javax.ejb.Stateless; import javax.jws.WebService; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.resource.ResourceException; import javax.resource.cci.Connection; import javax.resource.cci.ConnectionFactory; import javax.resource.cci.Interaction; import javax.resource.cci.InteractionSpec; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import weblogic.wtc.jatmi.TPException; import com.oracle.tuxedo.adapter.cci.TuxedoInteractionSpec; import com.oracle.tuxedo.adapter.cci.TuxedoStringRecord; import com.oracle.tuxedo.adapter.cci.TuxedoXOctetRecord; @Stateless @WebService public class TuxCall implements ITuxCall { private final static Logger logger = LoggerFactory.getLogger(TuxCall.class); @Resource(mappedName="java:/ta2/tuxedo") private ConnectionFactory connectionFactory; private String jndiName = "java:/ta2/tuxedo"; // private String jndiName = "java:comp/env/eis/tuxedo"; public String toupper(String message) { return callString("TOUPPER", message); } private String callString(String tmServiceName, String request) { Connection connection; TuxedoStringRecord outRec; try { logger.info("get Connection"); connection = getConnectionFactory().getConnection(); logger.info("got Connection"); outRec = interCall(tmServiceName, request, connection); connection.close(); return outRec.getString(); } catch (NamingException ne) { throw new RuntimeException( "Fehler beim Holen der TuxedoConnectionFactory mit JNDI-name " + jndiName, ne); } catch (ResourceException re) { throw new RuntimeException( "ResourceException beim Zugriff auf Tuxedo Service "+ tmServiceName+ ": ", re); } catch (TPException e) { throw new RuntimeException("Fehler beim Zugriff auf Tuxedo: ", e); } } private TuxedoStringRecord interCall(String tmServiceName, String request, Connection connection) throws ResourceException, TPException { Interaction ix; TuxedoStringRecord inRec; TuxedoStringRecord outRec; TuxedoInteractionSpec ixspec; logger.info("createInteraction"); ix = connection.createInteraction(); logger.info("got Interaction"); logger.info("create TuxedoInteractionSpec"); ixspec = new TuxedoInteractionSpec(); logger.info("got TuxedoInteractionSpec"); ixspec.setFunctionName(tmServiceName); ixspec.setInteractionVerb(InteractionSpec.SYNC_SEND_RECEIVE); logger.info("create Buffers"); inRec = new TuxedoStringRecord(); outRec = new TuxedoStringRecord(); logger.info("got Buffers"); inRec.setString(request); logger.info("execute"); ix.execute(ixspec, inRec, outRec); logger.info("execute ok"); logger.info("close Interaction"); ix.close(); logger.info("closed Interaction"); return outRec; } private ConnectionFactory getConnectionFactory() throws NamingException { // System.out.println("get ConnectionFactory"); if (connectionFactory == null) { logger.info("ConnectionFactory nicht gesetzt, hole von " + "Initial Context mit JNDI-Namen " + jndiName); Context ctx = new InitialContext(); connectionFactory = (ConnectionFactory) ctx.lookup(jndiName); } return connectionFactory; }