Table of Contents

Search

  1. Preface
  2. Introduction to Services Integration Framework
  3. Setting Up the SIF SDK
  4. Request and Response Objects
  5. Transactions and Exception Handling
  6. ORS-Specific SIF API
  7. Asynchronous SIF Requests
  8. ORS-Specific JMS Event Messages
  9. Using Security Access Manager
  10. Using Dynamic Data Masking
  11. SIF API Reference
  12. Troubleshooting
  13. Appendix A: Identifiers
  14. Appendix B: Frequently Asked Questions

Example EJB Transaction for JBoss

Example EJB Transaction for JBoss

Create an instance of
SiperianClient
with
ejb
as the
SiperianClient.SIPERIANCLIENT_PROTOCOL
property value, and start JBoss with the
-Djboss.node.name=<Node Name>
parameter for user transactions.
Ensure that you add the following JAR files to the CLASSPATH environment variable:
  • <MDM Hub Installation Directory>\hub\server\lib\siperian-api.jar
    or
    <Resource Kit Installation Directory>\sdk\sifsdk\lib\siperian-api.jar
  • <MDM Hub Installation Directory>\hub\server\lib\siperian-common.jar
    or
    <Resource Kit Installation Directory>\sdk\sifsdk\lib\siperian-common.jar
  • <JBoss Installation Directory>\bin\jboss-client.jar
  • <JBoss Installation Directory>\modules\system\layers\base\org\picketbox\main\picketbox-4.<x>.<x>.Final-redhat-1.jar
The following sample code specifies the JBoss properties for the MDM Hub to create a
SiperianClient
instance:
Properties properties = new Properties(); properties.put(SiperianClient.SIPERIANCLIENT_PROTOCOL, "ejb"); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); properties.put( "java.naming.factory.url.pkgs", "org.jboss.ejb.client.naming" ); properties.put( Context.PROVIDER_URL, "remote://<JBoss host name>:<JBoss port>"); properties.put("jboss.naming.client.ejb.context", true); properties.put(Context.SECURITY_PRINCIPAL, "<User name of the MDM Hub user registered in JBoss>"); properties.put(Context.SECURITY_CREDENTIALS, "<Password of the MDM Hub user registered in JBoss>"); properties.put("siperian-client.orsId", "<Operational Reference Store ID>"); properties.put("siperian-client.username", "<User name of the MDM Hub user registered in JBoss>"); properties.put("siperian-client.password", "<Password of the MDM Hub user registered in JBoss>"); System.setProperty("jboss.node.name", "localhost"); //Value of this property should be the same as it was provided while starting JBoss with the -Djboss.node.name option. client = SiperianClient.newSiperianClient(properties);
The following sample code uses the
createTX(int)
method to create a transaction:
UserTransaction tx = client.createTX(30);
The following sample code commits a transaction:
tx.begin(); // sif api calls tx.commit();
The following sample code rolls back a transaction:
tx.rollback()

0 COMMENTS

We’d like to hear from you!