KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > message > ExtensibleMessage


1 /**
2  * Dream
3  * Copyright (C) 2003-2004 INRIA Rhone-Alpes
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact : dream@objectweb.org
20  *
21  * Initial developer(s): Matthieu Leclercq
22  * Contributor(s): Vivien Quema
23  */

24
25 package org.objectweb.dream.message;
26
27 /**
28  * This interface defined methods to dynamically add or remove chunks and sub
29  * messages to this message. These methods are not defined in the
30  * <code>Message</code> interface for efficency reasons.
31  */

32 public interface ExtensibleMessage extends Message
33 {
34
35   /**
36    * Adds a chunk in this message.
37    *
38    * @param name the name of the new chunk
39    * @param chkType the type of the new chunk
40    * @param chunk the chunk instance.
41    * @throws ChunkAlreadyExistsException if this message has already a chunk
42    * with the same name
43    */

44   void addChunk(String JavaDoc name, ChunkType chkType, Object JavaDoc chunk)
45       throws ChunkAlreadyExistsException;
46
47   /**
48    * Removes and returns the chunk with the specified name
49    *
50    * @param name the name of the chunk to remove
51    * @return the removed chunk or <code>null</code> if no chunk with the
52    * specified name can be found.
53    */

54   Object JavaDoc removeChunk(String JavaDoc name);
55
56   /**
57    * Adds a sub message in this message.
58    *
59    * @param message the message to add.
60    */

61   void addSubMessage(Message message);
62
63   /**
64    * Removes the specified sub message.
65    *
66    * @param message the message to be removed.
67    * @return <code>true</code> if the message has been removed,
68    * <code>false</code> otherwise.
69    */

70   boolean removeSubMessage(Message message);
71
72   /**
73    * Removes every sub messages of this message.
74    */

75   void removeSubMessages();
76 }
Popular Tags