home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / in4wjcxu / src / como / commlet / commlet.java next >
Encoding:
Java Source  |  1996-08-14  |  2.7 KB  |  102 lines

  1. /*
  2. * @(#)Commlet.java    1.0 95/11/09 Ulrich Gall & Jan Kautz
  3. *
  4. * Copyright (c) 1996 Ulrich Gall & Jan Kautz 
  5. * uhgall@cip.informatik.uni-erlangen.de
  6. * Hofmannstr. 48, D-91052 Erlangen, Germany, Fax: +49-9131-201358
  7. *
  8. * Permission to use, copy, and distribute this software
  9. * and its documentation for NON-COMMERCIAL purposes and without
  10. * fee is hereby granted provided that this copyright notice
  11. * appears in all copies. Please contact us for  further copyright 
  12. * and licensing information.
  13. *
  14. * WE MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  15. * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  16. * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  17. * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WE SHALL NOT BE LIABLE FOR
  18. * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  19. * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  20. */
  21.  
  22. package como.commlet;
  23.  
  24. import java.util.*;
  25. import como.sys.*;
  26. import como.util.*;
  27.  
  28. /**
  29.  * The interface for Commlets. You should not have to refer to this; most Commlets
  30.  * should be derived from WindowCommlet or MetaCommlet.
  31.  */
  32. public interface Commlet
  33. {
  34.     /**
  35.      * @return the name of the session
  36.      */
  37.     public String getSessionName();
  38.  
  39.     /**
  40.      * @return the name of the commlet
  41.      */
  42.     public String getCommletName();
  43.  
  44.     /**
  45.      * @return some information about the commlet
  46.      */
  47.     public String getCommletInfo();
  48.  
  49.     /**
  50.      * For MetaCommlets.
  51.      */
  52.     public void setMetaCommlet(MetaCommlet m);
  53.  
  54.     /**
  55.      * This is called after setCom has been called. If you override it, 
  56.      * call super.init() in the first line!.
  57.      */
  58.     public void init();
  59.  
  60.     /**
  61.      * This shows the commlet and does some basic inits.
  62.      * Called from outside, if it should the commlet should be shown.
  63.      */
  64.     public void showCommlet();
  65.  
  66.     /**
  67.      * This hides the commlet. Not needed at the moment by ComObj, but by
  68.      * WindowCommlet/MetaCommlet.
  69.      */
  70.     public void hideCommlet();
  71.  
  72.     /**
  73.      * Sets the corresponding ComObj for this commlet.
  74.      * @param c the ComObj
  75.      */
  76.     void setCom(ComObj c);
  77.  
  78.     /**
  79.      * Called when it will stop. In this routine you
  80.      * have to call ComObj.logout() at the end!
  81.      */
  82.     void stop();
  83.  
  84.     /**
  85.      * this Method is called, if you receive a new message.
  86.      * msg.from will be the ID of the sender. In msg.type
  87.      * you'll find the message ID.  * In msg.arg
  88.      * you'll find the object that was sent.
  89.      * @param msg the Msg
  90.      * @return true, if you handled the message (for handled messages that
  91.      * might be interesting for other commlets in a metacommlet
  92.      * do return false then!). false if not handled (like in AWT: handleEvent())
  93.      */
  94.     boolean handleMsg(Msg msg);// returns True if message has been handled
  95.  
  96.     /**
  97.      * Override this and return true if you want to permit the user u to 
  98.      * join the Commlet.
  99.      */
  100.     boolean isUserAdmitted(User u);
  101. }
  102.