ChatServicePOA.java
资源名称:chat.zip [点击查看]
上传用户:annion2008
上传日期:2021-03-11
资源大小:38k
文件大小:3k
源码类别:
中间件编程
开发平台:
Java
- package chat.servidor;
- /**
- * chat/servidor/ChatServicePOA.java .
- * 由 IDL-to-Java 编译器(可移植),版本 "3.2" 生成
- * 来自 ChatServide.idl
- * 2010年4月12日 星期一 下午06时04分51秒 CST
- */
- public abstract class ChatServicePOA extends org.omg.PortableServer.Servant
- implements chat.servidor.ChatServiceOperations, org.omg.CORBA.portable.InvokeHandler
- {
- // Constructors
- private static java.util.Hashtable _methods = new java.util.Hashtable ();
- static
- {
- _methods.put ("conectar", new java.lang.Integer (0));
- _methods.put ("desconectar", new java.lang.Integer (1));
- _methods.put ("enviaMensagem", 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: // chat/servidor/ChatService/conectar
- {
- String apelido = in.read_string ();
- chat.cliente.ClientListener listener = chat.cliente.ClientListenerHelper.read (in);
- String $result[] = null;
- $result = this.conectar (apelido, listener);
- out = $rh.createReply();
- chat.ListaClientesHelper.write (out, $result);
- break;
- }
- case 1: // chat/servidor/ChatService/desconectar
- {
- String apelido = in.read_string ();
- chat.cliente.ClientListener listener = chat.cliente.ClientListenerHelper.read (in);
- this.desconectar (apelido, listener);
- out = $rh.createReply();
- break;
- }
- case 2: // chat/servidor/ChatService/enviaMensagem
- {
- String apelido = in.read_string ();
- chat.Mensagem msg = chat.MensagemHelper.read (in);
- this.enviaMensagem (apelido, msg);
- 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:chat/servidor/ChatService:1.0"};
- public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
- {
- return (String[])__ids.clone ();
- }
- public ChatService _this()
- {
- return ChatServiceHelper.narrow(
- super._this_object());
- }
- public ChatService _this(org.omg.CORBA.ORB orb)
- {
- return ChatServiceHelper.narrow(
- super._this_object(orb));
- }
- } // class ChatServicePOA