public void init()
    {
        Context.initialize();
        // Create a Session
        _session = Session.acquire(CommandLine.variable("session"));
        if (_session == null)
        {
            System.out.println("Could not acquire session.");
            Context.uninitialize();
            System.exit(1);
        }
        System.out.println("RFA Version: " + Context.getRFAVersionInfo().getProductVersion());

        // Create an Event Queue
        _eventQueue = EventQueue.create("myEventQueue");

        // Create a OMMPool.
        _pool = OMMPool.create();

        // Create an OMMEncoder
        _encoder = _pool.acquireEncoder();
        _encoder.initialize(OMMTypes.MSG, 5000);

        // Initialize client for login domain.
        _loginClient = new LoginClient(this);
        _directoryClient = new DirectoryClient(this);

        if (_loginClient == null || _directoryClient == null)
        {
            System.out.println("ERROR:" + _className
                    + " failed to create LoginClient / DirectoryClient");
            cleanup(-1);
        }

        // Create an OMMConsumer event source
        _ommConsumer = (OMMConsumer)_session.createEventSource(EventSource.OMM_CONSUMER,
                                                               "myOMMConsumer", true);

        // Load dictionary from files in to FieldDictionary, if the files have
        // been specified.
        String fieldDictionaryFilename = CommandLine.variable("rdmFieldDictionary");
        String enumDictionaryFilename = CommandLine.variable("enumType");
        if ((fieldDictionaryFilename.length() > 0) && (enumDictionaryFilename.length() > 0))
        {
            try
            {
                _localDictionary = FieldDictionary.create();
                FieldDictionary.readRDMFieldDictionary(_localDictionary, fieldDictionaryFilename);
                System.out.println(_className + ": " + fieldDictionaryFilename + " is loaded.");
                FieldDictionary.readEnumTypeDef(_localDictionary, enumDictionaryFilename);
                System.out.println(_className + ": " + enumDictionaryFilename + " is loaded.");
                printLocalDictionaryInfo();
            }
            catch (DictionaryException ex)
            {
                _localDictionary = null;
                System.out.println("ERROR: " + _className
                        + " unable to initialize dictionary from file.");
                System.out.println(ex.getMessage());
                if (ex.getCause() != null)
                    System.err.println(": " + ex.getCause().getMessage());
                System.out.println(_className
                        + " will continue download dictionary from server soon.");
            }
        }

        // Send login request
        // Application must send login request first
        _loginClient.sendRequest();
    }