source: xssim/trunk/src/test/rewolucja/resources/physical/factory/ResourceFactory.java @ 198

Revision 198, 822 bytes checked in by wojtekp, 13 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package test.rewolucja.resources.physical.factory;
2
3import test.rewolucja.resources.description.ExecResourceDescription;
4import test.rewolucja.resources.physical.base.ComputingResource;
5import test.rewolucja.resources.physical.implementation.Processor;
6import test.rewolucja.resources.physical.implementation.DataCenter;
7import test.rewolucja.resources.physical.implementation.Grid;
8
9
10public  class ResourceFactory {
11
12        public static ComputingResource createResource(ExecResourceDescription resDesc){
13                switch(resDesc.getType()){
14                        case COMPUTING_GRID: return new Grid(resDesc);
15                        case DATA_CENTER: return new DataCenter(resDesc);
16                        case COMPUTING_NODE: return ComputingNodeFactory.createComputingNode(resDesc);
17                        case CPU: return new Processor(resDesc);
18                default:
19                        return new ComputingResource(resDesc);
20                }
21        }
22
23}
24
Note: See TracBrowser for help on using the repository browser.