View Javadoc

1   /**
2    * Copyright 2005-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kim.config;
17  
18  import org.kuali.rice.core.api.config.module.RunMode;
19  import org.kuali.rice.core.impl.config.module.ModuleConfigurer;
20  
21  import java.util.ArrayList;
22  import java.util.List;
23  
24  /**
25   * This class handles the Spring based KIM configuration that is part of the Rice Configurer that must 
26   * exist in all Rice based systems and clients. 
27   * 
28   * @author Kuali Rice Team (rice.collab@kuali.org)
29   */
30  public class KIMConfigurer extends ModuleConfigurer {
31  	private static final String KIM_INTERFACE_SPRING_BEANS_PATH = "classpath:org/kuali/rice/kim/impl/config/KIMInterfaceSpringBeans.xml";
32  	private static final String KIM_IMPL_SPRING_BEANS_PATH = "classpath:org/kuali/rice/kim/impl/config/KIMImplementationSpringBeans.xml";
33  	private static final String KIM_KSB_SPRING_BEANS_PATH = "classpath:org/kuali/rice/kim/impl/config/KIMServiceBusSpringBeans.xml";
34  	private static final String KIM_UI_SPRING_BEANS_PATH = "classpath:org/kuali/rice/kim/impl/config/KIMUserInterfaceSpringBeans.xml";
35  	
36  	@Override
37  	public List<String> getPrimarySpringFiles() {
38  		final List<String> springFileLocations = new ArrayList<String>();
39  		springFileLocations.add( KIM_INTERFACE_SPRING_BEANS_PATH );
40  		if ( getRunMode().equals( RunMode.LOCAL ) || getRunMode().equals( RunMode.EMBEDDED ) ) {
41  			springFileLocations.add(KIM_IMPL_SPRING_BEANS_PATH);
42  		}
43  		if ( isExposeServicesOnBus() ) {
44  		    springFileLocations.add(KIM_KSB_SPRING_BEANS_PATH);
45  		}
46  		if ( isIncludeUserInterfaceComponents() ) {
47  			springFileLocations.add(KIM_UI_SPRING_BEANS_PATH);
48  		}
49  		return springFileLocations;
50  	}
51  }