[jboss-user] [JBoss Seam] - @Startup depends

monkeyden do-not-reply at jboss.com
Mon Mar 19 15:06:08 EDT 2007


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);
  |     }
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029439#4029439

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029439



More information about the jboss-user mailing list