KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > mail > MailService


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 any 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  * Initial developer(s): Florent BENOIT & Ludovic BERT
22  * --------------------------------------------------------------------------
23  * $Id: MailService.java,v 1.7 2004/04/09 10:00:58 benoitf Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas.mail;
28
29 //import java.util
30
import java.util.Properties JavaDoc;
31
32 //import jonas
33
import org.objectweb.jonas.service.Service;
34 import org.objectweb.jonas.mail.factory.JavaMail;
35
36 /**
37  * This interface provides a description of the JavaMail service.
38  * @author Ludovic Bert
39  * @author Florent Benoit
40  */

41 public interface MailService extends Service {
42
43     /**
44      * Create a mail factory with the specified properties and register it into
45      * the registry. The created object is an instance of one of the 2 classes :
46      * JavaMailSession or JavaMailMimePartDS.
47      * @param name the mail factory name
48      * @param props the properties used to configure the mail factory.
49      * @throws MailServiceException if the creation or the registration of the
50      * factory failed.
51      */

52     void createMailFactory(String JavaDoc name, Properties JavaDoc props) throws MailServiceException;
53
54     /**
55      * This method is used when a Mail Factory configuration is modified via
56      * jonasAdmin. In this case, the updated JavaMail object (JavaMailSession or
57      * JavaMailMimePartDS object) must be rebound in JNDI
58      * @param factory the factory
59      * @throws MailServiceException if the recreation of the factory failed.
60      */

61     void recreateJavaMailFactory(JavaMail factory) throws MailServiceException;
62
63     /**
64      * This method is used when a particular Mail Factory configuration
65      * operation is done via jonasAdmin : when the JNDI name of this resource is
66      * modified. In this case, the initial JavaMail object (JavaMailSession or
67      * JavaMailMimePartDS object) must be unbound and the updated JavaMail
68      * object must be reloaded. Also, the Mail Service private data structures
69      * must be updated.
70      * @param oldName old name of the factory
71      * @param factory the new factory
72      * @throws MailServiceException if the rename of the the factory failed.
73      */

74     void renameJavaMailFactory(String JavaDoc oldName, JavaMail factory) throws MailServiceException;
75
76     /**
77      * Unregister all the binding factories on the server.
78      * @throws MailServiceException if the unregistration of the factories
79      * failed.
80      */

81     void unbindMailFactories() throws MailServiceException;
82
83 }
Popular Tags