private void writeOutbound(Definition def, Writer out, int indent) throws IOException
   {
      writeIndent(out, indent);
      out.write("<outbound-resourceadapter>");
      writeEol(out);

      for (int num = 0; num < def.getMcfDefs().size(); num++)
      {

         writeIndent(out, indent + 1);
         out.write("<connection-definition>");
         writeEol(out);
         writeIndent(out, indent + 2);
         out.write("<managedconnectionfactory-class>" + def.getRaPackage() + "." +
               def.getMcfDefs().get(num).getMcfClass() + "</managedconnectionfactory-class>");
         writeEol(out);
         writeConfigPropsXml(def.getMcfDefs().get(num).getMcfConfigProps(), out, indent + 2);

         if (!def.getMcfDefs().get(num).isUseCciConnection())
         {
            writeIndent(out, indent + 2);
            out.write("<connectionfactory-interface>" + def.getRaPackage() + "." +
                  def.getMcfDefs().get(num).getCfInterfaceClass() + "</connectionfactory-interface>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<connectionfactory-impl-class>" + def.getRaPackage() + "." +
                  def.getMcfDefs().get(num).getCfClass() + "</connectionfactory-impl-class>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<connection-interface>" + def.getRaPackage() + "." +
                  def.getMcfDefs().get(num).getConnInterfaceClass() + "</connection-interface>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<connection-impl-class>" + def.getRaPackage() + "." +
                  def.getMcfDefs().get(num).getConnImplClass() + "</connection-impl-class>");
            writeEol(out);
         }
         else
         {
            writeIndent(out, indent + 2);
            out.write("<connectionfactory-interface>javax.resource.cci.ConnectionFactory"
                  + "</connectionfactory-interface>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<connectionfactory-impl-class>" + def.getRaPackage() + "." +
                  def.getMcfDefs().get(num).getCciConnFactoryClass() + "</connectionfactory-impl-class>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<connection-interface>javax.resource.cci.Connection</connection-interface>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<connection-impl-class>" + def.getRaPackage() + "." +
                  def.getMcfDefs().get(num).getCciConnClass() + "</connection-impl-class>");
            writeEol(out);
         }
         writeIndent(out, indent + 1);
         out.write("</connection-definition>");
         writeEol(out);
      }
      writeIndent(out, indent + 1);
      out.write("<transaction-support>" + def.getSupportTransaction() + "</transaction-support>");
      writeEol(out);

      if (def.getAuthenMechanisms() != null && def.getAuthenMechanisms().size() > 0)
      {
         for (int i = 0; i < def.getAuthenMechanisms().size(); i++)
         {
            writeIndent(out, indent + 1);
            out.write("<authentication-mechanism>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<authentication-mechanism-type>" + def.getAuthenMechanisms().get(i).getAuthMechanism() +
                  "</authentication-mechanism-type>");
            writeEol(out);
            writeIndent(out, indent + 2);
            out.write("<credential-interface>");
            if (def.getAuthenMechanisms().get(i).getCredentialInterface().equals("GSSCredential"))
               out.write("org.ietf.jgss.GSSCredential");
            else
               out.write("javax.resource.spi.security." + def.getAuthenMechanisms().get(i).getCredentialInterface());
            out.write("</credential-interface>");
            writeEol(out);
            writeIndent(out, indent + 1);
            out.write("</authentication-mechanism>");
            writeEol(out);
         }
      }

      writeIndent(out, indent + 1);
      out.write("<reauthentication-support>" + def.isSupportReauthen() + "</reauthentication-support>");
      writeEol(out);
      writeIndent(out, indent);
      out.write("</outbound-resourceadapter>");
      writeEol(out);
   }
