KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonathan > apis > protocols > Session_Low


1 /***
2  * Jonathan: an Open Distributed Processing Environment
3  * Copyright (C) 1999 France Telecom R&D
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  * Release: 2.0
20  *
21  * Contact: jonathan@objectweb.org
22  *
23  * Author: Bruno Dumant
24  *
25  */

26
27
28 package org.objectweb.jonathan.apis.protocols;
29
30 import org.objectweb.jonathan.apis.kernel.JonathanException;
31 import org.objectweb.jonathan.apis.presentation.UnMarshaller;
32
33 /**
34  * <code>Session_Low</code> is the type of sessions used to forward messages
35  * coming from the network to their actual recipient; <code>Session_Low</code> is
36  * also the type of interfaces represented by {@link SessionIdentifier session
37  * identifiers}.
38  * <p>
39  * Sessions represent handles on particular communication channels: A session
40  * object is dynamically created by a protocol, and lets messages be sent and
41  * received through the communication channel it represents, using that
42  * protocol. Sessions have {@link Session_High higher} and {@link Session_Low lower}
43  * interfaces, respectively used to send messages down and up a protocol stack.
44  * <p>
45  * <code>Session_Low</code> is also the type of interfaces
46  * {@link ProtocolGraph#export(Session_Low) exported} to protocols, and
47  * designated by {@link SessionIdentifier session identifiers}.
48  */

49 public interface Session_Low {
50    /**
51     * Sends a message up a protocol stack.
52     * <p>
53     * This method is used to send an incoming message to its recipient. The
54     * provided <code>session</code> parameter represents the sender, and may
55     * possibly be used to send a reply if necessary. This <code>session</code>
56     * parameter may be null.
57     * <p>
58     * When this method is used, the target object must make sure that the provided
59     * message will be {@link UnMarshaller#close() closed}, as well as and the
60     * {@link Session_High#close() session} (if not null).
61     *
62     * @param message the message to send up;
63     * @param session the sending session.
64     * @exception JonathanException if the sending fails.
65     */

66    public void send(UnMarshaller message,Session_High session)
67       throws JonathanException;
68
69    /**
70     * Sends an exception up a protocol stack.
71     * <p>
72     * This method is used to warn the target session that an exception
73     * has occurred on an incoming message. The
74     * provided <code>session</code> parameter represents the sender, and may
75     * possibly be used to send a reply if necessary. This <code>session</code>
76     * parameter may be null.
77     * <p>
78     * When this method is used, the target object must make sure that the provided
79     * session will be {@link Session_High#close() closed}(if not null).
80     *
81     * @param exception the exception that occurred;
82     * @param session the sending session.
83     */

84    public void send(JonathanException exception,Session_High session);
85 }
86
87
88
Popular Tags