Classes in this File | Line Coverage | Branch Coverage | Complexity | |||||||
XmlRpcClientConfigImpl |
|
| 1.5;1,5 |
1 | /* |
|
2 | * Copyright 1999,2005 The Apache Software Foundation. |
|
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 | package org.apache.xmlrpc.client; |
|
17 | ||
18 | import java.io.Serializable; |
|
19 | import java.net.URL; |
|
20 | ||
21 | import org.apache.xmlrpc.common.XmlRpcHttpRequestConfigImpl; |
|
22 | import org.apache.xmlrpc.server.XmlRpcServer; |
|
23 | ||
24 | ||
25 | /** Default implementation of a clients request configuration. |
|
26 | */ |
|
27 | public class XmlRpcClientConfigImpl extends XmlRpcHttpRequestConfigImpl |
|
28 | implements XmlRpcHttpClientConfig, XmlRpcLocalClientConfig, Cloneable, Serializable { |
|
29 | private static final long serialVersionUID = 4121131450507800889L; |
|
30 | private URL serverURL; |
|
31 | private XmlRpcServer xmlRpcServer; |
|
32 | ||
33 | /** Creates a new client configuration with default settings. |
|
34 | */ |
|
35 | 638 | public XmlRpcClientConfigImpl() { |
36 | 638 | } |
37 | ||
38 | /** Creates a clone of this client configuration. |
|
39 | * @return A clone of this configuration. |
|
40 | */ |
|
41 | public XmlRpcClientConfigImpl cloneMe() { |
|
42 | try { |
|
43 | 0 | return (XmlRpcClientConfigImpl) clone(); |
44 | 0 | } catch (CloneNotSupportedException e) { |
45 | 0 | throw new IllegalStateException("Unable to create my clone"); |
46 | } |
|
47 | } |
|
48 | ||
49 | /** Sets the servers URL. |
|
50 | * @param pURL Servers URL |
|
51 | */ |
|
52 | public void setServerURL(URL pURL) { |
|
53 | 336 | serverURL = pURL; |
54 | 336 | } |
55 | 371 | public URL getServerURL() { return serverURL; } |
56 | /** Returns the {@link org.apache.xmlrpc.server.XmlRpcServer} being invoked. |
|
57 | * @param pServer Server object being invoked. This will typically |
|
58 | * be a singleton instance, but could as well create a new |
|
59 | * instance with any call. |
|
60 | */ |
|
61 | public void setXmlRpcServer(XmlRpcServer pServer) { |
|
62 | 96 | xmlRpcServer = pServer; |
63 | 96 | } |
64 | 70 | public XmlRpcServer getXmlRpcServer() { return xmlRpcServer; } |
65 | } |