KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > controller > recoverylog > RecoveryTask


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2005 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Emmanuel Cecchet.
22  * Contributor(s): Julie Marguerite.
23  */

24
25 package org.objectweb.cjdbc.controller.recoverylog;
26
27 import org.objectweb.cjdbc.controller.loadbalancer.tasks.AbstractTask;
28
29 /**
30  * Recovery task containing an <code>AbstractTask</code> and the id of the
31  * task in the recovery log.
32  *
33  * @author <a HREF="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
34  * @author <a HREF="mailto:Julie.Marguerite@inria.fr">Julie Marguerite </a>
35  * @version 1.0
36  */

37 public class RecoveryTask
38 {
39   private long id;
40   private long tid;
41   private AbstractTask task;
42
43   /**
44    * Constructs a new <code>RecoveryTask</code> instance.
45    *
46    * @param tid transaction id
47    * @param id task id in the recovery log
48    * @param task task to be executed
49    */

50   public RecoveryTask(long tid, long id, AbstractTask task)
51   {
52     this.id = id;
53     this.tid = tid;
54     this.task = task;
55   }
56
57   /**
58    * Returns the tid value.
59    *
60    * @return Returns the tid.
61    */

62   public long getTid()
63   {
64     return tid;
65   }
66
67   /**
68    * Returns the id.
69    *
70    * @return int
71    */

72   public long getId()
73   {
74     return id;
75   }
76
77   /**
78    * Returns the task.
79    *
80    * @return AbstractTask
81    */

82   public AbstractTask getTask()
83   {
84     return task;
85   }
86
87   /**
88    * Sets the id.
89    *
90    * @param id the id to set
91    */

92   public void setId(long id)
93   {
94     this.id = id;
95   }
96
97   /**
98    * Sets the task.
99    *
100    * @param task the task to set
101    */

102   public void setTask(AbstractTask task)
103   {
104     this.task = task;
105   }
106 }
107
Popular Tags