KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > core > body > LocalBodyStrategy


1 /*
2  * ################################################################
3  *
4  * ProActive: The Java(TM) library for Parallel, Distributed,
5  * Concurrent computing with Security and Mobility
6  *
7  * Copyright (C) 1997-2002 INRIA/University of Nice-Sophia Antipolis
8  * Contact: proactive-support@inria.fr
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23  * USA
24  *
25  * Initial developer(s): The ProActive Team
26  * http://www.inria.fr/oasis/ProActive/contacts.html
27  * Contributor(s):
28  *
29  * ################################################################
30  */

31 package org.objectweb.proactive.core.body;
32
33 import org.objectweb.proactive.core.body.future.Future;
34 import org.objectweb.proactive.core.body.future.FuturePool;
35 import org.objectweb.proactive.core.body.request.BlockingRequestQueue;
36 import org.objectweb.proactive.core.body.request.Request;
37 import org.objectweb.proactive.core.mop.MethodCall;
38 import org.objectweb.proactive.ext.security.RenegotiateSessionException;
39
40
41 /**
42  * <P>
43  * An object implementing this interface is an implementation of one part
44  * of the local view of the body of an active object. This interface define
45  * only one part of the local view and is used to be able to change easily the
46  * strategy of a body. Typically, after a body migrates, it is necessary to change
47  * the its local implementation.
48  * </P>
49  * @author ProActive Team
50  * @version 1.0, 2001/10/23
51  * @since ProActive 0.9
52  */

53 public interface LocalBodyStrategy {
54
55     /**
56      * Returns the future pool of this body
57      * @return the future pool of this body
58      */

59     public FuturePool getFuturePool();
60
61     /**
62      * Returns the request queue associated to this body
63      * @return the request queue associated to this body
64      */

65     public BlockingRequestQueue getRequestQueue();
66
67     /**
68      * Returns the reified object that body is for
69      * The reified object is the object that has been turned active.
70      * @return the reified object that body is for
71      */

72     public Object JavaDoc getReifiedObject();
73
74     /**
75      * Returns the name of this body that can be used for displaying information
76      * @return the name of this body
77      */

78     public String JavaDoc getName();
79
80     /**
81      * Sends the request <code>request</code> with the future <code>future</code> to the local body
82      * <code>body</code>.
83      * @param methodCall the methodCall to send
84      * @param future the future associated to the request
85      * @param destinationBody the body the request is sent to
86      * @exception java.io.IOException if the request cannot be sent to the destination body
87      */

88     public void sendRequest(MethodCall methodCall, Future future,
89         UniversalBody destinationBody)
90         throws java.io.IOException JavaDoc, RenegotiateSessionException;
91     ;
92
93     /**
94      * Serves the request <code>request</code> by the invoking the targeted method on the
95      * reified object. Some specific type of request may involve special processing that
96      * does not trigger a method on the reified object.
97      * @param request the request to serve
98      */

99     public void serve(Request request);
100 }
101
Popular Tags