Thank you Martin for yet another text wall,random, off topic, and uninformative post. I am starting to appreciate the advantages of having forums instead of mailing lists...captcha.
musachy On Fri, Jul 10, 2009 at 9:33 AM, Martin Gainty<mgai...@hotmail.com> wrote: > > web.xml configuration for Spring > /* The ContextLoaderListener listener should be registered after > Log4jConfigListener > in web.xml, if the latter is used. > */ > <listener> > > <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> > </listener> > > once thats configured you'll want to use MethodInvokingFactoryBean for > FactoryBean which returns a value which is the result of a static or instance > method invocation > > http://static.springsource.org/spring/docs/1.2.x/api/org/springframework/beans/factory/config/MethodInvokingFactoryBean.html > > as mentioned singleton="true" assures you will load,instantiate and store a > cached bean > > static factory methods: > An example (in an XML based bean factory definition) of a bean definition > which uses this class to call a STATIC factory method: > <bean id="myObject" > class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> > <property > name="staticMethod"><value>com.whatever.MyClassFactory.getInstance</value></property> > </bean> > > <!-- this example will acquire a (target) instance specific version of System > defined (version) property --> > <bean id="sysProps" > class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> > <property name="targetClass"><value>java.lang.System</value></property> > <property name="targetMethod"><value>getProperties</value></property> > </bean> > <bean id="javaVersion" > class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> > <property name="targetObject"><ref local="sysProps"/></property> > <property name="targetMethod"><value>getProperty</value></property> > <property name="arguments"> > <list> > <value>java.version</value> > </list> > </property> > </bean>Since your question addresses GarbageCollection it would be good to > know the difference > between Spring's Beans loader between ApplicationContext (a load class which > implements ApplicationContextAware) and BeanFactory (a class which implements > BeanFactoryAware) > BeanFactory: > 1a)Container locates beans definition (usually derivation of *beans.xml) > 1b)Container Loads beans into Container > 2)is instantiated LATER with getBean() method > > ApplicationContext: > 1a)Container locates beans definition depeding on invoking class > -ClassPathXMLApplicationContext-Loads XML from Classpath > -FileSystemXMLApplicationContext-Loads context from XML file in filesystem > -XMLWebApplicationContext-Loads Context from > XML(beans.xml/ApplicationContext.xml) contained with webApplication > 1b)Container loads and instantiates all beans into Container > > so if you see alot of GC activity from jheap or J2EE Server logs you will > probably want to consider using BeanFactoryAware implementor class instead of > default ApplicationContextAware implementor class > > hope this helps > Martin Gainty > ______________________________________________ > Verzicht und Vertraulichkeitanmerkung > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger > sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung > oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich > dem Austausch von Informationen und entfaltet keine rechtliche > Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen > wir keine Haftung fuer den Inhalt uebernehmen. > > > > > >> Date: Fri, 10 Jul 2009 11:10:17 -0400 >> From: d...@newfield.org >> To: user@struts.apache.org >> Subject: Re: Actions are not Garbage Collected >> >> Musachy Barroso wrote: >> > On Fri, Jul 10, 2009 at 7:53 AM, Musachy Barroso<musa...@gmail.com> wrote: >> >> If your actions are singletons (and they shouldn't be!) then they >> >> are not likely to be collected. >> > >> > because a reference to them will be held by spring, or whatever >> > container you are using. >> >> Or maybe clickstream? http://www.opensymphony.com/clickstream >> >> A brief look at the source >> https://svn.opensymphony.com/svn/clickstream/trunk appears to indicate >> that it only saves stuff extracted from the request object, but maybe I >> missed where it's also saving a reference to the request (and therefore >> the action) itself? >> >> -Dale >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> > > _________________________________________________________________ > Lauren found her dream laptop. Find the PC that’s right for you. > http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290 -- "Hey you! Would you help me to carry the stone?" Pink Floyd --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org