KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > service > Autowiring


1 // Copyright 2007 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.hivemind.service;
16
17 /**
18  * Service that wires properties of object with services defined in the registry.
19  * Different strategies are available. The standard strategies are defined
20  * in {@link AutowiringStrategy}.
21  *
22  * @author Achim Huegen
23  */

24 public interface Autowiring
25 {
26     /**
27      * Autowires the properties of <code>target</code> defined in <code>propertyNames</code>.
28      * All available strategies are tried until one strategy succeeds.
29      * @param target the target object whose properties should be wired
30      * @param propertyNames the properties to wire
31      * @return the wired target object
32      */

33     public Object JavaDoc autowireProperties(Object JavaDoc target, String JavaDoc[] propertyNames);
34     
35     /**
36      * Autowires all writable properties of <code>target</code>.
37      * All available strategies are tried until one strategy succeeds.
38      * @param target the target object whose properties should be wired
39      * @return the wired target object
40      */

41     public Object JavaDoc autowireProperties(Object JavaDoc target);
42     
43     /**
44      * Autowires the properties of <code>target</code> defined in <code>propertyNames</code>
45      * using a certain strategy.
46      * @param strategy name of the strategy to be used. Standard strategies are defined
47      * in {@link AutowiringStrategy}
48      * @param target the target object whose properties should be wired
49      * @param propertyNames the properties to wire
50      * @return the wired target object
51      */

52     public Object JavaDoc autowireProperties(String JavaDoc strategy, Object JavaDoc target, String JavaDoc[] propertyNames);
53     
54     /**
55      * Autowires all writable properties of <code>target</code> using a certain strategy.
56      * @param strategy name of the strategy to be used. Standard strategies are defined
57      * in {@link AutowiringStrategy}
58      * @param target the target object whose properties should be wired
59      * @return the wired target object
60      */

61     public Object JavaDoc autowireProperties(String JavaDoc strategy, Object JavaDoc target);
62
63 }
64
Popular Tags