private void writeOutbound ( Definition def , Writer out , int indent ) throws IOException { writeIndent ( out , indent ) ; out . write ( "<outbound-resourceadapter>" ) ; writeEol ( out ) ; for ( int num = 0 ; num < def . getMcfDefs ( ) . size ( ) ; num ++ ) { writeIndent ( out , indent + 1 ) ; out . write ( "<connection-definition>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<managedconnectionfactory-class>" + def . getRaPackage ( ) + "." + def . getMcfDefs ( ) . get ( num ) . getMcfClass ( ) + "</managedconnectionfactory-class>" ) ; writeEol ( out ) ; writeConfigPropsXml ( def . getMcfDefs ( ) . get ( num ) . getMcfConfigProps ( ) , out , indent + 2 ) ; if ( ! def . getMcfDefs ( ) . get ( num ) . isUseCciConnection ( ) ) { writeIndent ( out , indent + 2 ) ; out . write ( "<connectionfactory-interface>" + def . getRaPackage ( ) + "." + def . getMcfDefs ( ) . get ( num ) . getCfInterfaceClass ( ) + "</connectionfactory-interface>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<connectionfactory-impl-class>" + def . getRaPackage ( ) + "." + def . getMcfDefs ( ) . get ( num ) . getCfClass ( ) + "</connectionfactory-impl-class>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<connection-interface>" + def . getRaPackage ( ) + "." + def . getMcfDefs ( ) . get ( num ) . getConnInterfaceClass ( ) + "</connection-interface>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<connection-impl-class>" + def . getRaPackage ( ) + "." + def . getMcfDefs ( ) . get ( num ) . getConnImplClass ( ) + "</connection-impl-class>" ) ; writeEol ( out ) ; } else { writeIndent ( out , indent + 2 ) ; out . write ( "<connectionfactory-interface>javax.resource.cci.ConnectionFactory" + "</connectionfactory-interface>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<connectionfactory-impl-class>" + def . getRaPackage ( ) + "." + def . getMcfDefs ( ) . get ( num ) . getCciConnFactoryClass ( ) + "</connectionfactory-impl-class>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<connection-interface>javax.resource.cci.Connection</connection-interface>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<connection-impl-class>" + def . getRaPackage ( ) + "." + def . getMcfDefs ( ) . get ( num ) . getCciConnClass ( ) + "</connection-impl-class>" ) ; writeEol ( out ) ; } writeIndent ( out , indent + 1 ) ; out . write ( "</connection-definition>" ) ; writeEol ( out ) ; } writeIndent ( out , indent + 1 ) ; out . write ( "<transaction-support>" + def . getSupportTransaction ( ) + "</transaction-support>" ) ; writeEol ( out ) ; if ( def . getAuthenMechanisms ( ) != null && def . getAuthenMechanisms ( ) . size ( ) > 0 ) { for ( int i = 0 ; i < def . getAuthenMechanisms ( ) . size ( ) ; i ++ ) { writeIndent ( out , indent + 1 ) ; out . write ( "<authentication-mechanism>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<authentication-mechanism-type>" + def . getAuthenMechanisms ( ) . get ( i ) . getAuthMechanism ( ) + "</authentication-mechanism-type>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 2 ) ; out . write ( "<credential-interface>" ) ; if ( def . getAuthenMechanisms ( ) . get ( i ) . getCredentialInterface ( ) . equals ( "GSSCredential" ) ) out . write ( "org.ietf.jgss.GSSCredential" ) ; else out . write ( "javax.resource.spi.security." + def . getAuthenMechanisms ( ) . get ( i ) . getCredentialInterface ( ) ) ; out . write ( "</credential-interface>" ) ; writeEol ( out ) ; writeIndent ( out , indent + 1 ) ; out . write ( "</authentication-mechanism>" ) ; writeEol ( out ) ; } } writeIndent ( out , indent + 1 ) ; out . write ( "<reauthentication-support>" + def . isSupportReauthen ( ) + "</reauthentication-support>" ) ; writeEol ( out ) ; writeIndent ( out , indent ) ; out . write ( "</outbound-resourceadapter>" ) ; writeEol ( out ) ; }
Output outbound xml part

@param def    definition
@param out    Writer
@param indent space number
@throws IOException ioException