KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > buchuki > ensmer > prevayler > EnsmerPrevayler


1 /*
2  * Copyright 2004 Dusty Phillips
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.buchuki.ensmer.prevayler;
17
18 import java.io.Serializable JavaDoc;
19 import java.util.*;
20
21 /**
22  * This class is responsible for managing all prevayling/serializing tasks in
23  * Ensmer. It is a serializable object itself, and is accessed by the
24  * transactions managed by the prevayler to manipulate various state
25  * information. It mostly contains references to objects that perform more
26  * specific tasks.
27  *
28  * @author Dusty Phillips [dusty@buchuki.com]
29  */

30 public class EnsmerPrevayler implements Serializable JavaDoc {
31
32     /**
33      * Give it a SerialVersionUID so it can be reinstantiated by later versions
34      * of the class
35      */

36     static final long serialVersionUID = 20050328L;
37
38     /**
39      * Construct an EnsmerPrevayler. Basically it just initializes the more
40      * specific prevaylers of the project
41      */

42     public EnsmerPrevayler() {
43         areaPrevayler = new AreaPrevayler();
44         objectPrevayler = new ObjectPrevayler();
45         specialAreaIDs = new HashMap<String JavaDoc, Long JavaDoc>();
46         propertiesObjectIDs = new HashMap<Long JavaDoc, Long JavaDoc>();
47     }
48
49     /**
50      * Obtain a reference to the AreaPrevayler that Serializes various tasks on
51      * behalf of the AreaManager.
52      *
53      * @return a reference to the AreaPrevayler
54      */

55     public AreaPrevayler getAreaPrevayler() {
56         return areaPrevayler;
57     }
58
59     /**
60      * Obtain a reference to the ObjectPrevayler that serializas various tasks on
61      * behalf of the backhoe and Area classes.
62      *
63      * @return a reference to the ObjectPrevayler
64      */

65     public ObjectPrevayler getObjectPrevayler() {
66         return objectPrevayler;
67     }
68     
69     /**
70      * Get a reference to the special area map.
71      *
72      * @return map of String to Longs
73      */

74     public Map<String JavaDoc, Long JavaDoc> getSpecialAreaMap() {
75         return specialAreaIDs;
76     }
77     
78     /**
79      * Get a reference to the properties/object map
80      *
81      * @return map of Longs to Longs
82      */

83     public Map<Long JavaDoc, Long JavaDoc> getConfiguratorMap() {
84         return propertiesObjectIDs;
85     }
86
87     /**
88      * The <code>AreaPrevayler</code> that serializes area related tasks
89      */

90     private AreaPrevayler areaPrevayler;
91
92     /**
93      * The <code>ObjectPrevayler</code> that manages objects by id, class, and
94      * serializable object.
95      */

96     private ObjectPrevayler objectPrevayler;
97     
98     /**
99      * Map of String special area identifiers to actual Long identifiers
100      */

101     private Map<String JavaDoc, Long JavaDoc> specialAreaIDs;
102     
103     private Map<Long JavaDoc, Long JavaDoc> propertiesObjectIDs;
104 }
105
106
Popular Tags