source code formatting.
[utils] / system / spring / src / test / java / org / wamblee / system / spring / SubSpringComponent2.java
1 /*
2  * Copyright 2008 the original author or authors.
3  *
4  * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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.wamblee.system.spring;
17
18 import org.wamblee.system.core.DefaultRequiredInterface;
19 import org.wamblee.system.core.ProvidedInterface;
20 import org.wamblee.system.core.RequiredInterface;
21 import org.wamblee.system.core.Scope;
22
23 import java.util.Map;
24
25
26 /**
27  * DOCUMENT ME!
28  *
29  * @author $author$
30  * @version $Revision$
31  */
32 public class SubSpringComponent2 extends SpringComponent {
33     /**
34      * DOCUMENT ME!
35      */
36     private static RequiredInterface REQUIRED = new DefaultRequiredInterface("required",
37             Float.class);
38
39 /**
40      * Creates a new SubSpringComponent2 object.
41      *
42      * @param aName DOCUMENT ME!
43      * @param aConfigFiles DOCUMENT ME!
44      * @param aProvided DOCUMENT ME!
45      * @param aRequired DOCUMENT ME!
46      */
47     public SubSpringComponent2(String aName, String[] aConfigFiles,
48         Map<String, ProvidedInterface> aProvided,
49         Map<RequiredInterface, String> aRequired) {
50         super(aName, aConfigFiles, aProvided, aRequired);
51         addRequiredInterface(REQUIRED);
52     }
53
54     /**
55      * DOCUMENT ME!
56      *
57      * @param aExternalScope DOCUMENT ME!
58      *
59      * @return DOCUMENT ME!
60      */
61     @Override
62     protected Scope doStart(Scope aExternalScope) {
63         Scope scope = super.doStart(aExternalScope);
64
65         float value = aExternalScope.getInterfaceImplementation(REQUIRED
66                 .getProvider(), Float.class);
67         scope.put("floatValue", value);
68
69         return scope;
70     }
71 }