View Javadoc

1   package com.explosion.utilities.process;
2   
3   /*
4    * =============================================================================
5    * 
6    * Copyright 2004 Stephen Cowx
7    * 
8    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
9    * use this file except in compliance with the License. You may obtain a copy of
10   * the License at
11   * 
12   * http://www.apache.org/licenses/LICENSE-2.0
13   * 
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17   * License for the specific language governing permissions and limitations under
18   * the License.
19   * 
20   * =============================================================================
21   */
22  
23  import com.explosion.utilities.process.threads.Process;
24  import com.explosion.utilities.process.threads.ProcessThread;
25  
26  /***
27   * @author Stephen Cowx
28   * 
29   * This is a convenience class for allowing methods to ignore the fact that they
30   * don;t have a process to work with. it prevents a whole lot of null checks.
31   * 
32   * Probably very naughty.  There must be a better way to do this.
33   * @TODO Refoctor out DummySimpleProcess
34   * Date created:@13-Feb-2003
35   */
36  public class DummySimpleProcess implements Process
37  {
38  
39      public DummySimpleProcess()
40      {}
41  
42      /***
43       * @see com.explosion.utilities.process.threads.Process#getPercentComplete()
44       */
45      public int getPercentComplete()
46      {
47          return 0;
48      }
49  
50      /***
51       * @see com.explosion.utilities.process.threads.Process#getProcessControl()
52       */
53      public ProcessThread getProcessControl()
54      {
55          return null;
56      }
57  
58      /***
59       * @see com.explosion.utilities.process.threads.Process#getStatusText()
60       */
61      public String getStatusText()
62      {
63          return null;
64      }
65  
66      /***
67       * @see com.explosion.utilities.process.threads.Process#isStopped()
68       */
69      public boolean isStopped()
70      {
71          return false;
72      }
73  
74      /***
75       * @see com.explosion.utilities.process.threads.Process#setPercentComplete(int)
76       */
77      public void setPercentComplete(int percentComplete)
78      {}
79  
80      /***
81       * @see com.explosion.utilities.process.threads.Process#setProcessControl(ProcessThread)
82       */
83      public void setProcessControl(ProcessThread processThread)
84      {}
85  
86      /***
87       * @see com.explosion.utilities.process.threads.Process#setStatusText(String)
88       */
89      public void setStatusText(String statusText)
90      {}
91  
92      public void log(String string)
93      {}
94  
95      public void log(Exception exception, String message)
96      {}
97  
98      /***
99       * Returns a boolean value indicating whther this is a user process or not
100      * @return
101      */
102     public boolean isUserProcess()
103     {
104         return false;
105     }
106     
107     /***
108      * Sets whtether or not this is a user process.  True means that it is
109      * @param truth
110      */
111     public void setIsUserProcess(boolean truth)
112     {}       
113     
114 }