package Ensembl.artemis;

/** stream-based skeleton class */

public abstract class EntryPOA
	extends org.omg.PortableServer.Servant
	implements org.omg.CORBA.portable.InvokeHandler, Ensembl.artemis.EntryOperations
{
	static private final java.util.Hashtable m_opsHash = new java.util.Hashtable();
	static
	{
		m_opsHash.put ( "getSequence", new java.lang.Integer(0));
		m_opsHash.put ( "getAllFeatures", new java.lang.Integer(1));
		m_opsHash.put ( "getFeatureCount", new java.lang.Integer(2));
		m_opsHash.put ( "getName", new java.lang.Integer(3));
	}
	private String[] ids = {"IDL:Ensembl/artemis/Entry:1.0"};
	public Ensembl.artemis.Entry _this()
	{
		return Ensembl.artemis.EntryHelper.narrow(_this_object());
	}
	public Ensembl.artemis.Entry _this(org.omg.CORBA.ORB orb)
	{
		return Ensembl.artemis.EntryHelper.narrow(_this_object(orb));
	}
	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: // getSequence
			{
				_out = handler.createReply();
				Ensembl.artemis.BioSequenceHelper.write(_out,getSequence());
				break;
			}
			case 1: // getAllFeatures
			{
				_out = handler.createReply();
				Ensembl.artemis.FeatureListHelper.write(_out,getAllFeatures());
				break;
			}
			case 2: // getFeatureCount
			{
				_out = handler.createReply();
				_out.write_long(getFeatureCount());
				break;
			}
			case 3: // getName
			{
				_out = handler.createReply();
				_out.write_string(getName());
				break;
			}
		}
		return _out;
	}

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