// **********************************************************************
//
// Generated by the ORBacus IDL to Java Translator
//
// Copyright (c) 2005
// IONA Technologies, Inc.
// Waltham, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

// Version: 4.3.2

package org.exolab.jms.jobserver;

//
// IDL:org.exolab.jms/org/exolab/jms/jobserver/ServerConnectionFactory:1.0
//
public class _ServerConnectionFactoryStub extends org.omg.CORBA.portable.ObjectImpl
                                          implements ServerConnectionFactory
{
    private static final String[] _ob_ids_ =
    {
        "IDL:org.exolab.jms/org/exolab/jms/jobserver/ServerConnectionFactory:1.0",
    };

    public String[]
    _ids()
    {
        return _ob_ids_;
    }

    final public static java.lang.Class _ob_opsClass = ServerConnectionFactoryOperations.class;

    //
    // IDL:org.exolab.jms/org/exolab/jms/jobserver/ServerConnectionFactory/createConnection:1.0
    //
    public ServerConnection
    createConnection(String _ob_a0,
                     String _ob_a1,
                     String _ob_a2)
    {
        while(true)
        {
            if(!this._is_local())
            {
                org.omg.CORBA.portable.OutputStream out = null;
                org.omg.CORBA.portable.InputStream in = null;
                try
                {
                    out = _request("createConnection", true);
                    out.write_string(_ob_a0);
                    out.write_string(_ob_a1);
                    out.write_string(_ob_a2);
                    in = _invoke(out);
                    ServerConnection _ob_r = ServerConnectionHelper.read(in);
                    return _ob_r;
                }
                catch(org.omg.CORBA.portable.RemarshalException _ob_ex)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _ob_aex)
                {
                    final String _ob_id = _ob_aex.getId();
                    in = _ob_aex.getInputStream();

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id);
                }
                finally
                {
                    _releaseReply(in);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("createConnection", _ob_opsClass);
                if(_ob_so == null)
                    continue;
                ServerConnectionFactoryOperations _ob_self = (ServerConnectionFactoryOperations)_ob_so.servant;
                try
                {
                    return _ob_self.createConnection(_ob_a0, _ob_a1, _ob_a2);
                }
                finally
                {
                    _servant_postinvoke(_ob_so);
                }
            }
        }
    }
}
