KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > core > group > spmd > MethodCallSetSPMDGroup


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.group.spmd;
32
33 import java.lang.reflect.InvocationTargetException JavaDoc;
34
35 import org.objectweb.proactive.ProActive;
36 import org.objectweb.proactive.core.body.AbstractBody;
37 import org.objectweb.proactive.core.group.MethodCallControlForGroup;
38 import org.objectweb.proactive.core.mop.MethodCallExecutionFailedException;
39
40 /**
41  * @author Laurent Baduel
42  */

43 public class MethodCallSetSPMDGroup extends MethodCallControlForGroup {
44
45     /**
46      * Builds a method call to set the SPMD group
47      * @param smpgGroup - the SPMD group to set
48      */

49     public MethodCallSetSPMDGroup(Object JavaDoc smpgGroup) {
50         Object JavaDoc[] objTab = new Object JavaDoc[1];
51         objTab[0] = smpgGroup;
52         this.setEffectiveArguments(objTab);
53     }
54
55     /**
56      * Returns the name of the call
57      * @return the String "MethodCallSetSPMDGroup";
58      */

59     public String JavaDoc getName() {
60         return "MethodCallSetSPMDGroup";
61     }
62
63     /**
64      * This call have one parameter.
65      * @return 1
66      * @see org.objectweb.proactive.core.mop.MethodCall#getNumberOfParameter()
67      */

68     public int getNumberOfParameter() {
69         return 1;
70     }
71
72     /**
73      * Executes the call.
74      * @see org.objectweb.proactive.core.mop.MethodCall#execute(java.lang.Object)
75      */

76     public Object JavaDoc execute(Object JavaDoc targetObject)
77         throws InvocationTargetException JavaDoc, MethodCallExecutionFailedException {
78         
79         AbstractBody body = (AbstractBody) ProActive.getBodyOnThis();
80         body.setSPMDGroup(this.getParameter(0));
81         return null;
82     }
83
84 }
85
Popular Tags