org/objectweb/proactive/mpi/control/ProActiveMPIData.java

00001 /* 
00002  * ################################################################
00003  * 
00004  * ProActive: The Java(TM) library for Parallel, Distributed, 
00005  *            Concurrent computing with Security and Mobility
00006  * 
00007  * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
00008  * Contact: proactive@objectweb.org
00009  * 
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or any later version.
00014  *  
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  * 
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00023  * USA
00024  *  
00025  *  Initial developer(s):               The ProActive Team
00026  *                        http://www.inria.fr/oasis/ProActive/contacts.html
00027  *  Contributor(s): 
00028  * 
00029  * ################################################################
00030  */ 
00031 package org.objectweb.proactive.mpi.control;
00032 
00033 public class ProActiveMPIData implements java.io.Serializable {
00034     private int jobID = 0;
00035     private int TAG1 = 0;
00036 
00037     // number of element in the message
00038     private int count = 0;
00039 
00040     // form sender of the message
00041     private int src = 0;
00042 
00043     // receiver of message
00044     private int dest = 0;
00045 
00046     // type of data in buffer
00047     private int datatype = 0;
00048 
00049     // special tag
00050     private int tag = 0;
00051 
00052     // name of the method called on user object
00053     private String method = null;
00054 
00055     //  name of the method called on user object
00056     private String clazz = null;
00057 
00058     // data
00059     private byte[] data;
00060 
00061     // parameters call from native code 
00062     private String parameters;
00063 
00064     // the tab of parameters
00065     private String[] params;
00066 
00070     public void setJobID(int idJob) {
00071         this.jobID = idJob;
00072     }
00073 
00074     public void setData(byte[] data) {
00075         //  this.data = new byte[data.length];
00076         this.data = data;
00077     }
00078 
00079     public void parseParameters() {
00080         if (parameters != null) {
00081             this.params = parameters.split("\t");
00082         }
00083     }
00084 
00085     public void setCount(int count) {
00086         this.count = count;
00087     }
00088 
00089     public void setSrc(int src) {
00090         this.src = src;
00091     }
00092 
00093     public void setDest(int dest) {
00094         this.dest = dest;
00095     }
00096 
00097     public void setDatatype(int datatype) {
00098         this.datatype = datatype;
00099     }
00100 
00101     public void setTag(int tag) {
00102         this.tag = tag;
00103     }
00104 
00108     public int getTag1() {
00109         return this.TAG1;
00110     }
00111 
00112     public int getSrc() {
00113         return this.src;
00114     }
00115 
00116     public int getDest() {
00117         return this.dest;
00118     }
00119 
00120     public int getjobID() {
00121         return jobID;
00122     }
00123 
00124     public String getMethod() {
00125         return method;
00126     }
00127 
00128     public String getClazz() {
00129         return clazz;
00130     }
00131 
00132     public int getDatatype() {
00133         return datatype;
00134     }
00135 
00136     public String[] getParams() {
00137         return params;
00138     }
00139 
00140     public byte[] getData() {
00141         return this.data;
00142     }
00143 
00144     public String toString() {
00145         StringBuffer sb = new StringBuffer();
00146         sb.append("\n ######## Message Received ######### ");
00147         sb.append("\n Class: ");
00148         sb.append(this.getClass().getName());
00149         sb.append("\n idJob: " + this.jobID);
00150         sb.append("\n TAG1: " + this.TAG1);
00151         sb.append("\n Count: " + this.count);
00152         sb.append("\n src: " + this.src);
00153         sb.append("\n dest: " + this.dest);
00154         sb.append("\n datatype: " + this.datatype);
00155         return sb.toString();
00156     }
00157 
00158     public int getCount() {
00159         return count;
00160     }
00161 }

Generated on Mon Jan 22 15:16:11 2007 for ProActive by  doxygen 1.5.1