[jboss-user] [JBoss Seam] - Re: ResourceBundle in Database

pbrewer_uk do-not-reply at jboss.com
Wed Feb 14 06:50:16 EST 2007


How would a subclass of org.jboss.seam.core.ResourceBundle be annotated in this case - are the annotations below correct?

Also, would some extra configuration in components.xml be required too?

ExtendedResourceBundle.java

  | ...
  | @Scope(ScopeType.SESSION)
  | @Intercept(NEVER)
  | @Name("org.jboss.seam.core.resourceBundle")
  | @Install(precedence=BUILT_IN)
  | public class ExtendedResourceBundle extends org.jboss.seam.core.ResourceBundle 
  | ...  
  |   @Override
  |   protected ResourceBundle loadBundle(String bundleName) {
  |     try {
  |       ResourceBundle bundle =
  |           ResourceBundle.getBundle(bundleName,
  |           Locale.instance(),
  |           Thread.currentThread().getContextClassLoader(),
  |           DBControl.INSTANCE);
  |       LOG.debug("loaded resource bundle: " + bundleName);
  |       return bundle;
  |     } catch (MissingResourceException mre) {
  |       LOG.debug("db resource bundle missing: " + bundleName);
  |       return super.loadBundle(bundleName);
  |     }
  |   }
  | ...  
  | }
  | 

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

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



More information about the jboss-user mailing list