Source Code Cross Referenced for Mailet.java in  » Net » james-2.3.1 » org » apache » mailet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » james 2.3.1 » org.apache.mailet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /****************************************************************
002:         * Licensed to the Apache Software Foundation (ASF) under one   *
003:         * or more contributor license agreements.  See the NOTICE file *
004:         * distributed with this work for additional information        *
005:         * regarding copyright ownership.  The ASF licenses this file   *
006:         * to you under the Apache License, Version 2.0 (the            *
007:         * "License"); you may not use this file except in compliance   *
008:         * with the License.  You may obtain a copy of the License at   *
009:         *                                                              *
010:         *   http://www.apache.org/licenses/LICENSE-2.0                 *
011:         *                                                              *
012:         * Unless required by applicable law or agreed to in writing,   *
013:         * software distributed under the License is distributed on an  *
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
015:         * KIND, either express or implied.  See the License for the    *
016:         * specific language governing permissions and limitations      *
017:         * under the License.                                           *
018:         ****************************************************************/package org.apache.mailet;
019:
020:        /**
021:         * Draft of a Mailet inteface. The <code>service</code> perform all needed work
022:         * on the Mail object. Whatever remains at the end of the service is considered
023:         * to need futher processing and will go to the next Mailet if there is one
024:         * configured or will go to the error processor if not.
025:         * Setting a Mail state (setState(String)) to Mail.GHOST or cleaning its recipient
026:         * list has the same meaning that s no more processing is needed.
027:         * Instead of creating new messages, the mailet can put a message with new recipients
028:         * at the top of the mail queue, or insert them immediately after it's execution
029:         * through the API are provided by the MailetContext interface.
030:         * <p>
031:         * This interface defines methods to initialize a mailet, to service messages, and to
032:         * remove a mailet from the server. These are known as life-cycle methods and are called
033:         * in the following sequence:
034:         * <ol>
035:         * <li>The mailet is constructed, then initialized with the init method. </li>
036:         * <li>Any messages for the service method are handled.</li>
037:         * <li>The mailet is taken out of service, then destroyed with the destroy method,
038:         *      then garbage collected and finalized.</li>
039:         * </ol>
040:         * In addition to the life-cycle methods, this interface provides the getMailetConfig
041:         * method, which the mailet can use to get any startup information, and the
042:         * getMailetInfo method, which allows the mailet to return basic information about itself,
043:         * such as author, version, and copyright.
044:         *
045:         * @version 1.0.0, 24/04/1999
046:         */
047:        public interface Mailet {
048:
049:            /**
050:             * Called by the mailet container to indicate to a mailet that the
051:             * mailet is being taken out of service. This method is only called once
052:             * all threads within the mailet's service method have exited or after a
053:             * timeout period has passed. After the mailet container calls this method,
054:             * it will not call the service method again on this mailet.
055:             * <p>
056:             * This method gives the mailet an opportunity to clean up any resources that
057:             * are being held (for example, memory, file handles, threads) and make sure
058:             * that any persistent state is synchronized with the mailet's current state in memory.
059:             */
060:            void destroy();
061:
062:            /**
063:             * Returns information about the mailet, such as author, version, and
064:             * copyright.
065:             * <p>
066:             * The string that this method returns should be plain text and not markup
067:             * of any kind (such as HTML, XML, etc.).
068:             *
069:             * @return a String containing servlet information
070:             */
071:            String getMailetInfo();
072:
073:            /**
074:             * Returns a MailetConfig object, which contains initialization and
075:             * startup parameters for this mailet.
076:             * <p>
077:             * Implementations of this interface are responsible for storing the MailetConfig
078:             * object so that this method can return it. The GenericMailet class, which implements
079:             * this interface, already does this.
080:             *
081:             * @return the MailetConfig object that initializes this mailet
082:             */
083:            MailetConfig getMailetConfig();
084:
085:            /**
086:             * Called by the mailet container to indicate to a mailet that the
087:             * mailet is being placed into service.
088:             * <p>
089:             * The mailet container calls the init method exactly once after
090:             * instantiating the mailet. The init method must complete successfully
091:             * before the mailet can receive any requests.
092:             *
093:             * @param config - a MailetConfig object containing the mailet's configuration
094:             *          and initialization parameters
095:             * @throws javax.mail.MessagingException - if an exception has occurred that interferes with
096:             *          the mailet's normal operation
097:             */
098:            void init(MailetConfig config) throws javax.mail.MessagingException;
099:
100:            /**
101:             * Called by the mailet container to allow the mailet to process to
102:             * a message.
103:             * <p>
104:             * This method is only called after the mailet's init() method has completed
105:             * successfully.
106:             * <p>
107:             * Mailets typically run inside multithreaded mailet containers that can handle
108:             * multiple requests concurrently. Developers must be aware to synchronize access
109:             * to any shared resources such as files, network connections, as well as the
110:             * mailet's class and instance variables. More information on multithreaded
111:             * programming in Java is available in <a href="http://java.sun.com/Series/Tutorial/java/threads/multithreaded.html">the
112:             * Java tutorial on multi-threaded programming</a>.
113:             *
114:             * @param mail - the Mail object that contains the message and routing information
115:             * @throws javax.mail.MessagingException - if a message or address parsing exception occurs or
116:             *      an exception that interferes with the mailet's normal operation
117:             */
118:            void service(Mail mail) throws javax.mail.MessagingException;
119:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.