KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > mail > factory > JavaMailResourceMBean


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or 1any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JavaMailResourceMBean.java,v 1.2 2004/08/19 09:30:22 danesa Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.mail.factory;
27
28 //import java
29
import java.util.Properties JavaDoc;
30
31 import javax.management.MBeanException JavaDoc;
32 import javax.management.NotificationFilter JavaDoc;
33 import javax.management.NotificationListener JavaDoc;
34 // jakarta-commons
35
import org.apache.commons.modeler.BaseModelMBean;
36 import org.objectweb.jonas.server.J2EEServer;
37
38 /**
39  * This interface defines all the management methods provided by the JavaMailResource objects.
40  * @author Florent Benoit
41  * @author Ludovic Bert
42  * @author Adriana Danes:
43  * - Refactor code: rename the management methods (use straightforward names, as they are to be used in a Management Console)
44  * - J2EEManagement conformance
45  * - Use jakarta-commons modeler
46  */

47 public class JavaMailResourceMBean extends BaseModelMBean {
48     /**
49      * Default constructor
50      * @throws MBeanException if super constructor fails
51      */

52     public JavaMailResourceMBean() throws MBeanException JavaDoc {
53         super();
54     }
55
56     /**
57      * Get the name of the factory.
58      * @return name of the mail factory.
59      */

60     String JavaDoc getFactoryName() {
61         return (String JavaDoc) ((JavaMailResource) this.resource).getFactoryName();
62     }
63
64     /**
65      * Get the name of the factory.
66      * @return name of the mail factory.
67      */

68     String JavaDoc getName() {
69         return (String JavaDoc) ((JavaMailResource) this.resource).getName();
70     }
71
72     /**
73      * Set the name of the factory.
74      * @param name name of the mail factory.
75      */

76     void setName(String JavaDoc name) {
77         ((JavaMailResource) this.resource).setName(name);
78     }
79
80     /**
81      * Get the type of the factory.
82      * @return type of the mail factory.
83      */

84     String JavaDoc getFactoryType() {
85         return (String JavaDoc) ((JavaMailResource) this.resource).getFactoryType();
86     }
87
88
89     /**
90      * Get the authentication properties.
91      * @return properties of the authentication.
92      */

93     Properties JavaDoc getAuthenticationProperties() {
94         return (Properties JavaDoc) ((JavaMailResource) this.resource).getAuthenticationProperties();
95     }
96
97     /**
98      * Set the authentication properties.
99      * @param props the authentication properties.
100      */

101     void setAuthenticationProperties(Properties JavaDoc props) {
102         ((JavaMailResource) this.resource).setAuthenticationProperties(props);
103     }
104
105     /**
106      * Get the session properties.
107      * @return the properties of Session.
108      */

109     Properties JavaDoc getSessionProperties() {
110         return (Properties JavaDoc) ((JavaMailResource) this.resource).getSessionProperties();
111     }
112
113     /**
114      * Set the session properties.
115      * @param props the Session properties.
116      */

117     void setSessionProperties(Properties JavaDoc props) {
118         ((JavaMailResource) this.resource).setSessionProperties(props);
119     }
120
121     /**
122      * Save updated configuration
123      */

124     void saveConfig() {
125         ((JavaMailResource) this.resource).saveConfig();
126     }
127
128     /**
129      * Add a new listener.
130      * @param pListner Listener to notify
131      * @param pFilter Notification filter
132      * @param pHandback ??
133      * @throws java.lang.IllegalArgumentException if notification is not done
134      */

135     public void addNotificationListener(NotificationListener JavaDoc pListner, NotificationFilter JavaDoc pFilter,
136             java.lang.Object JavaDoc pHandback) throws java.lang.IllegalArgumentException JavaDoc {
137         ((JavaMailResource) (this.resource)).addNotificationListener(pListner, pFilter, pHandback);
138     }
139 }
140
141
Popular Tags