|
Modified: ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/ContainerLoader.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/ContainerLoader.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/ContainerLoader.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/ContainerLoader.java Tue Aug 7 06:25:59 2012 @@ -33,7 +33,9 @@ import org.ofbiz.base.start.Config; import org.ofbiz.base.start.StartupException; import org.ofbiz.base.start.StartupLoader; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilValidate; +import org.ofbiz.base.util.UtilXml; /** * An object that loads containers (background processes). @@ -46,22 +48,6 @@ import org.ofbiz.base.util.UtilValidate; public class ContainerLoader implements StartupLoader { public static final String module = ContainerLoader.class.getName(); - private static Map<String, Container> containerMap = new ConcurrentHashMap<String, Container>(); - - /** - * Returns a <code>Container</code> that has the specified name. Returns - * <code>null</code> if the specified container was not loaded. If more than one - * instance of the container was loaded, then the last instance that was loaded is - * returned. The returned <code>Container</code> will be initialized, but there is no - * guarantee that it will be in the running state. - * - * @param containerName - * The name of the container. - * @return A <code>Container</code> that has the specified name. - */ - public static Container getContainer(String containerName) { - return containerMap.get(containerName); - } private String configFile = null; private final List<Container> loadedContainers = new LinkedList<Container>(); @@ -75,16 +61,21 @@ public class ContainerLoader implements if (this.loaded || this.unloading) { return; } - Debug.logInfo("[Startup] Loading containers...", module); this.loadedContainers.clear(); // get this loader's configuration file this.configFile = config.containerConfig; + + List<String> loaders = null; + for (Map loaderMap: config.loaders) { + if (module.equals((String)loaderMap.get("class"))) { + loaders = StringUtil.split((String)loaderMap.get("profiles"), ","); + } + } + + Debug.logInfo("[Startup] Loading containers from " + configFile + " for loaders " + loaders, module); Collection<ContainerConfig.Container> containers = null; try { containers = ContainerConfig.getContainers(configFile); - if (UtilValidate.isEmpty(containers)) { - throw new StartupException("No containers loaded; problem with configuration"); - } } catch (ContainerException e) { throw new StartupException(e); } @@ -92,38 +83,47 @@ public class ContainerLoader implements if (this.unloading) { return; } - Container tmpContainer = loadContainer(containerCfg, args); - this.loadedContainers.add(tmpContainer); - containerMap.put(containerCfg.name, tmpContainer); - - // TODO: Put container-specific code in the container. - // This is only used in case of OFBiz running in Geronimo or WASCE. It allows to use the RMIDispatcher - if (containerCfg.name.equals("rmi-dispatcher") && configFile.equals("limited-containers.xml")) { - try { - ContainerConfig.Container.Property initialCtxProp = containerCfg.getProperty("use-initial-context"); - String useCtx = initialCtxProp == null || initialCtxProp.value == null ? "false" : initialCtxProp.value; - if (!useCtx.equalsIgnoreCase("true")) { - //system.setProperty("java.security.policy", "client.policy"); maybe used if needed... - if (System.getSecurityManager() == null) { // needed by WASCE with a client.policy file. - System.setSecurityManager(new java.rmi.RMISecurityManager()); - } - tmpContainer.start(); + boolean matchingLoaderFound = false; + if (UtilValidate.isEmpty(containerCfg.loaders) && UtilValidate.isEmpty(loaders)) { + matchingLoaderFound = true; + } else { + for (String loader: loaders) { + if (UtilValidate.isEmpty(containerCfg.loaders) || containerCfg.loaders.contains(loader)) { + matchingLoaderFound = true; + break; } - } catch (ContainerException e) { - throw new StartupException("Cannot start() " + tmpContainer.getClass().getName(), e); - } catch (java.lang.AbstractMethodError e) { - throw new StartupException("Cannot start() " + tmpContainer.getClass().getName(), e); } } + if (matchingLoaderFound) { + Debug.logInfo("Loading container: " + containerCfg.name, module); + Container tmpContainer = loadContainer(containerCfg, args); + this.loadedContainers.add(tmpContainer); + Debug.logInfo("Loaded container: " + containerCfg.name, module); + } } if (this.unloading) { return; } + List<ContainerConfig.Container> containersDefinedInComponents = ComponentConfig.getAllContainers(); for (ContainerConfig.Container containerCfg: containersDefinedInComponents) { - Container tmpContainer = loadContainer(containerCfg, args); - this.loadedContainers.add(tmpContainer); - containerMap.put(containerCfg.name, tmpContainer); + boolean matchingLoaderFound = false; + if (UtilValidate.isEmpty(containerCfg.loaders) && UtilValidate.isEmpty(loaders)) { + matchingLoaderFound = true; + } else { + for (String loader: loaders) { + if (UtilValidate.isEmpty(containerCfg.loaders) || containerCfg.loaders.contains(loader)) { + matchingLoaderFound = true; + break; + } + } + } + if (matchingLoaderFound) { + Debug.logInfo("Loading component's container: " + containerCfg.name, module); + Container tmpContainer = loadContainer(containerCfg, args); + this.loadedContainers.add(tmpContainer); + Debug.logInfo("Loaded component's container: " + containerCfg.name, module); + } } // Get hot-deploy container configuration files ClassLoader loader = Thread.currentThread().getContextClassLoader(); @@ -140,7 +140,6 @@ public class ContainerLoader implements } Container tmpContainer = loadContainer(containerCfg, args); this.loadedContainers.add(tmpContainer); - containerMap.put(containerCfg.name, tmpContainer); } } } catch (Exception e) { @@ -185,7 +184,7 @@ public class ContainerLoader implements // initialize the container object try { - containerObj.init(args, configFile); + containerObj.init(args, containerCfg.name, configFile); } catch (ContainerException e) { throw new StartupException("Cannot init() " + containerCfg.name, e); } catch (java.lang.AbstractMethodError e) { @@ -233,6 +232,7 @@ public class ContainerLoader implements if (this.unloading) { return; } + Debug.logInfo("Starting container " + container.getName(), module); try { container.start(); } catch (ContainerException e) { @@ -240,6 +240,7 @@ public class ContainerLoader implements } catch (java.lang.AbstractMethodError e) { throw new StartupException("Cannot start() " + container.getClass().getName(), e); } + Debug.logInfo("Started container " + container.getName(), module); } } @@ -257,11 +258,13 @@ public class ContainerLoader implements // shutting down in reverse order for (int i = this.loadedContainers.size(); i > 0; i--) { Container container = this.loadedContainers.get(i-1); + Debug.logInfo("Stopping container " + container.getName(), module); try { container.stop(); } catch (ContainerException e) { Debug.logError(e, module); } + Debug.logInfo("Stopped container " + container.getName(), module); } } } Modified: ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/GroovyShellContainer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/GroovyShellContainer.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/GroovyShellContainer.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/GroovyShellContainer.java Tue Aug 7 06:25:59 2012 @@ -28,14 +28,13 @@ public class GroovyShellContainer implem private static final Logger log = Logger.getLogger(GroovyShellContainer.class); + private String name; private String configFileLocation = null; private GroovyService gsh = null; - /** - * @see org.ofbiz.base.container.Container#init(java.lang.String[], java.lang.String) - */ @Override - public void init(String[] args, String configFile) { + public void init(String[] args, String name, String configFile) { + this.name = name; configFileLocation = configFile; } @@ -62,8 +61,12 @@ public class GroovyShellContainer implem gsh = null; } + public String getName() { + return name; + } + private int getTelnetPort() throws ContainerException { - ContainerConfig.Container config = ContainerConfig.getContainer("groovyshell-container", configFileLocation); + ContainerConfig.Container config = ContainerConfig.getContainer(name, configFileLocation); Property telnetPort = config.getProperty("telnet-port"); try { return Integer.parseInt(telnetPort.value); Modified: ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/JustLoadComponentsContainer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/JustLoadComponentsContainer.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/JustLoadComponentsContainer.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/JustLoadComponentsContainer.java Tue Aug 7 06:25:59 2012 @@ -29,10 +29,11 @@ public class JustLoadComponentsContainer public static final String module = JustLoadComponentsContainer.class.getName(); - /** - * @see org.ofbiz.base.container.Container#init(java.lang.String[], java.lang.String) - */ - public void init(String[] args, String configFile) { + private String name; + + @Override + public void init(String[] args, String name, String configFile) { + this.name = name; try { ComponentContainer.loadComponents(true); } catch (AlreadyLoadedException e) { @@ -49,4 +50,8 @@ public class JustLoadComponentsContainer public void stop() throws ContainerException { } + + public String getName() { + return name; + } } Modified: ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/NamingServiceContainer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/NamingServiceContainer.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/NamingServiceContainer.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/container/NamingServiceContainer.java Tue Aug 7 06:25:59 2012 @@ -44,10 +44,13 @@ public class NamingServiceContainer impl protected RMIExtendedSocketFactory rmiSocketFactory; - public void init(String[] args, String configFile) throws ContainerException { + private String name; + + public void init(String[] args, String name, String configFile) throws ContainerException { + this.name =name; this.configFileLocation = configFile; - ContainerConfig.Container cfg = ContainerConfig.getContainer("naming-container", configFileLocation); + ContainerConfig.Container cfg = ContainerConfig.getContainer(name, configFileLocation); // get the telnet-port ContainerConfig.Container.Property port = cfg.getProperty("port"); @@ -93,4 +96,8 @@ public class NamingServiceContainer impl } } } + + public String getName() { + return name; + } } Modified: ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/util/UtilHttp.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/util/UtilHttp.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/util/UtilHttp.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/base/src/org/ofbiz/base/util/UtilHttp.java Tue Aug 7 06:25:59 2012 @@ -113,7 +113,7 @@ public class UtilHttp { */ public static Map<String, Object> getParameterMap(HttpServletRequest request, Set<? extends String> nameSet, Boolean onlyIncludeOrSkip) { boolean onlyIncludeOrSkipPrim = onlyIncludeOrSkip == null ? true : onlyIncludeOrSkip.booleanValue(); - Map<String, Object> paramMap = FastMap.newInstance(); + Map<String, Object> paramMap = new HashMap<String, Object>(); // add all the actual HTTP request parameters Enumeration<String> e = UtilGenerics.cast(request.getParameterNames()); Modified: ofbiz/branches/jackrabbit20120501/framework/build.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/build.xml?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/build.xml (original) +++ ofbiz/branches/jackrabbit20120501/framework/build.xml Tue Aug 7 06:25:59 2012 @@ -28,7 +28,7 @@ under the License. security/build.xml,service/build.xml,entityext/build.xml, bi/build.xml,minilang/build.xml, webapp/build.xml,widget/build.xml, - common/build.xml,datafile/build.xml,birt/build.xml, + common/build.xml,datafile/build.xml, testtools/build.xml, appserver/build.xml,webtools/build.xml,jcr/build.xml"/> Modified: ofbiz/branches/jackrabbit20120501/framework/catalina/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/catalina/ofbiz-component.xml?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/catalina/ofbiz-component.xml (original) +++ ofbiz/branches/jackrabbit20120501/framework/catalina/ofbiz-component.xml Tue Aug 7 06:25:59 2012 @@ -27,6 +27,320 @@ under the License. <classpath type="dir" location="config"/> <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/> + <container name="catalina-container" loaders="main" class="org.ofbiz.catalina.container.CatalinaContainer"> + <!-- static configuration for tomcat --> + <property name="delegator-name" value="default"/> + <property name="use-naming" value="false"/> + <property name="debug" value="0"/> + <property name="catalina-runtime-home" value="runtime/catalina"/> + <property name="apps-context-reloadable" value="false"/> + <property name="apps-cross-context" value="false"/> + <property name="apps-distributable" value="false"/><!-- you must also set all the webapps you want distributable, by adding <distributable/> in their web.xml file --> + <!-- one or more tomcat engines (servers); map to this + host --> + <property name="default-server" value="engine"> + <property name="default-host" value="0.0.0.0"/> + <property name="jvm-route" value="jvm1"/> + <property name="access-log-pattern"> + <property-value>%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"</property-value> + </property> + <property name="access-log-resolve" value="true"/> + <property name="access-log-rotate" value="true"/> + <property name="access-log-prefix" value="access_log."/> + <property name="access-log-dir" value="runtime/logs"/> + <!-- uncomment for cluster support + <property name="default-server-cluster" value="cluster"> + <property name="rep-valve-filter"> + <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value> + </property> + <property name="manager-class" value="org.apache.catalina.ha.session.DeltaManager"/> + <property name="debug" value="5"/> + <property name="replication-mode" value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/> + <property name="tcp-listen-host" value="auto"/> + <property name="tcp-listen-port" value="4001"/> + <property name="tcp-sector-timeout" value="100"/> + <property name="tcp-thread-count" value="6"/> + <property name="mcast-bind-addr" value="192.168.2.1"/> + <property name="mcast-addr" value="228.0.0.4"/> + <property name="mcast-port" value="45564"/> + <property name="mcast-freq" value="500"/> + <property name="mcast-drop-time" value="3000"/> + </property> + --> + <!-- <property name="ssl-accelerator-port" value="8443"/> --> + <property name="enable-cross-subdomain-sessions" value="false"/> + </property> + <!-- all connectors support type, host, port, enable-lookups --> + <property name="ajp-connector" value="connector"> + <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference --> + <property name="allowTrace" value="false"/> + <property name="emptySessionPath" value="false"/> + <property name="enableLookups" value="false"/> + <property name="maxPostSize" value="2097152"/> + <property name="protocol" value="AJP/1.3"/> + <property name="proxyName" value=""/> + <property name="proxyPort" value=""/> + <property name="redirectPort" value=""/> + <property name="scheme" value="http"/> + <property name="secure" value="false"/> + <property name="URIEncoding" value="UTF-8"/> + <property name="useBodyEncodingForURI" value="false"/> + <property name="xpoweredBy" value="true"/> + <!-- AJP/13 connector attributes --> + <property name="address" value="0.0.0.0"/> + <property name="backlog" value="10"/> + <property name="maxSpareThreads" value="50"/> + <property name="maxThreads" value="200"/> + <property name="minSpareThreads" value="4"/> + <property name="port" value="8009"/> + <property name="tcpNoDelay" value="true"/> + <property name="soTimeout" value="60000"/> + <property name="tomcatAuthentication" value="true"/> + </property> + <property name="http-connector" value="connector"> + <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference --> + <property name="allowTrace" value="false"/> + <property name="emptySessionPath" value="false"/> + <property name="enableLookups" value="false"/> + <property name="maxPostSize" value="2097152"/> + <property name="protocol" value="HTTP/1.1"/> + <property name="proxyName" value=""/> + <property name="proxyPort" value=""/> + <property name="redirectPort" value=""/> + <property name="scheme" value="http"/> + <property name="secure" value="false"/> + <property name="URIEncoding" value="UTF-8"/> + <property name="useBodyEncodingForURI" value="false"/> + <property name="xpoweredBy" value="true"/> + <!-- HTTP connector attributes --> + <property name="acceptCount" value="10"/> + <property name="address" value="0.0.0.0"/> + <property name="bufferSize" value="2048"/> + <property name="compression" value="on"/> + <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/> + <property name="noCompressionUserAgents" value=""/> + <property name="connectionLinger" value="-1"/> + <property name="connectionTimeout" value="60000"/> + <property name="disableUploadTimeout" value="false"/> + <property name="maxHttpHeaderSize" value="4096"/> + <property name="maxKeepAliveRequests" value="100"/> + <property name="maxSpareThreads" value="50"/> + <property name="maxThreads" value="100"/> + <property name="minSpareThreads" value="4"/> + <property name="port" value="8080"/> + <property name="restrictedUserAgents" value=""/> + <property name="server" value=""/> + <property name="socketBuffer" value="9000"/> + <property name="strategy" value="lf"/> + <property name="tcpNoDelay" value="true"/> + <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/> + </property> + <property name="https-connector" value="connector"> + <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference --> + <property name="allowTrace" value="false"/> + <property name="emptySessionPath" value="false"/> + <property name="enableLookups" value="false"/> + <property name="maxPostSize" value="2097152"/> + <property name="protocol" value="HTTP/1.1"/> + <property name="proxyName" value=""/> + <property name="proxyPort" value=""/> + <property name="redirectPort" value=""/> + <property name="scheme" value="https"/> + <property name="secure" value="true"/> + <property name="URIEncoding" value="UTF-8"/> + <property name="useBodyEncodingForURI" value="false"/> + <property name="xpoweredBy" value="true"/> + <!-- HTTP connector attributes --> + <property name="acceptCount" value="10"/> + <property name="address" value="0.0.0.0"/> + <property name="bufferSize" value="2048"/> + <property name="compression" value="on"/> + <property name="compressableMimeType" value="text/html,text/xml,text/plain,text/javascript,text/css"/> + <property name="noCompressionUserAgents" value=""/> + <property name="connectionLinger" value="-1"/> + <property name="connectionTimeout" value="60000"/> + <property name="disableUploadTimeout" value="false"/> + <property name="maxHttpHeaderSize" value="4096"/> + <property name="maxKeepAliveRequests" value="100"/> + <property name="maxSpareThreads" value="50"/> + <property name="maxThreads" value="100"/> + <property name="minSpareThreads" value="4"/> + <property name="port" value="8443"/> + <property name="restrictedUserAgents" value=""/> + <property name="server" value=""/> + <property name="socketBuffer" value="9000"/> + <property name="strategy" value="lf"/> + <property name="tcpNoDelay" value="true"/> + <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/> + <!-- SSL connector attributes --> + <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/> + <property name="algorithm" value="SunX509"/> + <!-- the clientAuth to "want" in order to receive certs from the client; + note that this isn't set this way by default because with certain browsers + (like Safari) it breaks access via HTTPS, so until that problem is fixed + the default will be false --> + <property name="clientAuth" value="false"/> + <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/> + <property name="keystorePass" value="changeit"/> + <property name="keystoreType" value="JKS"/> + <property name="sslProtocol" value="TLS"/> + <property name="ciphers" value=""/> + </property> + </container> + <container name="catalina-container-test" loaders="test" class="org.ofbiz.catalina.container.CatalinaContainer"> + <!-- static configuration for tomcat --> + <property name="delegator-name" value="default"/> + <property name="use-naming" value="false"/> + <property name="debug" value="0"/> + <property name="catalina-runtime-home" value="runtime/catalina"/> + <property name="apps-context-reloadable" value="false"/> + <property name="apps-cross-context" value="false"/> + <property name="apps-distributable" value="false"/><!-- you must also set all the webapps you want distributable, by adding <distributable/> in their web.xml file --> + <!-- one or more tomcat engines (servers); map to this + host --> + <property name="default-server" value="engine"> + <property name="default-host" value="0.0.0.0"/> + <property name="jvm-route" value="jvm1"/> + <property name="access-log-pattern"> + <property-value>%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"</property-value> + </property> + <property name="access-log-resolve" value="true"/> + <property name="access-log-rotate" value="true"/> + <property name="access-log-prefix" value="access_log."/> + <property name="access-log-dir" value="runtime/logs"/> + <property name="enable-request-dump" value="false"/> + <!-- uncomment for cluster support + <property name="default-server-cluster" value="cluster"> + <property name="rep-valve-filter"> + <property-value>.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;.*\.png;.*\.css;.*\.ico;.*\.htc;</property-value> + </property> + <property name="manager-class" value="org.apache.catalina.cluster.session.DeltaManager"/> + <property name="debug" value="5"/> + <property name="replication-mode" value="org.apache.catalina.tribes.transport.bio.PooledMultiSender"/> + <property name="tcp-listen-host" value="auto"/> + <property name="tcp-listen-port" value="4001"/> + <property name="tcp-sector-timeout" value="100"/> + <property name="tcp-thread-count" value="6"/> + <property name="mcast-bind-addr" value="192.168.2.1"/> + <property name="mcast-addr" value="224.0.0.1"/> + <property name="mcast-port" value="45564"/> + <property name="mcast-freq" value="500"/> + <property name="mcast-drop-time" value="3000"/> + </property> + --> + <!-- <property name="ssl-accelerator-port" value="8443"/> --> + </property> + <!-- all connectors support type, host, port, enable-lookups --> + <property name="ajp-connector" value="connector"> + <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/ajp.html for reference --> + <property name="allowTrace" value="false"/> + <property name="emptySessionPath" value="false"/> + <property name="enableLookups" value="false"/> + <property name="maxPostSize" value="2097152"/> + <property name="protocol" value="AJP/1.3"/> + <property name="proxyName" value=""/> + <property name="proxyPort" value=""/> + <property name="redirectPort" value=""/> + <property name="scheme" value="http"/> + <property name="secure" value="false"/> + <property name="URIEncoding" value="UTF-8"/> + <property name="useBodyEncodingForURI" value="false"/> + <property name="xpoweredBy" value="true"/> + <!-- AJP/13 connector attributes --> + <property name="address" value="0.0.0.0"/> + <property name="backlog" value="10"/> + <property name="maxSpareThreads" value="50"/> + <property name="maxThreads" value="200"/> + <property name="minSpareThreads" value="4"/> + <property name="port" value="8010"/> + <property name="tcpNoDelay" value="true"/> + <property name="soTimeout" value="60000"/> + <property name="tomcatAuthentication" value="true"/> + </property> + <property name="http-connector" value="connector"> + <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference --> + <property name="allowTrace" value="false"/> + <property name="emptySessionPath" value="false"/> + <property name="enableLookups" value="false"/> + <property name="maxPostSize" value="2097152"/> + <property name="protocol" value="HTTP/1.1"/> + <property name="proxyName" value=""/> + <property name="proxyPort" value=""/> + <property name="redirectPort" value=""/> + <property name="scheme" value="http"/> + <property name="secure" value="false"/> + <property name="URIEncoding" value="UTF-8"/> + <property name="useBodyEncodingForURI" value="false"/> + <property name="xpoweredBy" value="true"/> + <!-- HTTP connector attributes --> + <property name="acceptCount" value="10"/> + <property name="address" value="0.0.0.0"/> + <property name="bufferSize" value="2048"/> + <property name="compressableMimeType" value="text/html,text/xml,text/plain"/> + <property name="compression" value="on"/> + <property name="connectionLinger" value="-1"/> + <property name="connectionTimeout" value="60000"/> + <property name="disableUploadTimeout" value="false"/> + <property name="maxHttpHeaderSize" value="4096"/> + <property name="maxKeepAliveRequests" value="100"/> + <property name="maxSpareThreads" value="50"/> + <property name="maxThreads" value="100"/> + <property name="minSpareThreads" value="4"/> + <property name="noCompressionUserAgents" value=""/> + <property name="port" value="8081"/> + <property name="restrictedUserAgents" value=""/> + <property name="server" value=""/> + <property name="socketBuffer" value="9000"/> + <property name="strategy" value="lf"/> + <property name="tcpNoDelay" value="true"/> + <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/> + </property> + <property name="https-connector" value="connector"> + <!-- see http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/http.html for reference --> + <property name="allowTrace" value="false"/> + <property name="emptySessionPath" value="false"/> + <property name="enableLookups" value="false"/> + <property name="maxPostSize" value="2097152"/> + <property name="protocol" value="HTTP/1.1"/> + <property name="proxyName" value=""/> + <property name="proxyPort" value=""/> + <property name="redirectPort" value=""/> + <property name="scheme" value="https"/> + <property name="secure" value="true"/> + <property name="URIEncoding" value="UTF-8"/> + <property name="useBodyEncodingForURI" value="false"/> + <property name="xpoweredBy" value="true"/> + <!-- HTTP connector attributes --> + <property name="acceptCount" value="10"/> + <property name="address" value="0.0.0.0"/> + <property name="bufferSize" value="2048"/> + <property name="compressableMimeType" value="text/html,text/xml,text/plain"/> + <property name="compression" value="on"/> + <property name="connectionLinger" value="-1"/> + <property name="connectionTimeout" value="60000"/> + <property name="disableUploadTimeout" value="false"/> + <property name="maxHttpHeaderSize" value="4096"/> + <property name="maxKeepAliveRequests" value="100"/> + <property name="maxSpareThreads" value="50"/> + <property name="maxThreads" value="100"/> + <property name="minSpareThreads" value="4"/> + <property name="noCompressionUserAgents" value=""/> + <property name="port" value="8444"/> + <property name="restrictedUserAgents" value=""/> + <property name="server" value=""/> + <property name="socketBuffer" value="9000"/> + <property name="strategy" value="lf"/> + <property name="tcpNoDelay" value="true"/> + <property name="threadPriority" value="java.lang.Thread#NORM_PRIORITY"/> + <!-- SSL connector attributes --> + <property name="sSLImplementation" value="org.ofbiz.catalina.container.SSLImpl"/> + <property name="algorithm" value="SunX509"/> + <property name="clientAuth" value="want"/> + <property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/> + <property name="keystorePass" value="changeit"/> + <property name="keystoreType" value="JKS"/> + <property name="sslProtocol" value="TLS"/> + <property name="ciphers" value=""/> + </property> + </container> <!-- <webapp name="catalina-root" title="ROOT" Modified: ofbiz/branches/jackrabbit20120501/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Tue Aug 7 06:25:59 2012 @@ -171,12 +171,13 @@ public class CatalinaContainer implement protected String catalinaRuntimeHome; - /** - * @see org.ofbiz.base.container.Container#init(java.lang.String[], java.lang.String) - */ - public void init(String[] args, String configFile) throws ContainerException { + private String name; + + @Override + public void init(String[] args, String name, String configFile) throws ContainerException { + this.name = name; // get the container config - ContainerConfig.Container cc = ContainerConfig.getContainer("catalina-container", configFile); + ContainerConfig.Container cc = ContainerConfig.getContainer(name, configFile); if (cc == null) { throw new ContainerException("No catalina-container configuration found in container config!"); } @@ -803,6 +804,10 @@ public class CatalinaContainer implement } } + public String getName() { + return name; + } + protected void configureMimeTypes(Context context) throws ContainerException { Map<String, String> mimeTypes = CatalinaContainer.getMimeTypes(); if (UtilValidate.isNotEmpty(mimeTypes)) { Modified: ofbiz/branches/jackrabbit20120501/framework/common/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/common/servicedef/services.xml?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/common/servicedef/services.xml (original) +++ ofbiz/branches/jackrabbit20120501/framework/common/servicedef/services.xml Tue Aug 7 06:25:59 2012 @@ -787,4 +787,20 @@ under the License. <attribute name="encoding" mode="IN" type="String" optional="true" default-value="UTF-8"></attribute> </service> + <!-- Metrics services --> + <service name="getAllMetrics" auth="true" use-transaction="false" + engine="java" location="org.ofbiz.common.CommonServices" invoke="getAllMetrics"> + <description> + Get all metrics. Returns a List of Maps - one Map per metric. Each Map includes the following keys: + name, serviceRate, threshold, totalEvents. See org.ofbiz.base.metrics.Metrics. + </description> + <attribute name="metricsList" mode="OUT" type="java.util.List" optional="false" /> + </service> + + <service name="resetMetric" auth="true" use-transaction="false" + engine="java" location="org.ofbiz.common.CommonServices" invoke="resetMetric"> + <description>Resets a metric. See org.ofbiz.base.metrics.Metrics.</description> + <attribute name="name" mode="IN" type="String" optional="false"/> + </service> + </services> Modified: ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/CommonServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/CommonServices.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/CommonServices.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/CommonServices.java Tue Aug 7 06:25:59 2012 @@ -18,11 +18,14 @@ *******************************************************************************/ package org.ofbiz.common; +import static org.ofbiz.base.util.UtilGenerics.checkList; +import static org.ofbiz.base.util.UtilGenerics.checkMap; + import java.io.BufferedReader; import java.io.FileNotFoundException; +import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.RandomAccessFile; @@ -43,14 +46,14 @@ import javolution.util.FastMap; import org.apache.log4j.Level; import org.apache.log4j.Logger; +import org.ofbiz.base.metrics.Metrics; +import org.ofbiz.base.metrics.MetricsFactory; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilDateTime; -import org.ofbiz.base.util.UtilValidate; - -import static org.ofbiz.base.util.UtilGenerics.checkList; -import static org.ofbiz.base.util.UtilGenerics.checkMap; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -63,6 +66,7 @@ import org.ofbiz.service.ModelService; import org.ofbiz.service.ServiceUtil; import org.ofbiz.service.ServiceXaWrapper; import org.ofbiz.service.mail.MimeMessageWrapper; +import org.owasp.esapi.errors.EncodingException; /** * Common Services @@ -541,4 +545,35 @@ public class CommonServices { } } + public static Map<String, Object> getAllMetrics(DispatchContext dctx, Map<String, ?> context) { + List<Map<String, Object>> metricsMapList = FastList.newInstance(); + List<Metrics> metricsList = MetricsFactory.getMetrics(); + for (Metrics metrics : metricsList) { + Map<String, Object> metricsMap = FastMap.newInstance(); + metricsMap.put("name", metrics.getName()); + metricsMap.put("serviceRate", metrics.getServiceRate()); + metricsMap.put("threshold", metrics.getThreshold()); + metricsMap.put("totalEvents", metrics.getTotalEvents()); + metricsMapList.add(metricsMap); + } + Map<String, Object> result = ServiceUtil.returnSuccess(); + result.put("metricsList", metricsMapList); + return result; + } + + public static Map<String, Object> resetMetric(DispatchContext dctx, Map<String, ?> context) { + String name = (String) context.get("name"); + try { + name = StringUtil.defaultWebEncoder.decodeFromURL(name); + } catch (EncodingException e) { + return ServiceUtil.returnError("Exception thrown while decoding metric name \"" + name + "\""); + } + Metrics metric = MetricsFactory.getMetric(name); + if (metric != null) { + metric.reset(); + return ServiceUtil.returnSuccess(); + + } + return ServiceUtil.returnError("Metric \"" + name + "\" not found."); + } } Modified: ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/authentication/api/Authenticator.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/authentication/api/Authenticator.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/authentication/api/Authenticator.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/authentication/api/Authenticator.java Tue Aug 7 06:25:59 2012 @@ -33,7 +33,7 @@ public interface Authenticator { /** * Method called when authenticator is first initialized (the delegator * object can be obtained from the LocalDispatcher) - * @param dispatcher The ServiceDispatcher to use for this Authenticator + * @param dispatcher The LocalDispatcher to use for this Authenticator */ public void initialize(LocalDispatcher dispatcher); Modified: ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/authentication/example/TestFailAuthenticator.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/authentication/example/TestFailAuthenticator.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/authentication/example/TestFailAuthenticator.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/authentication/example/TestFailAuthenticator.java Tue Aug 7 06:25:59 2012 @@ -39,7 +39,7 @@ public class TestFailAuthenticator imple * Method called when authenticator is first initialized (the delegator * object can be obtained from the LocalDispatcher) * - * @param dispatcher The ServiceDispatcher to use for this Authenticator + * @param dispatcher The LocalDispatcher to use for this Authenticator */ public void initialize(LocalDispatcher dispatcher) { this.dispatcher = dispatcher; Modified: ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/scripting/ContextHelper.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/scripting/ContextHelper.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/scripting/ContextHelper.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/common/src/org/ofbiz/common/scripting/ContextHelper.java Tue Aug 7 06:25:59 2012 @@ -40,7 +40,6 @@ import org.ofbiz.base.util.string.Flexib import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericValue; import org.ofbiz.security.Security; -import org.ofbiz.security.authz.Authorization; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ModelService; @@ -78,10 +77,6 @@ public final class ContextHelper { return FlexibleStringExpander.expandString(original, getBindings()); } - public Authorization getAuthz() { - return (Authorization) this.context.getAttribute("authz"); - } - public Map<String, Object> getBindings() { return this.context.getBindings(ScriptContext.ENGINE_SCOPE); } Modified: ofbiz/branches/jackrabbit20120501/framework/common/webcommon/WEB-INF/common-controller.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/common/webcommon/WEB-INF/common-controller.xml?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/common/webcommon/WEB-INF/common-controller.xml (original) +++ ofbiz/branches/jackrabbit20120501/framework/common/webcommon/WEB-INF/common-controller.xml Tue Aug 7 06:25:59 2012 @@ -44,7 +44,6 @@ under the License. <handler name="screenfop" type="view" class="org.ofbiz.widget.screen.ScreenFopViewHandler"/> <handler name="jsp" type="view" class="org.ofbiz.webapp.view.JspViewHandler"/> <handler name="http" type="view" class="org.ofbiz.webapp.view.HttpViewHandler"/> - <handler name="birt" type="view" class="org.ofbiz.birt.webapp.view.BirtViewHandler"/> <preprocessor> <!-- Events to run on every request before security (chains exempt) --> Modified: ofbiz/branches/jackrabbit20120501/framework/common/webcommon/WEB-INF/portal-controller.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/common/webcommon/WEB-INF/portal-controller.xml?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/common/webcommon/WEB-INF/portal-controller.xml (original) +++ ofbiz/branches/jackrabbit20120501/framework/common/webcommon/WEB-INF/portal-controller.xml Tue Aug 7 06:25:59 2012 @@ -27,10 +27,6 @@ under the License. <security https="true" auth="true"/> <response name="success" type="view" value="showPortlet"/> </request-map> - <request-map uri="refreshPortlet"> - <security https="true" auth="true"/> - <response name="success" type="view" value="showPortletUiLabelDecorator"/> - </request-map> <request-map uri="showPortletMainDecorator"> <security https="true" auth="true"/> <response name="success" type="view" value="showPortletMainDecorator"/> @@ -82,12 +78,6 @@ under the License. <response name="success" type="view-last" value="main" save-last-view="true"/> <response name="error" type="request" value="main"/> </request-map> - <request-map uri="updatePortalPagePortletSeq"> - <security https="true" auth="true"/> - <event type="service" invoke="updatePortalPagePortletSeq"/> - <response name="success" type="view-last" value="main" save-last-view="true"/> - <response name="error" type="request" value="main"/> - </request-map> <request-map uri="updatePortletSeqDragDrop"> <security https="true" auth="true"/> <event type="service" invoke="updatePortletSeqDragDrop"/> @@ -170,7 +160,6 @@ under the License. <!-- View Mappings --> <view-map name="showPortalPage" type="screen" page="component://common/widget/PortalPageScreens.xml#showPortalPage"/> <view-map name="showPortlet" type="screen" page="component://common/widget/PortalPageScreens.xml#showPortlet"/> - <view-map name="showPortletUiLabelDecorator" type="screen" page="component://common/widget/PortalPageScreens.xml#showPortletUiLabelDecorator"/> <view-map name="showPortletMainDecorator" type="screen" page="component://common/widget/PortalPageScreens.xml#showPortletMainDecorator"/> <view-map name="showPortletSimpleDecorator" type="screen" page="component://common/widget/PortalPageScreens.xml#showPortletSimpleDecorator"/> <view-map name="ManagePortalPages" type="screen" page="component://common/widget/PortalPageScreens.xml#ManagePortalPages"/> Modified: ofbiz/branches/jackrabbit20120501/framework/component-load.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/component-load.xml?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/component-load.xml (original) +++ ofbiz/branches/jackrabbit20120501/framework/component-load.xml Tue Aug 7 06:25:59 2012 @@ -24,16 +24,15 @@ under the License. <load-component component-location="geronimo"/> <load-component component-location="sql"/> <load-component component-location="entity"/> - <load-component component-location="catalina"/> - <!-- <load-component component-location="jetty"/> --> <load-component component-location="security"/> <load-component component-location="datafile"/> <load-component component-location="minilang"/> <load-component component-location="common"/> <load-component component-location="service"/> + <!-- <load-component component-location="jetty"/> --> + <load-component component-location="catalina"/> <load-component component-location="entityext"/> <load-component component-location="bi"/> - <load-component component-location="birt"/> <load-component component-location="webapp"/> <load-component component-location="widget"/> <load-component component-location="appserver"/> Modified: ofbiz/branches/jackrabbit20120501/framework/entity/build.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/build.xml?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/build.xml (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/build.xml Tue Aug 7 06:25:59 2012 @@ -41,8 +41,6 @@ under the License. </path> <patternset id="src.exc.set"> - <exclude name="org/ofbiz/entity/connection/XaPoolConnectionFactory.java"/> - <exclude name="org/ofbiz/entity/connection/TyrexConnectionFactory.java"/> </patternset> <target name="jar" depends="classes"> Modified: ofbiz/branches/jackrabbit20120501/framework/entity/dtd/entitymodel.xsd URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/dtd/entitymodel.xsd?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/dtd/entitymodel.xsd (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/dtd/entitymodel.xsd Tue Aug 7 06:25:59 2012 @@ -92,6 +92,15 @@ under the License. <xs:attribute name="never-cache" default="false" type="boolean"/> <xs:attribute name="never-check" default="false" type="boolean"/> <xs:attribute name="auto-clear-cache" default="true" type="boolean"/> + <xs:attribute name="redefinition" type="boolean"> + <xs:annotation> + <xs:documentation> + Indicates if this entity redefines an existing entity. + When set to "true" it will suppress "Entity is defined more than once" warnings. + Defaults to "false". + </xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute name="title" type="xs:string"/> <xs:attribute name="copyright" type="xs:string"/> <xs:attribute name="author" type="xs:string"/> Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/Delegator.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/Delegator.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/Delegator.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/Delegator.java Tue Aug 7 06:25:59 2012 @@ -844,7 +844,7 @@ public interface Delegator { * * @throws IllegalArgumentException * if the list found has more than one item - * @deprecated use {@link #getRelatedOne(String, GenericValue, boolean) + * @deprecated use {@link #getRelatedOne(String, GenericValue, boolean)} */ @Deprecated public GenericValue getRelatedOne(String relationName, GenericValue value) throws GenericEntityException; @@ -856,7 +856,7 @@ public interface Delegator { * * @throws IllegalArgumentException * if the list found has more than one item - * @deprecated use {@link #getRelatedOne(String, GenericValue, boolean) + * @deprecated use {@link #getRelatedOne(String, GenericValue, boolean)} */ @Deprecated public GenericValue getRelatedOneCache(String relationName, GenericValue value) throws GenericEntityException; Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/DatasourceInfo.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/DatasourceInfo.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/DatasourceInfo.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/DatasourceInfo.java Tue Aug 7 06:25:59 2012 @@ -26,13 +26,12 @@ import org.ofbiz.base.util.UtilXml; import org.w3c.dom.Element; /** - * Misc. utility method for dealing with the entityengine.xml file + * A model for the <datasource> element. * */ -public class DatasourceInfo { +public class DatasourceInfo extends NamedInfo { public static final String module = DatasourceInfo.class.getName(); - public String name; public String helperClass; public String fieldTypeName; public List<? extends Element> sqlLoadPaths; @@ -79,7 +78,7 @@ public class DatasourceInfo { public int maxWorkerPoolSize = 1; public DatasourceInfo(Element element) { - this.name = element.getAttribute("name"); + super(element); this.helperClass = element.getAttribute("helper-class"); this.fieldTypeName = element.getAttribute("field-type-name"); Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/DelegatorInfo.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/DelegatorInfo.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/DelegatorInfo.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/DelegatorInfo.java Tue Aug 7 06:25:59 2012 @@ -21,12 +21,11 @@ package org.ofbiz.entity.config; import java.util.HashMap; import java.util.Map; -import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.w3c.dom.Element; /** - * Misc. utility method for dealing with the entityengine.xml file + * A model for the <delegator> element. * */ public class DelegatorInfo extends NamedInfo { @@ -57,15 +56,15 @@ public class DelegatorInfo extends Named // this defaults to false, ie anything but true is false this.useDistributedCacheClear = "true".equalsIgnoreCase(element.getAttribute("distributed-cache-clear-enabled")); this.distributedCacheClearClassName = element.getAttribute("distributed-cache-clear-class-name"); - if (UtilValidate.isEmpty(this.distributedCacheClearClassName)) this.distributedCacheClearClassName = "org.ofbiz.entityext.cache.EntityCacheServices"; + if (this.distributedCacheClearClassName.isEmpty()) this.distributedCacheClearClassName = "org.ofbiz.entityext.cache.EntityCacheServices"; this.distributedCacheClearUserLoginId = element.getAttribute("distributed-cache-clear-user-login-id"); - if (UtilValidate.isEmpty(this.distributedCacheClearUserLoginId)) this.distributedCacheClearUserLoginId = "system"; + if (this.distributedCacheClearUserLoginId.isEmpty()) this.distributedCacheClearUserLoginId = "system"; this.sequencedIdPrefix = element.getAttribute("sequenced-id-prefix"); this.defaultGroupName = element.getAttribute("default-group-name"); - if (UtilValidate.isEmpty(this.defaultGroupName)) this.defaultGroupName = "org.ofbiz"; + if (this.defaultGroupName.isEmpty()) this.defaultGroupName = "org.ofbiz"; for (Element groupMapElement: UtilXml.childElementList(element, "group-map")) { groupMap.put(groupMapElement.getAttribute("group-name"), groupMapElement.getAttribute("datasource-name")); Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityDataReaderInfo.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityDataReaderInfo.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityDataReaderInfo.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityDataReaderInfo.java Tue Aug 7 06:25:59 2012 @@ -21,7 +21,7 @@ package org.ofbiz.entity.config; import org.w3c.dom.Element; /** - * Misc. utility method for dealing with the entityengine.xml file + * A model for the <entity-data-reader> element. * */ public class EntityDataReaderInfo extends ResourceInfo { Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityEcaReaderInfo.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityEcaReaderInfo.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityEcaReaderInfo.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityEcaReaderInfo.java Tue Aug 7 06:25:59 2012 @@ -21,8 +21,7 @@ package org.ofbiz.entity.config; import org.w3c.dom.Element; /** - * Misc. utility method for dealing with the entityengine.xml file - * + * A model for the <entity-eca-reader> element. */ public class EntityEcaReaderInfo extends ResourceInfo { public EntityEcaReaderInfo(Element element) { Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityGroupReaderInfo.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityGroupReaderInfo.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityGroupReaderInfo.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityGroupReaderInfo.java Tue Aug 7 06:25:59 2012 @@ -18,11 +18,10 @@ *******************************************************************************/ package org.ofbiz.entity.config; -import org.ofbiz.base.util.UtilValidate; import org.w3c.dom.Element; /** - * Misc. utility method for dealing with the entityengine.xml file + * A model for the <entity-group-reader> element. * */ public class EntityGroupReaderInfo extends ResourceInfo { @@ -30,8 +29,7 @@ public class EntityGroupReaderInfo exten super(element); String loader = element.getAttribute("loader"); String location = element.getAttribute("location"); - - if (UtilValidate.isNotEmpty(loader) && UtilValidate.isNotEmpty(location)) { + if (!loader.isEmpty() && !location.isEmpty()) { resourceElements.add(0, element); } } Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityModelReaderInfo.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityModelReaderInfo.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityModelReaderInfo.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/EntityModelReaderInfo.java Tue Aug 7 06:25:59 2012 @@ -21,7 +21,7 @@ package org.ofbiz.entity.config; import org.w3c.dom.Element; /** - * Misc. utility method for dealing with the entityengine.xml file + * A model for the <entity-model-reader> element. * */ public class EntityModelReaderInfo extends ResourceInfo { Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/FieldTypeInfo.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/FieldTypeInfo.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/FieldTypeInfo.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/FieldTypeInfo.java Tue Aug 7 06:25:59 2012 @@ -21,10 +21,11 @@ package org.ofbiz.entity.config; import org.w3c.dom.Element; /** - * Misc. utility method for dealing with the entityengine.xml file + * A model for the <field-type> element. * */ public class FieldTypeInfo extends NamedInfo { + // FIXME: Do not keep a reference to the DOM Element. public Element resourceElement; public FieldTypeInfo(Element element) { Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/NamedInfo.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/NamedInfo.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/NamedInfo.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/NamedInfo.java Tue Aug 7 06:25:59 2012 @@ -21,7 +21,7 @@ package org.ofbiz.entity.config; import org.w3c.dom.Element; /** - * Misc. utility method for dealing with the entityengine.xml file + * A base class for entity engine element models. * */ public abstract class NamedInfo { Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/ResourceInfo.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/ResourceInfo.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/ResourceInfo.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/config/ResourceInfo.java Tue Aug 7 06:25:59 2012 @@ -26,10 +26,11 @@ import org.ofbiz.base.util.UtilXml; import javolution.util.FastList; /** - * Misc. utility method for dealing with the entityengine.xml file + * A container for <resource> elements. * */ public abstract class ResourceInfo extends NamedInfo { + // FIXME: Do not keep a reference to DOM Elements. public List<Element> resourceElements = FastList.newInstance(); public ResourceInfo(Element element) { Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java Tue Aug 7 06:25:59 2012 @@ -96,7 +96,7 @@ public class GenericDAO { this.helperInfo = helperInfo; this.modelFieldTypeReader = ModelFieldTypeReader.getModelFieldTypeReader(helperInfo.getHelperBaseName()); this.datasourceInfo = EntityConfigUtil.getDatasourceInfo(helperInfo.getHelperBaseName()); - this.executor = ExecutionPool.getExecutor(GENERIC_DAO_THREAD_GROUP, "entity-datasource(" + helperInfo.getHelperFullName() + ")", datasourceInfo.maxWorkerPoolSize, false); + this.executor = ExecutionPool.getExecutor(GENERIC_DAO_THREAD_GROUP, "OFBiz-entity-datasource(" + helperInfo.getHelperFullName() + ")", datasourceInfo.maxWorkerPoolSize, false); } public <T> Future<T> submitWork(Callable<T> callable) throws GenericEntityException { Modified: ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/datasource/MemoryHelper.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/datasource/MemoryHelper.java?rev=1370126&r1=1370125&r2=1370126&view=diff ============================================================================== --- ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/datasource/MemoryHelper.java (original) +++ ofbiz/branches/jackrabbit20120501/framework/entity/src/org/ofbiz/entity/datasource/MemoryHelper.java Tue Aug 7 06:25:59 2012 @@ -281,7 +281,7 @@ public class MemoryHelper implements Gen this.helperName = helperName; modelFieldTypeReader = ModelFieldTypeReader.getModelFieldTypeReader(helperName); DatasourceInfo datasourceInfo = EntityConfigUtil.getDatasourceInfo(helperName); - this.executor = ExecutionPool.getExecutor(MEMORY_HELPER_THREAD_GROUP, "entity-datasource(" + helperName + ")", datasourceInfo.maxWorkerPoolSize, false); + this.executor = ExecutionPool.getExecutor(MEMORY_HELPER_THREAD_GROUP, "OFBiz-entity-datasource(" + helperName + ")", datasourceInfo.maxWorkerPoolSize, false); } public String getHelperName() { |
| Free forum by Nabble | Edit this page |
