103 |
* may listen on multiple ports and process the requests in separate threads. |
* may listen on multiple ports and process the requests in separate threads. |
104 |
* Normally the server takes one port per object being served. |
* Normally the server takes one port per object being served. |
105 |
*/ |
*/ |
106 |
class portServer extends Thread |
protected class portServer |
107 |
|
extends Thread |
108 |
{ |
{ |
109 |
/** |
/** |
110 |
* The number of the currently running parallel threads. |
* The number of the currently running parallel threads. |
111 |
*/ |
*/ |
112 |
int running_threads; |
int running_threads; |
113 |
|
|
114 |
/** |
/** |
115 |
* The port on that this portServer is listening for requests. |
* The port on that this portServer is listening for requests. |
133 |
{ |
{ |
134 |
s_port = _port; |
s_port = _port; |
135 |
setDaemon(true); |
setDaemon(true); |
|
} |
|
|
|
|
|
/** |
|
|
* Enter the serving loop (get request/process it). All portServer normally |
|
|
* terminate thy threads when the Functional_ORB.running is set to false. |
|
|
*/ |
|
|
public void run() |
|
|
{ |
|
136 |
try |
try |
137 |
{ |
{ |
138 |
service = new ServerSocket(s_port); |
service = new ServerSocket(s_port); |
139 |
} |
} |
140 |
catch (IOException ex) |
catch (IOException ex) |
141 |
{ |
{ |
142 |
BAD_OPERATION bad = |
BAD_OPERATION bad = new BAD_OPERATION( |
143 |
new BAD_OPERATION("Unable to open the server socket at "+s_port); |
"Unable to open the server socket at " + s_port); |
144 |
bad.minor = Minor.Socket; |
bad.minor = Minor.Socket; |
145 |
bad.initCause(ex); |
bad.initCause(ex); |
146 |
throw bad; |
throw bad; |
147 |
} |
} |
148 |
|
} |
149 |
|
|
150 |
|
/** |
151 |
|
* Enter the serving loop (get request/process it). All portServer normally |
152 |
|
* terminate thy threads when the Functional_ORB.running is set to false. |
153 |
|
*/ |
154 |
|
public void run() |
155 |
|
{ |
156 |
while (running) |
while (running) |
157 |
{ |
{ |
158 |
try |
try |
183 |
|
|
184 |
/** |
/** |
185 |
* Perform a single serving step. |
* Perform a single serving step. |
186 |
* |
* |
187 |
* @throws java.lang.Exception |
* @throws java.lang.Exception |
188 |
*/ |
*/ |
189 |
void tick() throws Exception |
void tick() |
190 |
|
throws Exception |
191 |
{ |
{ |
192 |
serve(this, service); |
serve(this, service); |
193 |
} |
} |
223 |
* serving multiple requests (probably to the different objects) on the same |
* serving multiple requests (probably to the different objects) on the same |
224 |
* thread. |
* thread. |
225 |
*/ |
*/ |
226 |
class sharedPortServer extends portServer |
protected class sharedPortServer extends portServer |
227 |
{ |
{ |
228 |
/** |
/** |
229 |
* Create a new portServer, serving on specific port. |
* Create a new portServer, serving on specific port. |
396 |
/** |
/** |
397 |
* The currently active portServers. |
* The currently active portServers. |
398 |
*/ |
*/ |
399 |
private ArrayList portServers = new ArrayList(); |
protected ArrayList portServers = new ArrayList(); |
400 |
|
|
401 |
/** |
/** |
402 |
* The host, on that the name service is expected to be running. |
* The host, on that the name service is expected to be running. |
965 |
|
|
966 |
/** |
/** |
967 |
* Start the server in a new thread, if not already running. This method is |
* Start the server in a new thread, if not already running. This method is |
968 |
* used to ensure that the objects being transfered will be served fro the |
* used to ensure that the objects being transfered will be served from the |
969 |
* remote side, if required. If the ORB is started using this method, it |
* remote side, if required. If the ORB is started using this method, it |
970 |
* starts as a daemon thread. |
* starts as a daemon thread. |
971 |
*/ |
*/ |
1234 |
* @throws BAD_PARAM if the object does not implement the |
* @throws BAD_PARAM if the object does not implement the |
1235 |
* {@link InvokeHandler}). |
* {@link InvokeHandler}). |
1236 |
*/ |
*/ |
1237 |
private void prepareObject(org.omg.CORBA.Object object, IOR ior) |
protected void prepareObject(org.omg.CORBA.Object object, IOR ior) |
1238 |
throws BAD_PARAM |
throws BAD_PARAM |
1239 |
{ |
{ |
1240 |
/* |
/* |
1588 |
return; |
return; |
1589 |
} |
} |
1590 |
} |
} |
1591 |
|
|
1592 |
private void useProperties(Properties props) |
/** |
1593 |
|
* Set the ORB parameters from the properties that were accumulated |
1594 |
|
* from several locations. |
1595 |
|
*/ |
1596 |
|
protected void useProperties(Properties props) |
1597 |
{ |
{ |
1598 |
if (props != null) |
if (props != null) |
1599 |
{ |
{ |