jscadden
12-01-2004, 04:40 PM
Is there a way with Spring.net to have the Container instantiate an object off of an event.
Example:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="objects" type="Spring.Context.Support.ApplicationContextHandler,S pring.Context"/>
</configSections>
<objects>
<object name="Application"
class="PMTS.Spring.SpringLauncher, PMTS" />
<object name="PMTS.Spring.SpringController"
class="PMTS.Spring.SpringController, PMTS">
<listener event="Startup" method="OnStartup">
<ref object="Application"/>
</listener>
</object>
</objects>
</configuration>
I want the SpringController to be instantiated when the Startup event is fired by PMTS.Spring.SpringLauncher. Currently it is being instantiated when the following is called.
IApplicationContext ctx = ConfigurationSettings.GetConfig ("objects") as IApplicationContext;
The thinking is have a small footprint when the application is started. and then as the user activates features (By an event firing), those objects are instantiated.[/code]
Example:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="objects" type="Spring.Context.Support.ApplicationContextHandler,S pring.Context"/>
</configSections>
<objects>
<object name="Application"
class="PMTS.Spring.SpringLauncher, PMTS" />
<object name="PMTS.Spring.SpringController"
class="PMTS.Spring.SpringController, PMTS">
<listener event="Startup" method="OnStartup">
<ref object="Application"/>
</listener>
</object>
</objects>
</configuration>
I want the SpringController to be instantiated when the Startup event is fired by PMTS.Spring.SpringLauncher. Currently it is being instantiated when the following is called.
IApplicationContext ctx = ConfigurationSettings.GetConfig ("objects") as IApplicationContext;
The thinking is have a small footprint when the application is started. and then as the user activates features (By an event firing), those objects are instantiated.[/code]