3 Replies Latest reply on Mar 19, 2007 8:21 PM by gavin.king

    @Startup depends

    monkeyden

      I have the following APPLICATION scoped component which I want to startup when the app starts. As you can see, in the create method, I want to add the injected messages Map to permCache but despite the depends attribute, "messages" is not available. Is the value of depends a Seam component name? Do I need to use components.xml to do this? I'd like to see more documentation on components.xml. I feel like I could be doing much more with it.

      @Startup(depends={"org.jboss.seam.core.facesMessages"})
      @Name("appState")
      @Scope(APPLICATION)
      public class NEMApplicationState {
      
       @In
       private Map<String, String> messages;
      
       private static WeakHashMap tempCache;
      
       private static HashMap permCache;
      
       @Create
       public void create(){
       NEMApplicationState.tempCache = new WeakHashMap<Object, Object>();
      
       NEMApplicationState.permCache = new HashMap<Object, Object>();
      
       permCache.put(NEMApplicationState.START_TIME_CTX_NAME, new Date());
      
       permCache.put(NEMApplicationState.MESSAGES_CTX_NAME, messages);
       }
      }