_Java Q&A_
by Cliff Berg

Listing One
interface ChatServerSvcs
{
   string getUniqueName(in string baseName)
         raises (Project::CannotEstablishConnection);
   void open(in string clientName, in ChatClientSvcs cc)
         raises (Project::CannotEstablishConnection);
   void close(in string clientName)
         raises (UnidentifiedUser);
   void putc(in char cin);
   void puts(in string sin);
   void putLine(in string sin);
   void backspace();
   UserList getUsers();
   void identifySelf(in string oldname, in string newname)
         raises (NonUniqueUser, UnidentifiedUser);
};

Listing Two
interface ChatClientSvcs
{
   void putc(in char cin);

   void puts(in string sin);
   void putLine(in string sin);
   void backspace();
};

Listing Three
public void backspace()
{
   textArea.appendText("");    // position insert position at the end
   int curpos = textArea.getSelectionStart();
   if (curpos == 0) return;
   textArea.replaceText("", curpos-1, curpos);
}

Listing Four
orb = CORBA.ORB.init();
boa = orb.BOA_init();
chatServerSvcs = new ChatServerSvcsImpl(NAME_OF_CHAT_SERVER_SVCS);
boa.obj_is_ready(chatServerSvcs);
boa.impl_is_ready();
Listing Five
userName = chatServerSvcs.getUniqueName(BASE_NAME_OF_CHAT_CLIENT_SVCS + ".");
boa = orb.BOA_init();
chatClientSvcs = new ChatClientSvcsImpl(userName, textArea);
boa.obj_is_ready(chatClientSvcs);
chatServerSvcs.open(userName, chatClientSvcs);



