svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_data / src / org / gvsig / fmap / data / DALLibrary.java @ 23893
History | View | Annotate | Download (1.1 KB)
1 |
package org.gvsig.fmap.data; |
---|---|
2 |
|
3 |
import org.gvsig.fmap.data.impl.DefaultDataManager; |
4 |
import org.gvsig.fmap.data.resource.ResourceManager; |
5 |
import org.gvsig.fmap.data.resource.impl.DefaultResourceManager; |
6 |
import org.gvsig.tools.locator.BaseLibrary; |
7 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
8 |
|
9 |
public class DALLibrary extends BaseLibrary { |
10 |
|
11 |
public void initialize() throws ReferenceNotRegisteredException { |
12 |
super.initialize();
|
13 |
DALLocator.registerDataManager(DefaultDataManager.class); |
14 |
DALLocator.registerResourceManager(DefaultResourceManager.class); |
15 |
} |
16 |
|
17 |
public void postInitialize() { |
18 |
super.postInitialize();
|
19 |
|
20 |
// Validate there is any implementation registered.
|
21 |
DataManager dataManager = DALLocator.getDataManager(); |
22 |
if (dataManager == null) { |
23 |
throw new ReferenceNotRegisteredException( |
24 |
DALLocator.DATA_MANAGER_NAME, DALLocator.getInstance()); |
25 |
} |
26 |
|
27 |
ResourceManager resourceManager = DALLocator.getResourceManager(); |
28 |
if (resourceManager == null) { |
29 |
throw new ReferenceNotRegisteredException( |
30 |
DALLocator.RESOURCE_MANAGER_NAME, DALLocator.getInstance()); |
31 |
} |
32 |
} |
33 |
|
34 |
} |