_ChatServiceStub.java
资源名称:chat.zip [点击查看]
上传用户:annion2008
上传日期:2021-03-11
资源大小:38k
文件大小:4k
源码类别:
中间件编程
开发平台:
Java
- package chat.servidor;
- /**
- * chat/servidor/_ChatServiceStub.java .
- * 由 IDL-to-Java 编译器(可移植),版本 "3.2" 生成
- * 来自 ChatServide.idl
- * 2010年4月12日 星期一 下午06时04分51秒 CST
- */
- public class _ChatServiceStub extends org.omg.CORBA.portable.ObjectImpl implements chat.servidor.ChatService
- {
- public String[] conectar (String apelido, chat.cliente.ClientListener listener)
- {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request ("conectar", true);
- $out.write_string (apelido);
- chat.cliente.ClientListenerHelper.write ($out, listener);
- $in = _invoke ($out);
- String $result[] = chat.ListaClientesHelper.read ($in);
- return $result;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream ();
- String _id = $ex.getId ();
- throw new org.omg.CORBA.MARSHAL (_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- return conectar (apelido, listener );
- } finally {
- _releaseReply ($in);
- }
- } // conectar
- public void desconectar (String apelido, chat.cliente.ClientListener listener)
- {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request ("desconectar", true);
- $out.write_string (apelido);
- chat.cliente.ClientListenerHelper.write ($out, listener);
- $in = _invoke ($out);
- return;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream ();
- String _id = $ex.getId ();
- throw new org.omg.CORBA.MARSHAL (_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- desconectar (apelido, listener );
- } finally {
- _releaseReply ($in);
- }
- } // desconectar
- public void enviaMensagem (String apelido, chat.Mensagem msg)
- {
- org.omg.CORBA.portable.InputStream $in = null;
- try {
- org.omg.CORBA.portable.OutputStream $out = _request ("enviaMensagem", true);
- $out.write_string (apelido);
- chat.MensagemHelper.write ($out, msg);
- $in = _invoke ($out);
- return;
- } catch (org.omg.CORBA.portable.ApplicationException $ex) {
- $in = $ex.getInputStream ();
- String _id = $ex.getId ();
- throw new org.omg.CORBA.MARSHAL (_id);
- } catch (org.omg.CORBA.portable.RemarshalException $rm) {
- enviaMensagem (apelido, msg );
- } finally {
- _releaseReply ($in);
- }
- } // enviaMensagem
- // Type-specific CORBA::Object operations
- private static String[] __ids = {
- "IDL:chat/servidor/ChatService:1.0"};
- public String[] _ids ()
- {
- return (String[])__ids.clone ();
- }
- private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
- {
- String str = s.readUTF ();
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
- try {
- org.omg.CORBA.Object obj = orb.string_to_object (str);
- org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
- _set_delegate (delegate);
- } finally {
- orb.destroy() ;
- }
- }
- private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
- {
- String[] args = null;
- java.util.Properties props = null;
- org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
- try {
- String str = orb.object_to_string (this);
- s.writeUTF (str);
- } finally {
- orb.destroy() ;
- }
- }
- } // class _ChatServiceStub