KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > alt > javax > mail > ServiceImpl


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