01: /*
02: * Copyright 2002-2005 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.jaxrpc;
18:
19: import javax.xml.rpc.Service;
20: import javax.xml.rpc.ServiceException;
21:
22: import org.springframework.beans.factory.FactoryBean;
23: import org.springframework.beans.factory.InitializingBean;
24:
25: /**
26: * FactoryBean for locally defined JAX-RPC Service references.
27: * Uses LocalJaxRpcServiceFactory's facilities underneath.
28: *
29: * <p>Alternatively, JAX-RPC Service references can be looked up
30: * in the JNDI environment of the J2EE container.
31: *
32: * @author Juergen Hoeller
33: * @since 15.12.2003
34: * @see javax.xml.rpc.Service
35: * @see org.springframework.jndi.JndiObjectFactoryBean
36: * @see JaxRpcPortProxyFactoryBean
37: */
38: public class LocalJaxRpcServiceFactoryBean extends
39: LocalJaxRpcServiceFactory implements FactoryBean,
40: InitializingBean {
41:
42: private Service service;
43:
44: public void afterPropertiesSet() throws ServiceException {
45: this .service = createJaxRpcService();
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: }
|