svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.spi / src / main / java / org / gvsig / fmap / dal / feature / spi / CompoundResourcesStorageWithSupportTransactions.java @ 47606
History | View | Annotate | Download (1.28 KB)
1 |
/*
|
---|---|
2 |
* To change this license header, choose License Headers in Project Properties.
|
3 |
* To change this template file, choose Tools | Templates
|
4 |
* and open the template in the editor.
|
5 |
*/
|
6 |
package org.gvsig.fmap.dal.feature.spi; |
7 |
|
8 |
import org.gvsig.fmap.dal.DataTransaction; |
9 |
import org.gvsig.fmap.dal.SupportTransactions; |
10 |
import org.gvsig.tools.resourcesstorage.CompoundResourcesStorage; |
11 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
12 |
|
13 |
/**
|
14 |
*
|
15 |
* @author fdiaz
|
16 |
*/
|
17 |
public class CompoundResourcesStorageWithSupportTransactions extends CompoundResourcesStorage implements SupportTransactions { |
18 |
|
19 |
public CompoundResourcesStorageWithSupportTransactions(ResourcesStorage... storages) {
|
20 |
super(storages);
|
21 |
} |
22 |
|
23 |
@Override
|
24 |
public void setTransaction(DataTransaction transaction) { |
25 |
for (ResourcesStorage storage : this) { |
26 |
if (storage instanceof SupportTransactions) { |
27 |
((SupportTransactions) storage).setTransaction(transaction); |
28 |
} |
29 |
} |
30 |
} |
31 |
|
32 |
@Override
|
33 |
public DataTransaction getTransaction() {
|
34 |
for (ResourcesStorage storage : this) { |
35 |
if (storage instanceof SupportTransactions) { |
36 |
return ((SupportTransactions) storage).getTransaction();
|
37 |
} |
38 |
} |
39 |
return null; |
40 |
} |
41 |
|
42 |
} |