View Javadoc

1   /**
2      This file is part of GoldenGate Project (named also GoldenGate or GG).
3   
4      Copyright 2009, Frederic Bregier, and individual contributors by the @author
5      tags. See the COPYRIGHT.txt in the distribution for a full listing of
6      individual contributors.
7   
8      All GoldenGate Project is free software: you can redistribute it and/or 
9      modify it under the terms of the GNU General Public License as published 
10     by the Free Software Foundation, either version 3 of the License, or
11     (at your option) any later version.
12  
13     GoldenGate is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17  
18     You should have received a copy of the GNU General Public License
19     along with GoldenGate .  If not, see <http://www.gnu.org/licenses/>.
20   */
21  package openr66.protocol.utils;
22  
23  import goldengate.common.future.GgFuture;
24  import openr66.context.R66Result;
25  import openr66.database.data.DbTaskRunner;
26  
27  /**
28   * Future implementation
29   * @author Frederic Bregier
30   *
31   */
32  public class R66Future extends GgFuture {
33  
34      private R66Result result = null;
35      /**
36       * Used in some specific occasion, such as client submission in API mode
37       */
38      public DbTaskRunner runner = null;
39      public long filesize = 0;
40  
41      /**
42       *
43       */
44      public R66Future() {
45      }
46  
47      /**
48       * @param cancellable
49       */
50      public R66Future(boolean cancellable) {
51          super(cancellable);
52      }
53  
54      /**
55       * @return the result
56       */
57      public R66Result getResult() {
58          return result;
59      }
60  
61      /**
62       * @param result
63       *            the result to set
64       */
65      public void setResult(R66Result result) {
66          this.result = result;
67      }
68  
69      @Override
70      public String toString() {
71          return "Future: " + isDone() + " " + isSuccess() + " " +
72                  (getCause() != null? getCause().getMessage() : "no cause") +
73                  " " + (result != null? result.toString() : "no result");
74      }
75  }