KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > geinuke > middle > MiddleFactory


1 /*
2 -- GeiNuke --
3 Copyright (c) 2005 by Roberto Sidoti [geinuke@users.sourceforge.net]
4 http://www.hostingjava.it/-geinuke/
5
6 This file is part of GeiNuke.
7
8    GeiNuke is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12
13    GeiNuke is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with GeiNuke; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */

22 package com.geinuke.middle;
23
24 import org.springframework.context.support.ClassPathXmlApplicationContext;
25
26
27
28 public class MiddleFactory {
29     
30     protected static ClassPathXmlApplicationContext context=null;
31     static{
32         context=new ClassPathXmlApplicationContext("BizLogic.xml");
33     }
34     
35     /*
36     public static Object getBLXX(String blName){
37         
38         if(blName.equals("IBlockBL")){
39             return BlockBL.singleton();
40         }else if(blName.equals("IBlogBL")){
41             return BlogBL.singleton();
42         }else if(blName.equals("ICategoryBL")){
43             return CategoryBL.singleton();
44         }else if(blName.equals("ICommentBL")){
45             return CommentBL.singleton();
46         }else if(blName.equals("IForumBL")){
47             return ForumBL.singleton();
48         }else if(blName.equals("IModuleBL")){
49             return ModuleBL.singleton();
50         }else if(blName.equals("INewsBL")){
51             return NewsBL.singleton();
52         }else if(blName.equals("IPortalCFGBL")){
53             return PortalCFGBL.singleton();
54         }else if(blName.equals("ISessionBL")){
55             return SessionBL.singleton();
56         }else if(blName.equals("ITopicBL")){
57             return TopicBL.singleton();
58         }else if(blName.equals("IUserBL")){
59             return UserBL.singleton();
60         }else if(blName.equals("IWikiBL")){
61             return WikiBL.singleton();
62         }else if(blName.equals("IUploadFileBL")){
63             return UploadFileBL.singleton();
64         }
65         
66         return null;
67     }
68     */

69     public static Object JavaDoc getBL(String JavaDoc blName){
70         
71         
72         /*
73         if(blName.equals("IBlockBL")){
74             return BlockBL.singleton();
75         }else if(blName.equals("IBlogBL")){
76             return BlogBL.singleton();
77         }else if(blName.equals("ICategoryBL")){
78             return CategoryBL.singleton();
79         }else if(blName.equals("ICommentBL")){
80             return CommentBL.singleton();
81         }else if(blName.equals("IForumBL")){
82             return ForumBL.singleton();
83         }else if(blName.equals("IModuleBL")){
84             return ModuleBL.singleton();
85         }else if(blName.equals("INewsBL")){
86             return NewsBL.singleton();
87         }else if(blName.equals("IPortalCFGBL")){
88             return PortalCFGBL.singleton();
89         }else if(blName.equals("ISessionBL")){
90             return SessionBL.singleton();
91         }else if(blName.equals("ITopicBL")){
92             return TopicBL.singleton();
93         }else if(blName.equals("IUserBL")){
94             return UserBL.singleton();
95         }else if(blName.equals("IWikiBL")){
96             return WikiBL.singleton();
97         }else if(blName.equals("IUploadFileBL")){
98             return UploadFileBL.singleton();
99         }
100         */

101         return context.getBean(blName);
102         //return null;
103
}
104 }
105
Popular Tags