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 javax.xml.ws.Service;
20:
21: import org.springframework.beans.factory.FactoryBean;
22: import org.springframework.beans.factory.InitializingBean;
23:
24: /**
25: * {@link org.springframework.beans.factory.FactoryBean} for locally
26: * defined JAX-WS Service references.
27: * Uses {@link LocalJaxWsServiceFactory}'s facilities underneath.
28: *
29: * <p>Alternatively, JAX-WS Service references can be looked up
30: * in the JNDI environment of the J2EE container.
31: *
32: * @author Juergen Hoeller
33: * @since 2.5
34: * @see javax.xml.ws.Service
35: * @see org.springframework.jndi.JndiObjectFactoryBean
36: * @see JaxWsPortProxyFactoryBean
37: */
38: public class LocalJaxWsServiceFactoryBean extends
39: LocalJaxWsServiceFactory implements FactoryBean,
40: InitializingBean {
41:
42: private Service service;
43:
44: public void afterPropertiesSet() {
45: this .service = createJaxWsService();
46: }
47:
48: public Object getObject() throws Exception {
49: return this .service;
50: }
51:
52: public Class getObjectType() {
53: return (this .service != null ? this .service.getClass()
54: : Service.class);
55: }
56:
57: public boolean isSingleton() {
58: return true;
59: }
60:
61: }
|