<?xml version="1.0" encoding="UTF-8"?>
<chapter version="5.0"
         xmlns="http://docbook.org/ns/docbook"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns:mml="http://www.w3.org/1998/Math/MathML"
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns:db="http://docbook.org/ns/docbook"
         xml:lang="en" xml:id="commands.genic">
  <title>GenIC command</title>

  <para>Generates the container classes for EJBs.</para>

  <section>
    <title>Options</title>

    <cmdsynopsis>
      <command>GenIC</command>

      <arg rep="repeat">options</arg>

      <arg choice="plain">&lt;InputFileName&gt;</arg>
    </cmdsynopsis>

    <variablelist>
      <varlistentry>
        <term>-d directory</term>

        <listitem>
          <para>Specifies the root directory of the class hierarchy.</para>

          <para>This option can be used to specify a destination directory for
          the generated files.</para>

          <para>If the <emphasis role="bold">-d</emphasis> option is not used,
          the package hierarchy of the target class is ignored and the
          generated files are placed in the current directory.</para>

          <para>If the <emphasis>InputFile </emphasis>is an ejb-jar file, the
          generated classes are added to the ejb-jar file, unless the
          <emphasis role="bold">-noaddinjar</emphasis> option is set.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-invokecmd</term>

        <listitem>
          <para>Invokes directly the java class corresponding to the java
          compiler.</para>

          <para>This is useful on Windows in the event of a
          <emphasis>CreateProcess Exception </emphasis>(this occurs when the
          command line is too long).</para>

          <para>In this case tools.jar must be visible in the CLASSPATH</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-javac <emphasis>options</emphasis></term>

        <listitem>
          <para>Specifies the java compiler name to use (javac by
          default).</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-javacopts <emphasis>options</emphasis></term>

        <listitem>
          <para>Specifies the options to pass to the java compiler.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-keepgenerated</term>

        <listitem>
          <para>Do not immediately delete generated files.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-noaddinjar</term>

        <listitem>
          <para>If the <emphasis>InputFile</emphasis> is an ejb-jar file, do
          not add the generated classes to the ejb-jar file.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-nocompil</term>

        <listitem>
          <para>Do not compile the generated source files via the java and rmi
          compilers.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-novalidation</term>

        <listitem>
          <para>Remove xml validation during parsing.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-protocols</term>

        <listitem>
          <para>Comma-separated list of protocols (jrmp, iiop, irmi) for which
          stubs should be generated. Default is jrmp</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-rmiopts <emphasis>options</emphasis></term>

        <listitem>
          <para>Specifies the options to pass to the rmi compiler.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-verbose</term>

        <listitem>
          <para>Displays additional information about command
          execution.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-nofastrmic</term>

        <listitem>
          <para>Disable the use of fastrmic for stubs/ties generation.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </section>

  <section>
    <title>Example</title>

    <variablelist>
      <varlistentry>
        <term>GenIC -d ../../classes sb.xml</term>

        <listitem>
          <para>Generates container classes of all the Enterprise JavaBeans
          defined in the sb.xml file. Classes are generated in the
          ../../classes directory adhering to the classes hierarchy.</para>
        </listitem>
      </varlistentry>
    </variablelist>

    <variablelist>
      <varlistentry>
        <term>GenIC sb.jar</term>

        <listitem>
          <para>Generates container classes for all the Enterprise JavaBeans
          defined in the sb.jar file and adds the generated classes to this
          ejb-jar file.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </section>

  <section>
    <title>Description</title>

    <para>The GenIC utility generates the container classes for <xi:include href="../variables.xml" xpointer="appserver"/> from the
    given Enterprise Java Beans.</para>

    <para>The <emphasis>InputFileName</emphasis> is either the file name of an
    ejb-jar file or the file name of an XML deployment descriptor of
    beans.</para>

    <para>The GenIC utility does the following :</para>

    <orderedlist>
      <listitem>
        <para>generates the sources of the container classes for all the beans
        defined in the deployment descriptor,</para>
      </listitem>

      <listitem>
        <para>compiles these classes via the java compiler,</para>
      </listitem>

      <listitem>
        <para>generates stubs and skeletons for those remote objects via the
        rmi compiler, and</para>
      </listitem>

      <listitem>
        <para>if the InputFile is an ejb-jar file, adds the generated classes
        in this ejb-jar file.</para>
      </listitem>
    </orderedlist>
  </section>

  <section>
    <title>Environment</title>

    <para>If <emphasis>InputFile </emphasis>is an XML deployment descriptor,
    the classpath must include the paths of the directories in which the
    Enterprise Bean's classes can be found, as well as the path of the
    directory specified by the -d option.</para>

    <para>If <emphasis>InputFile</emphasis> is an ejb-jar file, the classpath
    must include the path of the directory specified by the -d option.</para>
  </section>
</chapter>