01: package org.osbl.inventory;
02:
03: import org.osbl.*;
04: import org.osbl.inventory.model.*;
05: import org.osbl.identity.model.*;
06: import org.osbl.plugin.PluginManager;
07: import org.osbl.plugin.Extension;
08:
09: public class InventoryModule implements Module {
10: PluginManager pluginManager;
11: ObjectLocators objectLocators;
12: ReferenceCheckers referenceCheckers;
13:
14: public void setPluginManager(PluginManager pluginManager) {
15: this .pluginManager = pluginManager;
16: }
17:
18: public void setObjectLocators(ObjectLocators objectLocators) {
19: this .objectLocators = objectLocators;
20: }
21:
22: public void setReferenceCheckers(ReferenceCheckers referenceCheckers) {
23: this .referenceCheckers = referenceCheckers;
24: }
25:
26: public void initialize() {
27: pluginManager.registerExtension(new Extension(
28: "EmployeeConcrete", Identity.class.getName()
29: + ".concrete", Employee.class));
30: pluginManager.registerExtension(new Extension(
31: "SupplierConcrete", Identity.class.getName()
32: + ".concrete", Supplier.class));
33: pluginManager.registerExtension(new Extension(
34: "CostCenterConcrete", Identity.class.getName()
35: + ".concrete", CostCenter.class));
36:
37: objectLocators.registerObjectLocator(Inventory.class,
38: new LocationLocator());
39: objectLocators.registerObjectLocator(Inventory.class,
40: new CostTypeLocator());
41: objectLocators.registerObjectLocator(Inventory.class,
42: new CostTypeHierarchyLocator());
43: objectLocators.registerObjectLocator(Inventory.class,
44: new InventoryLocator());
45:
46: referenceCheckers.registerReferenceChecker(Identity.class,
47: new InventoryToIdentityReferenceChecker());
48: referenceCheckers.registerReferenceChecker(CostType.class,
49: new InventoryToCostTypeReferenceChecker());
50: referenceCheckers.registerReferenceChecker(Location.class,
51: new InventoryToLocationReferenceChecker());
52: referenceCheckers.registerReferenceChecker(Location.class,
53: new EmployeeToLocationReferenceChecker());
54: }
55: }
|