votepoa.java

来自「java的一个投票体系。客户端可以根据服务器返回的投票清单」· Java 代码 · 共 90 行

JAVA
90
字号
package VoteApp;


/**
* VoteApp/VotePOA.java .
* 由 IDL-to-Java 编译器(可移植),版本 "3.2" 生成
* 来自 vote.idl
* 2009年5月10日 星期日 下午04时07分46秒 CST
*/

public abstract class VotePOA extends org.omg.PortableServer.Servant
 implements VoteApp.VoteOperations, org.omg.CORBA.portable.InvokeHandler
{

  // Constructors

  private static java.util.Hashtable _methods = new java.util.Hashtable ();
  static
  {
    _methods.put ("getList", new java.lang.Integer (0));
    _methods.put ("castVote", new java.lang.Integer (1));
    _methods.put ("shutdown", new java.lang.Integer (2));
  }

  public org.omg.CORBA.portable.OutputStream _invoke (String $method,
                                org.omg.CORBA.portable.InputStream in,
                                org.omg.CORBA.portable.ResponseHandler $rh)
  {
    org.omg.CORBA.portable.OutputStream out = null;
    java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
    if (__method == null)
      throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);

    switch (__method.intValue ())
    {
       case 0:  // VoteApp/Vote/getList
       {
         String $result = null;
         $result = this.getList ();
         out = $rh.createReply();
         out.write_string ($result);
         break;
       }

       case 1:  // VoteApp/Vote/castVote
       {
         String nameOfCandicate = in.read_string ();
         this.castVote (nameOfCandicate);
         out = $rh.createReply();
         break;
       }

       case 2:  // VoteApp/Vote/shutdown
       {
         this.shutdown ();
         out = $rh.createReply();
         break;
       }

       default:
         throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
    }

    return out;
  } // _invoke

  // Type-specific CORBA::Object operations
  private static String[] __ids = {
    "IDL:VoteApp/Vote:1.0"};

  public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
  {
    return (String[])__ids.clone ();
  }

  public Vote _this() 
  {
    return VoteHelper.narrow(
    super._this_object());
  }

  public Vote _this(org.omg.CORBA.ORB orb) 
  {
    return VoteHelper.narrow(
    super._this_object(orb));
  }


} // class VotePOA

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?