Revision 198,
822 bytes
checked in by wojtekp, 13 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Line | |
---|
1 | package test.rewolucja.resources.physical.factory; |
---|
2 | |
---|
3 | import test.rewolucja.resources.description.ExecResourceDescription; |
---|
4 | import test.rewolucja.resources.physical.base.ComputingResource; |
---|
5 | import test.rewolucja.resources.physical.implementation.Processor; |
---|
6 | import test.rewolucja.resources.physical.implementation.DataCenter; |
---|
7 | import test.rewolucja.resources.physical.implementation.Grid; |
---|
8 | |
---|
9 | |
---|
10 | public 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.