1 package alt.javax.mail; 2 3 import javax.mail.MessagingException ; 4 import javax.mail.URLName ; 5 import javax.mail.event.ConnectionListener ; 6 7 public class ServiceImpl implements Service { 8 private final javax.mail.Service service; 9 10 public ServiceImpl(javax.mail.Service service){ 11 this.service = service; 12 } 13 14 public void connect() throws MessagingException { 15 service.connect(); 16 } 17 18 public void connect(String host, String user, String password) 19 throws MessagingException { 20 service.connect(host, user, password); 21 } 22 23 public void connect(String host, int port, String user, String password) 24 throws MessagingException { 25 service.connect(host, port, user, password); 26 } 27 28 public boolean isConnected(){ 29 return service.isConnected(); 30 } 31 32 public void close() throws MessagingException { 33 service.close(); 34 } 35 36 public URLName getURLName(){ 37 return service.getURLName(); 38 } 39 40 public void addConnectionListener(ConnectionListener connectionListener){ 41 service.addConnectionListener(connectionListener); 42 } 43 44 public void removeConnectionListener(ConnectionListener connectionListener){ 45 service.removeConnectionListener(connectionListener); 46 } 47 48 public String toString(){ 49 return service.toString(); 50 } 51 52 } 53 | Popular Tags |