Results 1 to 2 of 2

Thread: on application start

  1. #1
    Join Date
    Nov 2009
    Posts
    1

    Default on application start

    Hi,
    I have a WCF service and use Spring.ServiceModel.Activation.ServiceHostFactory as a factory in my *.svc. What I need is to load some data into cache when service is called first time or restarted.
    Could you please suggest a best way to do so?
    Right now I inherited from the Spring.ServiceModel.Activation.ServiceHostFactory and put my code there but probably should be a better way? Tnx in advance.

  2. #2
    Mark Pollack is offline Spring.NET Co-Lead Spring TeamSpring User
    Join Date
    Sep 2004
    Location
    New York, NY
    Posts
    1,683

    Default

    Hi Alex,

    Where are you hosting the WCF service? Inside IIS? Since you can perform DI on the WCF service, you can inject it with a reference to a DataCache class of some kind. I've usually seen subclassing Spring's ServiceHostFactory when additional behaviors needed to be added progammatically to the host but I guess it could also be used for this bootstrapping purpose. In this case I guess you expose the cache via some static accessor methods? DI would be more elegant.

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •