1 26 27 package org.objectweb.ccm.chat.cif; 28 29 31 39 40 public class ServerImpl 41 extends org.objectweb.ccm.chat.ServerSessionComposition.ComponentImpl 42 { 43 49 50 private String name_; 51 52 53 private java.awt.Frame frame_; 54 55 private java.awt.TextArea textArea_; 56 57 63 64 public 65 ServerImpl() 66 { 67 } 68 69 75 81 87 93 public void 94 configuration_complete() 95 throws org.omg.Components.InvalidConfiguration 96 { 97 if(name_ == null) 99 throw new org.omg.Components.InvalidConfiguration(); 100 101 System.out.println("================================"); 102 System.out.println("Welcome to OpenCCM's Chat server"); 103 System.out.println("================================"); 104 } 105 106 112 117 public void 118 ccm_remove() 119 throws org.omg.Components.CCMException 120 { 121 frame_ = null; 124 } 125 126 132 137 public void 138 name(String n) 139 { 140 name_ = n; 141 142 if (frame_ != null) 143 frame_.setTitle(name_ + "'s Server GUI"); 144 } 145 150 public String 151 name() 152 { 153 return name_; 154 } 155 156 162 167 public void 168 display(String text) 169 { 170 System.out.println(text); 173 get_context().push_to_consumers( new TextEventImpl(text) ); 175 } 176 } 177 178 | Popular Tags |