In OFBiz, there are mainly three kinds of container
Container when the system starts
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/AA/wKioL1WCbe7CLfMBAAJRrxpd7o0715.jpg "title=" Start Container.png "alt=" wkiol1wcbe7clfmbaajrrxpd7o0715.jpg "/> This is called in the startup class, according to the framework\base\config\ Loading other containers in the definition in Ofbiz-containers.xml
The container used to load the component
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6E/AE/wKiom1WCbQKSgNVuAAVkMc4P3IM658.jpg "title=" Component Load Container.png "alt=" Wkiom1wcbqksgnvuaavkmc4p3im658.jpg "/>
The container defined here will be started by the top-level container, executing the specified class
The container defined here is basically when the component is not loaded
Container defined in the Component-load.xml component
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/AA/wKioL1WCb9nyzGFLAAgvZ0ig_po991.jpg "title=" The container in the component. png "alt=" wkiol1wcb9nyzgflaagvz0ig_po991.jpg "/> The container on this side is basically executed after the component configuration has all been loaded.
Get container list<containerconfig.container> defined in all components containersdefinedincomponents = componentconfig.getallcontainers (); for (containerconfig.container containercfg: containersdefinedincomponents) { boolean matchingloaderfound = false; if (Utilvalidate.isempty (containercfg.loaders) && Utilvalidate.isempty (loaders)) { //Compare start level 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); //load container, execute the Init method in it this.loadedcontainers.add (TmpContainer);//Add Cache debug.loginfo ( "Loaded component ' s container: " + containercfg.name, module); } }
Summarize:
The container of these three places is not different, mainly because of the starting sequence and the role of the problem to write these container in different configuration files
This article from the "Sea Dragon" blog, declined reprint!
The container-1 in OFBiz