Author: mthl
Date: Sat Oct 19 14:27:01 2019 New Revision: 1868628 URL: http://svn.apache.org/viewvc?rev=1868628&view=rev Log: Improved: Avoid unecessary breakage in ‘ContainerConfig’ (OFBIZ-11256) This restores ‘public’ modifiers on fields and move the ‘Property’ inner class back to ‘Configuration’ to avoid breakage of client code extending the ‘Container’ interface. In order to smooth the transition towards using getters instead of direct field accesss, the public modifiers on fields are now marked as deprecated. Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerConfig.java ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/NamingServiceContainer.java ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/ServiceContainer.java ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/mail/JavaMailContainer.java ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/rmi/RmiServiceContainer.java Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerConfig.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerConfig.java?rev=1868628&r1=1868627&r2=1868628&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerConfig.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/ContainerConfig.java Sat Oct 19 14:27:01 2019 @@ -83,7 +83,7 @@ public final class ContainerConfig { .map(Configuration::new) .collect(collectingAndThen(toList(), Collections::unmodifiableList)); synchronized (ContainerConfig.class) { - res.forEach(cfg -> configurations.put(cfg.name, cfg)); + res.forEach(cfg -> configurations.put(cfg.name(), cfg)); } return res; } @@ -95,20 +95,20 @@ public final class ContainerConfig { * @param name the child property identifier * @return the property corresponding to {@code name} or {@code null} if the identifier is absent. */ - Property getProperty(String name); + Configuration.Property getProperty(String name); } public static String getPropertyValue(PropertyChildren parentProp, String name, String defaultValue) { - Property prop = parentProp.getProperty(name); - if (prop == null || UtilValidate.isEmpty(prop.value)) { + Configuration.Property prop = parentProp.getProperty(name); + if (prop == null || UtilValidate.isEmpty(prop.value())) { return defaultValue; } return prop.value; } public static int getPropertyValue(PropertyChildren parentProp, String name, int defaultValue) { - Property prop = parentProp.getProperty(name); - if (prop == null || UtilValidate.isEmpty(prop.value)) { + Configuration.Property prop = parentProp.getProperty(name); + if (prop == null || UtilValidate.isEmpty(prop.value())) { return defaultValue; } try { @@ -119,8 +119,8 @@ public final class ContainerConfig { } public static boolean getPropertyValue(PropertyChildren parentProp, String name, boolean defaultValue) { - Property prop = parentProp.getProperty(name); - if (prop == null || UtilValidate.isEmpty(prop.value)) { + Configuration.Property prop = parentProp.getProperty(name); + if (prop == null || UtilValidate.isEmpty(prop.value())) { return defaultValue; } return "true".equalsIgnoreCase(prop.value); @@ -130,14 +130,16 @@ public final class ContainerConfig { * A container configuration. */ public static final class Configuration implements PropertyChildren { + //ALLOW PUBLIC FIELDS /** The identifier of the configuration. */ - private final String name; + @Deprecated public final String name; /** The name of class the configuration. */ - private final String className; + @Deprecated public final String className; /** The list of loader names triggering the launch of the container. */ - private final List<String> loaders; + @Deprecated public final List<String> loaders; /** The container property elements. */ - private final Map<String, Property> properties; + @Deprecated public final Map<String, Property> properties; + //FORBID PUBLIC FIELDS /** * Constructs a container configuration. @@ -180,7 +182,7 @@ public final class ContainerConfig { } @Override - public Property getProperty(String name) { + public Configuration.Property getProperty(String name) { return properties().get(name); } @@ -193,96 +195,98 @@ public final class ContainerConfig { public List<Property> getPropertiesWithValue(String value) { return Property.getPropertiesWithValue(properties(), value); } - } - - /** - * A tree of container configuration properties. - */ - public static final class Property implements PropertyChildren { - /** The identifier of the configuration element */ - private final String name; - /** The value associated with the {@code name} identifier. */ - private final String value; - /** The properties children */ - private final Map<String, Property> properties; /** - * Constructs a container configuration element. - * - * @param element the {@code <property>} XML element containing the configuration. + * A tree of container configuration properties. */ - public Property(Element element) { - name = element.getAttribute("name"); - String value = element.getAttribute("value"); - if (UtilValidate.isEmpty(value)) { - value = UtilXml.childElementValue(element, "property-value"); + public static final class Property implements PropertyChildren { + //ALLOW PUBLIC FIELDS + /** The identifier of the configuration element */ + @Deprecated public final String name; + /** The value associated with the {@code name} identifier. */ + @Deprecated public final String value; + /** The properties children */ + @Deprecated public final Map<String, Property> properties; + //FORBID PUBLIC FIELDS + + /** + * Constructs a container configuration element. + * + * @param element the {@code <property>} XML element containing the configuration. + */ + public Property(Element element) { + name = element.getAttribute("name"); + String value = element.getAttribute("value"); + if (UtilValidate.isEmpty(value)) { + value = UtilXml.childElementValue(element, "property-value"); + } + this.value = value; + this.properties = parseProps(element); } - this.value = value; - this.properties = parseProps(element); - } - /** - * @return the name - */ - public String name() { - return name; - } + /** + * @return the name + */ + public String name() { + return name; + } - /** - * @return the value - */ - public String value() { - return value; - } + /** + * @return the value + */ + public String value() { + return value; + } - /** - * @return the properties - */ - public Map<String, Property> properties() { - return properties; - } + /** + * @return the properties + */ + public Map<String, Property> properties() { + return properties; + } - @Override - public Property getProperty(String name) { - return properties.get(name); - } + @Override + public Configuration.Property getProperty(String name) { + return properties().get(name); + } - /** - * Provides all the child properties whose values are equal a specified value. - * - * @param value the value to match - * @return a list of matching properties - */ - public List<Property> getPropertiesWithValue(String value) { - return getPropertiesWithValue(properties, value); - } + /** + * Provides all the child properties whose values are equal a specified value. + * + * @param value the value to match + * @return a list of matching properties + */ + public List<Property> getPropertiesWithValue(String value) { + return getPropertiesWithValue(properties(), value); + } - /** - * Aggregates the {@code <property>} XML elements in a Map. - * - * @param root the root XML Element containing {@code <property>} children - * @return a map of property elements - */ - private static Map<String, Property> parseProps(Element root) { - LinkedHashMap<String, Property> res = new LinkedHashMap<>(); - UtilXml.childElementList(root, "property").forEach(el -> { - Property p = new Property(el); - res.put(p.name, p); - }); - return Collections.unmodifiableMap(res); - } + /** + * Aggregates the {@code <property>} XML elements in a Map. + * + * @param root the root XML Element containing {@code <property>} children + * @return a map of property elements + */ + private static Map<String, Property> parseProps(Element root) { + LinkedHashMap<String, Property> res = new LinkedHashMap<>(); + UtilXml.childElementList(root, "property").forEach(el -> { + Property p = new Property(el); + res.put(p.name(), p); + }); + return Collections.unmodifiableMap(res); + } - /** - * Provides all the child properties whose values are equal a specified value. - * - * @param value the value to match - * @return a list of matching properties - */ - private static List<Property> getPropertiesWithValue(Map<String, Property> propkvs, String value) { - return propkvs.values().stream() - .filter(Objects::nonNull) - .filter(p -> value.equals(p.value)) - .collect(toList()); + /** + * Provides all the child properties whose values are equal a specified value. + * + * @param value the value to match + * @return a list of matching properties + */ + private static List<Property> getPropertiesWithValue(Map<String, Property> propkvs, String value) { + return propkvs.values().stream() + .filter(Objects::nonNull) + .filter(p -> value.equals(p.value())) + .collect(toList()); + } } } } Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/NamingServiceContainer.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/NamingServiceContainer.java?rev=1868628&r1=1868627&r2=1868628&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/NamingServiceContainer.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/container/NamingServiceContainer.java Sat Oct 19 14:27:01 2019 @@ -26,6 +26,7 @@ import java.rmi.registry.Registry; import java.rmi.server.UnicastRemoteObject; import java.util.List; +import org.apache.ofbiz.base.container.ContainerConfig.Configuration; import org.apache.ofbiz.base.start.Start; import org.apache.ofbiz.base.start.StartupCommand; import org.apache.ofbiz.base.util.RMIExtendedSocketFactory; @@ -54,11 +55,11 @@ public class NamingServiceContainer impl this.name =name; this.configFileLocation = configFile; - ContainerConfig.Configuration cfg = ContainerConfig.getConfiguration(name); + Configuration cfg = ContainerConfig.getConfiguration(name); // get the naming (JNDI) port - ContainerConfig.Property port = cfg.getProperty("port"); + Configuration.Property port = cfg.getProperty("port"); if (port.value() != null) { try { this.namingPort = Integer.parseInt(port.value()) + Start.getInstance().getConfig().portOffset; @@ -68,7 +69,7 @@ public class NamingServiceContainer impl } // get the naming (JNDI) server - ContainerConfig.Property host = cfg.getProperty("host"); + Configuration.Property host = cfg.getProperty("host"); if (host != null && host.value() != null) { this.namingHost = host.value() ; } Modified: ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java?rev=1868628&r1=1868627&r2=1868628&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java Sat Oct 19 14:27:01 2019 @@ -69,7 +69,6 @@ import org.apache.ofbiz.base.concurrent. import org.apache.ofbiz.base.container.Container; import org.apache.ofbiz.base.container.ContainerConfig; import org.apache.ofbiz.base.container.ContainerConfig.Configuration; -import org.apache.ofbiz.base.container.ContainerConfig.Property; import org.apache.ofbiz.base.container.ContainerException; import org.apache.ofbiz.base.location.FlexibleLocation; import org.apache.ofbiz.base.start.Start; @@ -104,7 +103,7 @@ public class CatalinaContainer implement this.name = name; ContainerConfig.Configuration configuration = ContainerConfig.getConfiguration(name); - Property engineConfig = retrieveTomcatEngineConfig(configuration); + Configuration.Property engineConfig = retrieveTomcatEngineConfig(configuration); // tomcat setup tomcat = prepareTomcatServer(configuration, engineConfig); @@ -125,7 +124,7 @@ public class CatalinaContainer implement } // clustering, valves and connectors setup - Property clusterProps = prepareTomcatClustering(host, engineConfig); + Configuration.Property clusterProps = prepareTomcatClustering(host, engineConfig); prepareTomcatEngineValves(engineConfig).forEach(valve -> ((StandardEngine)engine).addValve(valve)); prepareTomcatConnectors(configuration).forEach(connector -> tomcat.getService().addConnector(connector)); @@ -164,8 +163,8 @@ public class CatalinaContainer implement return name; } - private static Property retrieveTomcatEngineConfig(ContainerConfig.Configuration cc) throws ContainerException { - List<ContainerConfig.Property> engineProps = cc.getPropertiesWithValue("engine"); + private static Configuration.Property retrieveTomcatEngineConfig(Configuration cc) throws ContainerException { + List<Configuration.Property> engineProps = cc.getPropertiesWithValue("engine"); if (UtilValidate.isEmpty(engineProps)) { throw new ContainerException("Cannot load CatalinaContainer; no engines defined."); } @@ -175,7 +174,7 @@ public class CatalinaContainer implement return engineProps.get(0); } - private static Tomcat prepareTomcatServer(ContainerConfig.Configuration cc, ContainerConfig.Property engineConfig) + private static Tomcat prepareTomcatServer(ContainerConfig.Configuration cc, Configuration.Property engineConfig) throws ContainerException { System.setProperty(Globals.CATALINA_HOME_PROP, System.getProperty("ofbiz.home") + "/" + ContainerConfig.getPropertyValue(cc, "catalina-runtime-home", "runtime/catalina")); @@ -184,7 +183,7 @@ public class CatalinaContainer implement Tomcat tomcat = new Tomcat(); tomcat.setBaseDir(System.getProperty("ofbiz.home")); - Property defaultHostProp = engineConfig.getProperty("default-host"); + Configuration.Property defaultHostProp = engineConfig.getProperty("default-host"); if (defaultHostProp == null) { throw new ContainerException("default-host element of server property is required for catalina!"); } @@ -204,7 +203,7 @@ public class CatalinaContainer implement return tomcat; } - private static Engine prepareTomcatEngine(Tomcat tomcat, Property engineConfig) { + private static Engine prepareTomcatEngine(Tomcat tomcat, Configuration.Property engineConfig) { Engine engine = tomcat.getEngine(); engine.setName(engineConfig.name()); @@ -261,10 +260,11 @@ public class CatalinaContainer implement return host; } - private static Property prepareTomcatClustering(Host host, Property engineConfig) throws ContainerException { - Property clusterProp = null; + private static Configuration.Property prepareTomcatClustering(Host host, Configuration.Property engineConfig) + throws ContainerException { + Configuration.Property clusterProp = null; - List<Property> clusterProps = engineConfig.getPropertiesWithValue("cluster"); + List<Configuration.Property> clusterProps = engineConfig.getPropertiesWithValue("cluster"); if (clusterProps.size() > 1) { throw new ContainerException("Only one cluster configuration allowed per engine"); } @@ -290,7 +290,7 @@ public class CatalinaContainer implement return clusterProp; } - private static NioReceiver prepareChannelReceiver(Property clusterProp) throws ContainerException { + private static NioReceiver prepareChannelReceiver(Configuration.Property clusterProp) throws ContainerException { NioReceiver listener = new NioReceiver(); String tla = ContainerConfig.getPropertyValue(clusterProp, "tcp-listen-host", "auto"); @@ -311,7 +311,8 @@ public class CatalinaContainer implement return listener; } - private static ReplicationTransmitter prepareChannelSender(Property clusterProp) throws ContainerException { + private static ReplicationTransmitter prepareChannelSender(Configuration.Property clusterProp) + throws ContainerException { ReplicationTransmitter trans = new ReplicationTransmitter(); try { MultiPointSender mps = (MultiPointSender)Class.forName(ContainerConfig.getPropertyValue(clusterProp, @@ -323,7 +324,8 @@ public class CatalinaContainer implement return trans; } - private static McastService prepareChannelMcastService(Property clusterProp) throws ContainerException { + private static McastService prepareChannelMcastService(Configuration.Property clusterProp) + throws ContainerException { McastService mcast = new McastService(); String mcb = ContainerConfig.getPropertyValue(clusterProp, "mcast-bind-addr", null); @@ -348,7 +350,7 @@ public class CatalinaContainer implement return mcast; } - private static ClusterManager prepareClusterManager(Property clusterProp) throws ContainerException { + private static ClusterManager prepareClusterManager(Configuration.Property clusterProp) throws ContainerException { String mgrClassName = ContainerConfig.getPropertyValue(clusterProp, "manager-class", "org.apache.catalina.ha.session.DeltaManager"); try { return (ClusterManager)Class.forName(mgrClassName).getDeclaredConstructor().newInstance(); @@ -357,14 +359,15 @@ public class CatalinaContainer implement } } - private static ReplicationValve prepareClusterValve(Property clusterProp) { + private static ReplicationValve prepareClusterValve(Configuration.Property clusterProp) { ReplicationValve clusterValve = new ReplicationValve(); String defaultValveFilter = ".*\\.gif;.*\\.js;.*\\.jpg;.*\\.htm;.*\\.html;.*\\.txt;.*\\.png;.*\\.css;.*\\.ico;.*\\.htc;"; clusterValve.setFilter(ContainerConfig.getPropertyValue(clusterProp, "rep-valve-filter", defaultValveFilter)); return clusterValve; } - private static List<Valve> prepareTomcatEngineValves(Property engineConfig) throws ContainerException { + private static List<Valve> prepareTomcatEngineValves(Configuration.Property engineConfig) + throws ContainerException { List<Valve> engineValves = new ArrayList<>(); // configure the CrossSubdomainSessionValve @@ -410,7 +413,7 @@ public class CatalinaContainer implement } private static List<Connector> prepareTomcatConnectors(Configuration configuration) throws ContainerException { - List<Property> connectorProps = configuration.getPropertiesWithValue("connector"); + List<Configuration.Property> connectorProps = configuration.getPropertiesWithValue("connector"); if (UtilValidate.isEmpty(connectorProps)) { throw new ContainerException("Cannot load CatalinaContainer; no connectors defined!"); } @@ -420,7 +423,7 @@ public class CatalinaContainer implement .collect(Collectors.toList()); } - private static Connector prepareConnector(Property connectorProp) { + private static Connector prepareConnector(Configuration.Property connectorProp) { Connector connector = new Connector(ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1")); connector.setPort(ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset); if ("true".equals(ContainerConfig.getPropertyValue(connectorProp, "upgradeProtocol", "false"))) { @@ -449,7 +452,7 @@ public class CatalinaContainer implement return connector; } - private static void loadWebapps(Tomcat tomcat, ContainerConfig.Configuration configuration, Property clusterProp) { + private static void loadWebapps(Tomcat tomcat, Configuration configuration, Configuration.Property clusterProp) { ScheduledExecutorService executor = ExecutionPool.getScheduledExecutor(new ThreadGroup(module), "catalina-startup", Runtime.getRuntime().availableProcessors(), 0, true); List<Future<Context>> futures = new ArrayList<>(); @@ -491,7 +494,7 @@ public class CatalinaContainer implement } private static Callable<Context> createCallableContext(Tomcat tomcat, ComponentConfig.WebappInfo appInfo, - Property clusterProp, ContainerConfig.Configuration configuration) { + Configuration.Property clusterProp, ContainerConfig.Configuration configuration) { Debug.logInfo("Creating context [" + appInfo.name + "]", module); Host host = prepareHost(tomcat, appInfo.getVirtualHosts()); @@ -505,7 +508,7 @@ public class CatalinaContainer implement } private static StandardContext prepareContext(Host host, ContainerConfig.Configuration configuration, - ComponentConfig.WebappInfo appInfo, Property clusterProp) throws ContainerException { + ComponentConfig.WebappInfo appInfo, Configuration.Property clusterProp) throws ContainerException { StandardContext context = new StandardContext(); Tomcat.initWebappDefaults(context); Modified: ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java?rev=1868628&r1=1868627&r2=1868628&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/entityext/src/main/java/org/apache/ofbiz/entityext/data/EntityDataLoadContainer.java Sat Oct 19 14:27:01 2019 @@ -35,7 +35,6 @@ import org.apache.ofbiz.base.component.C import org.apache.ofbiz.base.container.Container; import org.apache.ofbiz.base.container.ContainerConfig; import org.apache.ofbiz.base.container.ContainerConfig.Configuration; -import org.apache.ofbiz.base.container.ContainerConfig.Property; import org.apache.ofbiz.base.container.ContainerException; import org.apache.ofbiz.base.start.StartupCommand; import org.apache.ofbiz.base.start.StartupCommandUtil; @@ -102,7 +101,7 @@ public class EntityDataLoadContainer imp ServiceDispatcher.enableSvcs(false); Configuration configuration = ContainerConfig.getConfiguration(name); - Property delegatorNameProp = configuration.getProperty("delegator-name"); + Configuration.Property delegatorNameProp = configuration.getProperty("delegator-name"); String overrideDelegator = loadDataProps.get(DELEGATOR_NAME); if ("all-tenants".equals(overrideDelegator)) { @@ -131,7 +130,8 @@ public class EntityDataLoadContainer imp return name; } - private static List<GenericValue> getTenantList(Property delegatorNameProp) throws ContainerException { + private static List<GenericValue> getTenantList(Configuration.Property delegatorNameProp) + throws ContainerException { if (!EntityUtil.isMultiTenantEnabled()) { throw new ContainerException("Multitenant is disabled, must be enabled in general.properties -> multitenant=Y"); } @@ -149,8 +149,8 @@ public class EntityDataLoadContainer imp } private static void loadDataForDelegator(Map<String, String> loadDataProps, Configuration configuration, - Property delegatorNameProp, String overrideDelegator) throws ContainerException{ - + Configuration.Property delegatorNameProp, String overrideDelegator) + throws ContainerException{ // prepare command line properties passed by user boolean createPks = isPropertySet(loadDataProps, CREATE_P_KEYS); boolean dropPks = isPropertySet(loadDataProps, DROP_P_KEYS); @@ -212,7 +212,7 @@ public class EntityDataLoadContainer imp if (overrideGroup != null) { return overrideGroup; } else { - Property entityGroupNameProp = cfg.getProperty("entity-group-name"); + Configuration.Property entityGroupNameProp = cfg.getProperty("entity-group-name"); if (entityGroupNameProp == null || UtilValidate.isEmpty(entityGroupNameProp.value())) { throw new ContainerException("Invalid entity-group-name defined in container configuration"); } else { @@ -226,7 +226,7 @@ public class EntityDataLoadContainer imp * overridden by the user. This method will create all the tables, keys and * indices if missing and hence might take a long time. */ - private static Delegator getDelegator(Property delegatorNameProp, String overrideDelegator) + private static Delegator getDelegator(Configuration.Property delegatorNameProp, String overrideDelegator) throws ContainerException { if (overrideDelegator != null) { return DelegatorFactory.getDelegator(overrideDelegator); @@ -235,7 +235,7 @@ public class EntityDataLoadContainer imp } } - private static Delegator getDelegatorFromProp(Property delegatorNameProp) throws ContainerException { + private static Delegator getDelegatorFromProp(Configuration.Property delegatorNameProp) throws ContainerException { if (delegatorNameProp != null && UtilValidate.isNotEmpty(delegatorNameProp.value())) { String delegValue = delegatorNameProp.value(); Delegator delegator = DelegatorFactory.getDelegator(delegValue); Modified: ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/ServiceContainer.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/ServiceContainer.java?rev=1868628&r1=1868627&r2=1868628&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/ServiceContainer.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/ServiceContainer.java Sat Oct 19 14:27:01 2019 @@ -25,6 +25,7 @@ import java.util.concurrent.ConcurrentHa import org.apache.ofbiz.base.container.Container; import org.apache.ofbiz.base.container.ContainerConfig; +import org.apache.ofbiz.base.container.ContainerConfig.Configuration; import org.apache.ofbiz.base.container.ContainerException; import org.apache.ofbiz.base.start.StartupCommand; import org.apache.ofbiz.base.util.Debug; @@ -46,8 +47,8 @@ public class ServiceContainer implements public void init(List<StartupCommand> ofbizCommands, String name, String configFile) throws ContainerException { this.name = name; // initialize the LocalDispatcherFactory - ContainerConfig.Configuration cfg = ContainerConfig.getConfiguration(name); - ContainerConfig.Property dispatcherFactoryProperty = cfg.getProperty("dispatcher-factory"); + Configuration cfg = ContainerConfig.getConfiguration(name); + Configuration.Property dispatcherFactoryProperty = cfg.getProperty("dispatcher-factory"); if (dispatcherFactoryProperty == null || UtilValidate.isEmpty(dispatcherFactoryProperty.value())) { throw new ContainerException("Unable to initialize container " + name + ": dispatcher-factory property is not set"); } Modified: ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/mail/JavaMailContainer.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/mail/JavaMailContainer.java?rev=1868628&r1=1868627&r2=1868628&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/mail/JavaMailContainer.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/mail/JavaMailContainer.java Sat Oct 19 14:27:01 2019 @@ -43,6 +43,7 @@ import javax.mail.search.FlagTerm; import org.apache.ofbiz.base.container.Container; import org.apache.ofbiz.base.container.ContainerConfig; +import org.apache.ofbiz.base.container.ContainerConfig.Configuration; import org.apache.ofbiz.base.container.ContainerException; import org.apache.ofbiz.base.start.StartupCommand; import org.apache.ofbiz.base.util.Debug; @@ -107,7 +108,7 @@ public class JavaMailContainer implement ServiceMcaUtil.readConfig(); // load the listeners - for (ContainerConfig.Property prop: cfg.getPropertiesWithValue("store-listener")) { + for (Configuration.Property prop: cfg.getPropertiesWithValue("store-listener")) { Session session = this.makeSession(prop); Store store = this.getStore(session); stores.put(store, session); @@ -137,11 +138,11 @@ public class JavaMailContainer implement } // java-mail methods - protected Session makeSession(ContainerConfig.Property client) { + protected Session makeSession(Configuration.Property client) { Properties props = new Properties(); - Map<String, ContainerConfig.Property> clientProps = client.properties(); + Map<String, Configuration.Property> clientProps = client.properties(); if (clientProps != null) { - for (ContainerConfig.Property p: clientProps.values()) { + for (Configuration.Property p: clientProps.values()) { props.setProperty(p.name().toLowerCase(Locale.getDefault()), p.value()); } } Modified: ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/rmi/RmiServiceContainer.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/rmi/RmiServiceContainer.java?rev=1868628&r1=1868627&r2=1868628&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/rmi/RmiServiceContainer.java (original) +++ ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/rmi/RmiServiceContainer.java Sat Oct 19 14:27:01 2019 @@ -29,6 +29,7 @@ import javax.naming.NamingException; import org.apache.ofbiz.base.container.Container; import org.apache.ofbiz.base.container.ContainerConfig; +import org.apache.ofbiz.base.container.ContainerConfig.Configuration; import org.apache.ofbiz.base.container.ContainerException; import org.apache.ofbiz.base.start.Start; import org.apache.ofbiz.base.start.StartupCommand; @@ -60,14 +61,14 @@ public class RmiServiceContainer impleme @Override public boolean start() throws ContainerException { // get the container config - ContainerConfig.Configuration cfg = ContainerConfig.getConfiguration(containerName); - ContainerConfig.Property initialCtxProp = cfg.getProperty("use-initial-context"); - ContainerConfig.Property lookupHostProp = cfg.getProperty("bound-host"); - ContainerConfig.Property lookupPortProp = cfg.getProperty("bound-port"); - ContainerConfig.Property lookupNameProp = cfg.getProperty("bound-name"); - ContainerConfig.Property delegatorProp = cfg.getProperty("delegator-name"); - ContainerConfig.Property clientProp = cfg.getProperty("client-factory"); - ContainerConfig.Property serverProp = cfg.getProperty("server-factory"); + Configuration cfg = ContainerConfig.getConfiguration(containerName); + Configuration.Property initialCtxProp = cfg.getProperty("use-initial-context"); + Configuration.Property lookupHostProp = cfg.getProperty("bound-host"); + Configuration.Property lookupPortProp = cfg.getProperty("bound-port"); + Configuration.Property lookupNameProp = cfg.getProperty("bound-name"); + Configuration.Property delegatorProp = cfg.getProperty("delegator-name"); + Configuration.Property clientProp = cfg.getProperty("client-factory"); + Configuration.Property serverProp = cfg.getProperty("server-factory"); // check the required lookup-name property if (lookupNameProp == null || UtilValidate.isEmpty(lookupNameProp.value())) { |
Free forum by Nabble | Edit this page |