01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.axis2.jaxws.runtime.description.injection.impl;
20:
21: import org.apache.axis2.jaxws.description.ServiceDescription;
22: import org.apache.axis2.jaxws.runtime.description.injection.ResourceInjectionServiceRuntimeDescription;
23:
24: import java.lang.reflect.Method;
25:
26: public class ResourceInjectionServiceRuntimeDescriptionImpl implements
27: ResourceInjectionServiceRuntimeDescription {
28:
29: private ServiceDescription serviceDesc;
30: private String key;
31: private boolean _hasResourceAnnotation;
32: private Method _postConstructMethod;
33: private Method _preDestroyMethod;
34:
35: protected ResourceInjectionServiceRuntimeDescriptionImpl(
36: String key, ServiceDescription serviceDesc) {
37: this .serviceDesc = serviceDesc;
38: this .key = key;
39: }
40:
41: public boolean hasResourceAnnotation() {
42: return _hasResourceAnnotation;
43: }
44:
45: public Method getPostConstructMethod() {
46: return _postConstructMethod;
47: }
48:
49: public Method getPreDestroyMethod() {
50: return _preDestroyMethod;
51: }
52:
53: public ServiceDescription getServiceDescription() {
54: return serviceDesc;
55: }
56:
57: public String getKey() {
58: return key;
59: }
60:
61: /**
62: * Called by Builder code
63: *
64: * @param value
65: */
66: void setResourceAnnotation(boolean value) {
67: _hasResourceAnnotation = value;
68: }
69:
70: void setPostConstructMethod(Method method) {
71: _postConstructMethod = method;
72: }
73:
74: void setPreDestroyMethod(Method method) {
75: _preDestroyMethod = method;
76: }
77:
78: public String toString() {
79: final String newline = "\n";
80: StringBuffer string = new StringBuffer();
81:
82: string.append(newline);
83: string.append(" ResourceInjectionServiceRuntime:" + getKey());
84: string.append(newline);
85: string.append(" @Resource Annotation = "
86: + hasResourceAnnotation());
87: string.append(newline);
88: string.append(" PostConstruct Method = "
89: + getPostConstructMethod());
90: string.append(newline);
91: string.append(" PreDestroy Method = "
92: + getPreDestroyMethod());
93:
94: return string.toString();
95: }
96:
97: }
|