[weld-commits] Weld SVN: r6450 - examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Jun 16 14:03:01 EDT 2010


Author: pete.muir at jboss.org
Date: 2010-06-16 14:03:01 -0400 (Wed, 16 Jun 2010)
New Revision: 6450

Modified:
   examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/PopulateDatabaseBean.java
Log:
minor

Modified: examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/PopulateDatabaseBean.java
===================================================================
--- examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/PopulateDatabaseBean.java	2010-06-16 18:02:37 UTC (rev 6449)
+++ examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/PopulateDatabaseBean.java	2010-06-16 18:03:01 UTC (rev 6450)
@@ -46,20 +46,20 @@
 // TODO Make into an EJB Singleton which executes at startup
 @ApplicationScoped
 @Named("database")
+//TODO @Singleton @Startup
 public class PopulateDatabaseBean
 {
+   
+   private static final String DATA_FILE_NAME = "data.sql";
 
    @Inject
    private Instance<CodeFragmentManager> eaoIn;
    private CodeFragmentManager eao;
-   private boolean secured = false;
-   private static final String file = "data.sql";
-   private boolean populated = false;
+   private boolean secured;
+   
+   private boolean populated;
 
-   public PopulateDatabaseBean()
-   {
-   }
-
+   // TODO @PostConstruct
    public void populate()
    {
       if (populated)
@@ -71,7 +71,7 @@
 
       try
       {
-         String fileContent = readFileData(file);
+         String fileContent = readFileData(DATA_FILE_NAME);
          StringTokenizer st = new StringTokenizer(fileContent, "'");
          SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
@@ -95,7 +95,7 @@
       }
       catch (Exception e)
       {
-         System.err.println("Unable to read all records from " + file + " file");
+         System.err.println("Unable to read all records from " + DATA_FILE_NAME + " file");
       }
 
       populated = true;



More information about the weld-commits mailing list