KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > projectmanagement > spec > customer > CustomerManagerFactory


1 /*
2  * ProjectManagement
3  *
4  * Enhydra super-servlet specification object
5  *
6  */

7 package projectmanagement.spec.customer;
8
9 public class CustomerManagerFactory {
10 /**
11 * Constructor can't be used.
12 */

13  private CustomerManagerFactory() {
14     }
15     /**
16      * Create a CustomerManager as state object/value object/data transfer object
17      */

18     public static CustomerManager getCustomerManager(String JavaDoc fullClassName)
19     {
20         CustomerManager result=null;
21         Class JavaDoc objectClass = null;
22         
23         try{
24          // Create the value object
25
objectClass = Class.forName(fullClassName);
26                                    
27           result = (CustomerManager)objectClass.newInstance();
28         
29          } catch (Exception JavaDoc ex) {
30             System.out.println("Error on creating the object" + ex);
31          }
32
33         return result;
34     
35   }
36   
37    }
Popular Tags