1 5 package ve.luz.ica.jackass.deploy.util; 6 7 import java.util.HashMap ; 8 import java.util.Iterator ; 9 import java.util.Map ; 10 11 import ve.luz.ica.jackass.deploy.descriptor.ica.ComponentChoiceIca; 12 import ve.luz.ica.jackass.deploy.descriptor.ica.ComponentIcaType; 13 import ve.luz.ica.jackass.deploy.descriptor.ica.IcaComponents; 14 import ve.luz.ica.jackass.deploy.descriptor.ica.IcaJackassApplication; 15 import ve.luz.ica.jackass.deploy.descriptor.standard.ComponentChoice; 16 import ve.luz.ica.jackass.deploy.descriptor.standard.ComponentType; 17 import ve.luz.ica.jackass.deploy.descriptor.standard.Components; 18 import ve.luz.ica.jackass.deploy.descriptor.standard.JackassApplication; 19 20 26 public class Application 27 { 28 31 public static final String STANDARD_DESCRIPTOR_NAME = "deployment.xml"; 32 33 36 public static final String ICA_DESCRIPTOR_NAME = "ica.xml"; 37 38 private JackassApplication jackApplication = null; 39 private IcaJackassApplication icaApplication = null; 40 private Map components = null; 41 42 49 public Application(JackassApplication jackApp, IcaJackassApplication icaApp) 50 { 51 this.jackApplication = jackApp; 52 this.icaApplication = icaApp; 53 this.components = new HashMap (); 54 55 Components compList = jackApplication.getComponents(); 56 IcaComponents icaCompList = icaApplication.getIcaComponents(); 57 58 for (int i = 0; i<compList.getComponentChoiceCount(); ++i) 59 { 60 ComponentChoice compChoice = compList.getComponentChoice(i); 61 ComponentType compType = null; 63 if ((compType = compChoice.getStatelessComponent()) != null) 64 { 65 ComponentIcaType compIcaType = null; 66 for (int j = 0; j<icaCompList.getComponentChoiceIcaCount(); ++j) 67 { 68 ComponentChoiceIca compChoiceIca = icaCompList.getComponentChoiceIca(j); 69 ComponentIcaType tempCompIcaType = compChoiceIca.getIcaStatelessComponent(); 70 if (tempCompIcaType.getName().equals(compType.getName())) 71 { 72 compIcaType = tempCompIcaType; 73 } 74 } 75 Component component = new Component(compType, compIcaType); 76 components.put(component.getName(), component); 77 } 78 } 79 } 80 81 85 public int getComponentCount() 86 { 87 return components.size(); 88 } 89 90 96 public Component getComponent(String name) 97 { 98 return (Component) components.get(name); 99 } 100 101 106 public ComponentType getStandardComponent(String name) 107 { 108 Component comp = (Component) components.get(name); 109 return comp.getStandardComponent(); 110 } 111 112 117 public ComponentIcaType getIcaComponent(String name) 118 { 119 Component comp = (Component) components.get(name); 120 return comp.getIcaComponent(); 121 } 122 123 128 public Iterator getComponents() 129 { 130 return this.components.values().iterator(); 131 } 133 138 public java.lang.String getDescription() 139 { 140 return this.jackApplication.getDescription(); 141 } 143 148 public java.lang.String getDisplayName() 149 { 150 return this.jackApplication.getDisplayName(); 151 } 153 158 public java.lang.String getName() 159 { 160 return this.jackApplication.getName(); 161 } 163 168 public ve.luz.ica.jackass.deploy.descriptor.standard.Properties getProperties() 169 { 170 return this.jackApplication.getProperties(); 171 } 173 } 174 | Popular Tags |