package test.interop.wchar_tao_interop;


/**
 * Generated from IDL interface "GoodDay".
 *
 * @author JacORB IDL compiler V @project.version@
 * @version generated at 25-Feb-2014 13:44:21
 */

public abstract class GoodDayPOA
	extends org.omg.PortableServer.Servant
	implements org.omg.CORBA.portable.InvokeHandler, test.interop.wchar_tao_interop.GoodDayOperations
{
	static private final java.util.HashMap<String,Integer> m_opsHash = new java.util.HashMap<String,Integer>();
	static
	{
		m_opsHash.put ( "hello_simple", Integer.valueOf(0));
		m_opsHash.put ( "test", Integer.valueOf(1));
		m_opsHash.put ( "hello_wide", Integer.valueOf(2));
	}
	private String[] ids = {"IDL:test/interop/wchar_tao_interop/GoodDay:1.0"};
	public test.interop.wchar_tao_interop.GoodDay _this()
	{
		org.omg.CORBA.Object __o = _this_object() ;
		test.interop.wchar_tao_interop.GoodDay __r = test.interop.wchar_tao_interop.GoodDayHelper.narrow(__o);
		return __r;
	}
	public test.interop.wchar_tao_interop.GoodDay _this(org.omg.CORBA.ORB orb)
	{
		org.omg.CORBA.Object __o = _this_object(orb) ;
		test.interop.wchar_tao_interop.GoodDay __r = test.interop.wchar_tao_interop.GoodDayHelper.narrow(__o);
		return __r;
	}
	public org.omg.CORBA.portable.OutputStream _invoke(String method, org.omg.CORBA.portable.InputStream _input, org.omg.CORBA.portable.ResponseHandler handler)
		throws org.omg.CORBA.SystemException
	{
		org.omg.CORBA.portable.OutputStream _out = null;
		// do something
		// quick lookup of operation
		java.lang.Integer opsIndex = (java.lang.Integer)m_opsHash.get ( method );
		if ( null == opsIndex )
			throw new org.omg.CORBA.BAD_OPERATION(method + " not found");
		switch ( opsIndex.intValue() )
		{
			case 0: // hello_simple
			{
				_out = handler.createReply();
				java.lang.String tmpResult1 = hello_simple();
_out.write_string( tmpResult1 );
				break;
			}
			case 1: // test
			{
			try
			{
				_out = handler.createReply();
				test();
			}
			catch(test.interop.wchar_tao_interop.GoodDayPackage.WStringException _ex0)
			{
				_out = handler.createExceptionReply();
				test.interop.wchar_tao_interop.GoodDayPackage.WStringExceptionHelper.write(_out, _ex0);
				if (handler instanceof org.jacorb.orb.dsi.ServerRequest && !test.interop.wchar_tao_interop.GoodDayPackage.WStringExceptionHelper.id().equals(_ex0.getMessage()))
				{
					((org.jacorb.orb.giop.ReplyOutputStream)_out).addServiceContext (org.jacorb.orb.dsi.ServerRequest.createExceptionDetailMessage (_ex0.getMessage()));
				}
			}
				break;
			}
			case 2: // hello_wide
			{
				java.lang.String _arg0=_input.read_wstring();
				_out = handler.createReply();
				java.lang.String tmpResult2 = hello_wide(_arg0);
_out.write_wstring( tmpResult2 );
				break;
			}
		}
		return _out;
	}

	public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] obj_id)
	{
		return ids;
	}
}
