View Javadoc
1   /**
2    * Copyright 2004-2014 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.common.aws.spring;
17  
18  import org.kuali.common.aws.ec2.api.EC2Service;
19  import org.kuali.common.aws.ec2.impl.DefaultEC2Service;
20  import org.kuali.common.aws.ec2.model.EC2ServiceContext;
21  import org.kuali.common.util.spring.env.EnvironmentService;
22  import org.kuali.common.util.spring.service.SpringServiceConfig;
23  import org.kuali.common.util.wait.WaitService;
24  import org.kuali.common.util.wait.spring.WaitServiceConfig;
25  import org.springframework.beans.factory.annotation.Autowired;
26  import org.springframework.context.annotation.Bean;
27  import org.springframework.context.annotation.Configuration;
28  import org.springframework.context.annotation.Import;
29  
30  import com.amazonaws.auth.AWSCredentials;
31  
32  @Configuration
33  @Import({ SpringServiceConfig.class, WaitServiceConfig.class })
34  public class AwsServiceConfig {
35  
36  	@Autowired
37  	EnvironmentService env;
38  
39  	@Autowired
40  	WaitService service;
41  
42  	@Autowired
43  	AWSCredentials credentials;
44  
45  	@Bean
46  	public EC2ServiceContext ec2ServiceContext() {
47  		return null; // LaunchUtils.getEC2ServiceContext(env, credentials);
48  	}
49  
50  	@Bean
51  	public EC2Service ec2Service() {
52  		EC2ServiceContext context = ec2ServiceContext();
53  		return new DefaultEC2Service(context, service);
54  	}
55  
56  }