Re: servlet filter and the Configuration

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat May 01 2010 - 23:42:25 EDT

  • Next message: Victor Leung: "Re: Large number of EventManager threads causing OutOfMemoryException"

    On May 1, 2010, at 12:07 AM, MGargan..scholar.com wrote:

    > Okay,
    >
    > So I think I've made some progress since my question
    > yesterday. I
    > have a bean in Spring that is a ConfigurationFactory. It returns a
    > singleton and the dataSource can be obtained from that. Now I just
    > need
    > to get that configuration loaded on web startup. I guess I need to
    > write
    > a filter because all the filters (the one in cayenne and the click
    > project) create a new shared configuration on init with
    > ServletUtil. I
    > guess I want to override those init()'s and get a reference to my
    > bean and
    > call initialize() on it directly. Is that correct?

    Sounds about right.

    > When I do this will that Configuration become the shared
    > configuration? If not how do I make
    > it the shared configuration?

    It does as long as either of the following is called either in your
    Filter or your Spring factory for Configuration:

    Configuration.initializeSharedConfiguration(conf);

    or

    ServletUtil.initializeSharedConfiguration(context);

    Andrus



    This archive was generated by hypermail 2.0.0 : Sat May 01 2010 - 23:43:15 EDT