KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > transport > http > HttpTransportSupport


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.activemq.transport.http;
19
20 import org.apache.activemq.transport.TransportThreadSupport;
21 import org.apache.activemq.transport.util.TextWireFormat;
22
23 import java.net.URI JavaDoc;
24
25 /**
26  * A useful base class for HTTP Transport implementations.
27  *
28  * @version $Revision: 1.1 $
29  */

30 public abstract class HttpTransportSupport extends TransportThreadSupport {
31     private TextWireFormat textWireFormat;
32     private URI JavaDoc remoteUrl;
33     private String JavaDoc proxyHost;
34     private int proxyPort = 8080;
35
36     public HttpTransportSupport(TextWireFormat textWireFormat, URI JavaDoc remoteUrl) {
37         this.textWireFormat = textWireFormat;
38         this.remoteUrl = remoteUrl;
39     }
40
41     public String JavaDoc toString() {
42         return "HTTP Reader " + getRemoteUrl();
43     }
44
45     // Properties
46
// -------------------------------------------------------------------------
47
public String JavaDoc getRemoteAddress() {
48         return remoteUrl.toString();
49     }
50
51     public URI JavaDoc getRemoteUrl() {
52         return remoteUrl;
53     }
54
55     public TextWireFormat getTextWireFormat() {
56         return textWireFormat;
57     }
58
59     public void setTextWireFormat(TextWireFormat textWireFormat) {
60         this.textWireFormat = textWireFormat;
61     }
62
63     public String JavaDoc getProxyHost() {
64         return proxyHost;
65     }
66
67     public void setProxyHost(String JavaDoc proxyHost) {
68         this.proxyHost = proxyHost;
69     }
70
71     public int getProxyPort() {
72         return proxyPort;
73     }
74
75     public void setProxyPort(int proxyPort) {
76         this.proxyPort = proxyPort;
77     }
78 }
79
Popular Tags