Author: doogie
Date: Sat Oct 20 20:50:49 2007 New Revision: 586847 URL: http://svn.apache.org/viewvc?rev=586847&view=rev Log: Use ComponentConfig generics. Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java?rev=586847&r1=586846&r2=586847&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/DispatchContext.java Sat Oct 20 20:50:49 2007 @@ -310,10 +310,7 @@ } // get all of the component resource model stuff, ie specified in each ofbiz-component.xml file - List componentResourceInfos = ComponentConfig.getAllServiceResourceInfos("model"); - Iterator componentResourceInfoIter = componentResourceInfos.iterator(); - while (componentResourceInfoIter.hasNext()) { - ComponentConfig.ServiceResourceInfo componentResourceInfo = (ComponentConfig.ServiceResourceInfo) componentResourceInfoIter.next(); + for (ComponentConfig.ServiceResourceInfo componentResourceInfo: ComponentConfig.getAllServiceResourceInfos("model")) { Map<String, ModelService> servicesMap = ModelServiceReader.getModelServiceMap(componentResourceInfo.createResourceHandler(), this); if (servicesMap != null) { serviceMap.putAll(servicesMap); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java?rev=586847&r1=586846&r2=586847&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java Sat Oct 20 20:50:49 2007 @@ -72,10 +72,7 @@ } // get all of the component resource eca stuff, ie specified in each ofbiz-component.xml file - List componentResourceInfos = ComponentConfig.getAllServiceResourceInfos("eca"); - Iterator componentResourceInfoIter = componentResourceInfos.iterator(); - while (componentResourceInfoIter.hasNext()) { - ComponentConfig.ServiceResourceInfo componentResourceInfo = (ComponentConfig.ServiceResourceInfo) componentResourceInfoIter.next(); + for (ComponentConfig.ServiceResourceInfo componentResourceInfo: ComponentConfig.getAllServiceResourceInfos("eca")) { addEcaDefinitions(componentResourceInfo.createResourceHandler()); } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java?rev=586847&r1=586846&r2=586847&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/group/ServiceGroupReader.java Sat Oct 20 20:50:49 2007 @@ -59,10 +59,7 @@ } // get all of the component resource group stuff, ie specified in each ofbiz-component.xml file - List componentResourceInfos = ComponentConfig.getAllServiceResourceInfos("group"); - Iterator componentResourceInfoIter = componentResourceInfos.iterator(); - while (componentResourceInfoIter.hasNext()) { - ComponentConfig.ServiceResourceInfo componentResourceInfo = (ComponentConfig.ServiceResourceInfo) componentResourceInfoIter.next(); + for (ComponentConfig.ServiceResourceInfo componentResourceInfo: ComponentConfig.getAllServiceResourceInfos("group")) { addGroupDefinitions(componentResourceInfo.createResourceHandler()); } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java?rev=586847&r1=586846&r2=586847&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java Sat Oct 20 20:50:49 2007 @@ -105,10 +105,8 @@ ServiceMcaUtil.readConfig(); // load the listeners - List configs = cfg.getPropertiesWithValue("store-listener"); - Iterator i = configs.iterator(); - while (i.hasNext()) { - ContainerConfig.Container.Property prop = (ContainerConfig.Container.Property) i.next(); + List<ContainerConfig.Container.Property> configs = cfg.getPropertiesWithValue("store-listener"); + for (ContainerConfig.Container.Property prop: configs) { Session session = this.makeSession(prop); Store store = this.getStore(session); if (store != null) { @@ -142,12 +140,9 @@ // java-mail methods protected Session makeSession(ContainerConfig.Container.Property client) { Properties props = new Properties(); - Map clientProps = client.properties; + Map<String, ContainerConfig.Container.Property> clientProps = client.properties; if (clientProps != null) { - Iterator i = clientProps.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry e = (Map.Entry) i.next(); - ContainerConfig.Container.Property p = (ContainerConfig.Container.Property) e.getValue(); + for (ContainerConfig.Container.Property p: clientProps.values()) { props.setProperty(p.name.toLowerCase(), p.value); } } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java?rev=586847&r1=586846&r2=586847&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java Sat Oct 20 20:50:49 2007 @@ -61,10 +61,7 @@ } // get all of the component resource eca stuff, ie specified in each ofbiz-component.xml file - List componentResourceInfos = ComponentConfig.getAllServiceResourceInfos("mca"); - Iterator componentResourceInfoIter = componentResourceInfos.iterator(); - while (componentResourceInfoIter.hasNext()) { - ComponentConfig.ServiceResourceInfo componentResourceInfo = (ComponentConfig.ServiceResourceInfo) componentResourceInfoIter.next(); + for (ComponentConfig.ServiceResourceInfo componentResourceInfo: ComponentConfig.getAllServiceResourceInfos("mca")) { addMcaDefinitions(componentResourceInfo.createResourceHandler()); } } |
Free forum by Nabble | Edit this page |