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