1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package com.mjh.switchrmi;
26
27 import com.mjh.util.UrlInfo;
28
29 import java.io.*;
30
31 import java.net.*;
32
33 import org.apache.log4j.Logger;
34
35
43 public abstract class RmiTransportBase
44 implements RmiTransport
45 {
46 private static final Logger log =
47 Logger.getLogger(RmiTransportBase.class.getName());
48 private String mimeType;
49 private String targetUrl;
50 private String transportType = RmiTransport.SYNCHRONOUS;
51 private String transportName = "unknown";
52 private Object sessionID;
53
54
57 public RmiTransportBase()
58 {
59 }
60
61 protected void setName(String name)
62 {
63 transportName = name;
64 }
65
66 public String getUrl()
67 {
68 return targetUrl;
69 }
70
71 public void setUrl(String url)
72 {
73 targetUrl = url;
74 }
75
76 public UrlInfo getUrlInfo(RmiContext context)
77 throws MalformedURLException
78 {
79 return new UrlInfo(context.getUrl());
80 }
81
82 public String getName()
83 {
84 return transportName;
85 }
86
87
90 public String getType()
91 {
92 return transportType;
93 }
94
95 public void setType(String type)
96 {
97 transportType = type;
98
99
100 }
101
102 public void setSessionIdentifier(Object identifier)
103 {
104 sessionID = identifier;
105 }
106
107 public Object getSessionIdentifier()
108 {
109 return sessionID;
110 }
111
112
115 public InputStream getInputStream(RmiContext context)
116 throws IOException
117 {
118 return null;
119 }
120
121
124 public OutputStream getOutputStream(RmiContext context)
125 throws IOException
126 {
127 return null;
128 }
129
130
133 public void send(RmiContext context)
134 throws Exception
135 {
136 }
137
138
141 public void recv(RmiContext context)
142 throws Exception
143 {
144 }
145
146 private void debug(String msg)
147 {
148 log.debug(msg);
149 }
150 }