private void writeTransaction ( Definition def , Writer out , int indent ) throws IOException { writeWithIndent ( out , indent , "/**\n" ) ; writeWithIndent ( out , indent , " * Returns an <code>javax.resource.spi.LocalTransaction</code> instance.\n" ) ; writeWithIndent ( out , indent , " *\n" ) ; writeWithIndent ( out , indent , " * @return LocalTransaction instance\n" ) ; writeWithIndent ( out , indent , " * @throws ResourceException generic exception if operation fails\n" ) ; writeWithIndent ( out , indent , " */\n" ) ; writeWithIndent ( out , indent , "public LocalTransaction getLocalTransaction() throws ResourceException" ) ; writeLeftCurlyBracket ( out , indent ) ; if ( def . getSupportTransaction ( ) . equals ( "NoTransaction" ) ) { writeWithIndent ( out , indent + 1 , "throw new NotSupportedException(\"getLocalTransaction() not supported\");" ) ; } else { writeLogging ( def , out , indent + 1 , "trace" , "getLocalTransaction" ) ; writeWithIndent ( out , indent + 1 , "return null;" ) ; } writeRightCurlyBracket ( out , indent ) ; writeEol ( out ) ; writeWithIndent ( out , indent , "/**\n" ) ; writeWithIndent ( out , indent , " * Returns an <code>javax.transaction.xa.XAresource</code> instance. \n" ) ; writeWithIndent ( out , indent , " *\n" ) ; writeWithIndent ( out , indent , " * @return XAResource instance\n" ) ; writeWithIndent ( out , indent , " * @throws ResourceException generic exception if operation fails\n" ) ; writeWithIndent ( out , indent , " */\n" ) ; writeWithIndent ( out , indent , "public XAResource getXAResource() throws ResourceException" ) ; writeLeftCurlyBracket ( out , indent ) ; if ( def . getSupportTransaction ( ) . equals ( "NoTransaction" ) ) { writeWithIndent ( out , indent + 1 , "throw new NotSupportedException(\"getXAResource() not supported\");" ) ; } else { writeLogging ( def , out , indent + 1 , "trace" , "getXAResource" ) ; writeWithIndent ( out , indent + 1 , "return null;" ) ; } writeRightCurlyBracket ( out , indent ) ; writeEol ( out ) ; }
Output Transaction method