01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package org.springframework.remoting.jaxws;
18:
19: import org.springframework.aop.framework.ProxyFactory;
20: import org.springframework.beans.factory.BeanClassLoaderAware;
21: import org.springframework.beans.factory.FactoryBean;
22: import org.springframework.util.ClassUtils;
23:
24: /**
25: * {@link org.springframework.beans.factory.FactoryBean} for a specific port of a
26: * JAX-WS service. Exposes a proxy for the port, to be used for bean references.
27: * Inherits configuration properties from {@link JaxWsPortClientInterceptor}.
28: *
29: * @author Juergen Hoeller
30: * @since 2.5
31: * @see #setServiceInterface
32: * @see LocalJaxWsServiceFactoryBean
33: */
34: public class JaxWsPortProxyFactoryBean extends
35: JaxWsPortClientInterceptor implements FactoryBean,
36: BeanClassLoaderAware {
37:
38: private ClassLoader beanClassLoader = ClassUtils
39: .getDefaultClassLoader();
40:
41: private Object serviceProxy;
42:
43: public void setBeanClassLoader(ClassLoader classLoader) {
44: this .beanClassLoader = classLoader;
45: }
46:
47: public void afterPropertiesSet() {
48: super .afterPropertiesSet();
49: this .serviceProxy = new ProxyFactory(getServiceInterface(),
50: this ).getProxy(this .beanClassLoader);
51: }
52:
53: public Object getObject() {
54: return this .serviceProxy;
55: }
56:
57: public Class getObjectType() {
58: return getServiceInterface();
59: }
60:
61: public boolean isSingleton() {
62: return true;
63: }
64:
65: }
|