View Javadoc

1   /*$Id: InMemoryIdGen.java,v 1.3 2004/07/26 12:07:38 nw Exp $
2    * Created on 27-May-2004
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid 
7    * Software License version 1.2, a copy of which has been included 
8    * with this distribution in the LICENSE.txt file.  
9    *
10  **/
11  package org.astrogrid.applications.manager.idgen;
12  
13  import org.astrogrid.component.descriptor.ComponentDescriptor;
14  
15  import junit.framework.Test;
16  
17  /*** simplest possible memory-only id generator.
18   * <p>
19   * Not to be used in production - ids are only unique through lifetime of single JVM.
20   * @author Noel Winstanley nw@jb.man.ac.uk 27-May-2004
21   *
22   */
23  public class InMemoryIdGen implements IdGen, ComponentDescriptor {
24      /*** Construct a new InMemoryIdGen
25       * 
26       */
27      public InMemoryIdGen() {
28          super();
29      }
30      private int i = 0;
31  
32      public synchronized String getNewID() {
33          return Integer.toString(++i);
34      }
35      /***
36       * @see org.astrogrid.component.descriptor.ComponentDescriptor#getName()
37       */
38      public String getName() {
39          return "In Memory ID Gen";
40      }
41      /***
42       * @see org.astrogrid.component.descriptor.ComponentDescriptor#getDescription()
43       */
44      public String getDescription() {
45          return "Simplest possible IDGen. not for use in production environments";
46      }
47      /***
48       * @see org.astrogrid.component.descriptor.ComponentDescriptor#getInstallationTest()
49       */
50      public Test getInstallationTest() {
51          return null;
52      }
53  }
54  
55  
56  /* 
57  $Log: InMemoryIdGen.java,v $
58  Revision 1.3  2004/07/26 12:07:38  nw
59  renamed indirect package to protocol,
60  renamed classes and methods within protocol package
61  javadocs
62  
63  Revision 1.2  2004/07/01 11:16:22  nw
64  merged in branch
65  nww-itn06-componentization
66  
67  Revision 1.1.2.1  2004/06/17 09:21:23  nw
68  finished all major functionality additions to core
69  
70  Revision 1.1.2.1  2004/06/14 08:56:58  nw
71  factored applications into sub-projects,
72  got packaging of wars to work again
73  
74  Revision 1.1.2.1  2004/05/28 10:23:10  nw
75  checked in early, broken version - but it builds and tests (fail)
76   
77  */