KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > remoting > jaxrpc > LocalJaxRpcServiceFactoryBean


1 /*
2  * Copyright 2002-2005 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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 JavaDoc;
20 import javax.xml.rpc.ServiceException JavaDoc;
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 LocalJaxRpcServiceFactory
39         implements FactoryBean, InitializingBean {
40
41     private Service JavaDoc service;
42
43     public void afterPropertiesSet() throws ServiceException JavaDoc {
44         this.service = createJaxRpcService();
45     }
46
47     public Object JavaDoc getObject() throws Exception JavaDoc {
48         return this.service;
49     }
50
51     public Class JavaDoc getObjectType() {
52         return (this.service != null ? this.service.getClass() : Service JavaDoc.class);
53     }
54
55     public boolean isSingleton() {
56         return true;
57     }
58
59 }
60
Popular Tags