File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\util\spring\BeanConfiguration.java.html

1 /*
2 * Copyright 2004-2005 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 hudson.util.spring;
17
18 import org.springframework.beans.factory.support.AbstractBeanDefinition;
19
20 /**
21 * An interface that represent a runtime bean configuration
22 *
23 * Credit must go to Solomon Duskis and the
24 * article: http://jroller.com/page/Solomon?entry=programmatic_configuration_in_spring
25 *
26 * @author Graeme
27 * @since 0.3
28 *
29 */
30
31 public interface BeanConfiguration {
32 String AUTOWIRE_BY_TYPE = "byType";
33 String AUTOWIRE_BY_NAME = "byName";
34
35 /**
36 *
37 * @return The name of the bean
38 */
39 String getName();
40
41 /**
42 *
43 * @return True if the bean is singleton
44 */
45 boolean isSingleton();
46
47 /**
48 *
49 * @return The Spring bean definition instance
50 */
51 AbstractBeanDefinition getBeanDefinition();
52
53 /**
54 * Adds a property value to this bean
55 * @param propertyName The name of the property
56 * @param propertyValue The value of the property
57 *
58 * @return Returns this bean configuration
59 */
60 BeanConfiguration addProperty(String propertyName, Object propertyValue);
61
62 /**
63 * Sets the name of the method to call when destroying the bean
64 *
65 * @param methodName The method name
66 * @return This bean configuration
67 */
68 BeanConfiguration setDestroyMethod(String methodName);
69
70 /**
71 * Sets the names of the beans this bean configuration depends on
72 *
73 * @param dependsOn Bean names it depends on
74 * @return This bean configuration
75 */
76 BeanConfiguration setDependsOn(String[] dependsOn);
77
78 /**
79 *
80 * @param beanName
81 * @return This BeanConfiguration
82 */
83 BeanConfiguration setFactoryBean(String beanName);
84
85 /**
86 *
87 * @param methodName
88 * @return This BeanConfiguration
89 */
90 BeanConfiguration setFactoryMethod(String methodName);
91
92 /**
93 * Sets the autowire type, either "byType" or "byName"
94 *
95 * @param type The type
96 * @return This BeanConfiguration
97 */
98 BeanConfiguration setAutowire(String type);
99
100
101 /**
102 * Sets the name of the bean in the app ctx
103 * @param beanName The bean name
104 */
105 void setName(String beanName);
106
107 /**
108 * Returns true if the bean config has the name property set
109 * @param name The name of the property
110 * @return True if it does have a property with the given name
111 */
112 boolean hasProperty(String name);
113
114 /**
115 * Returns the value of the given property or throws a MissingPropertyException
116 *
117 * @param name The name of the property
118 * @return The value of the property
119 */
120 Object getPropertyValue(String name);
121
122 /**
123 * Sets a property value on the bean configuration
124 *
125 * @param property The name of the property
126 * @param newValue The value
127 */
128 void setPropertyValue(String property, Object newValue);
129
130 /**
131 * Sets the BeanConfiguration as an Abstract bean definition
132 * @param isAbstract Whether its abstract or not
133 * @return This BeanConfiguration object
134 */
135 BeanConfiguration setAbstract(boolean isAbstract);
136
137 /**
138 * Sets the name of the parent bean
139 *
140 * @param name Either a string which is the name of the bean, a RuntimeBeanReference or a BeanConfiguration
141 */
142 void setParent(Object name);
143
144 }
145