44 |
import gnu.CORBA.GIOP.MessageHeader; |
import gnu.CORBA.GIOP.MessageHeader; |
45 |
import gnu.CORBA.GIOP.ReplyHeader; |
import gnu.CORBA.GIOP.ReplyHeader; |
46 |
import gnu.CORBA.GIOP.RequestHeader; |
import gnu.CORBA.GIOP.RequestHeader; |
47 |
|
import gnu.CORBA.GIOP.CloseMessage; |
48 |
import gnu.CORBA.NamingService.NamingServiceTransient; |
import gnu.CORBA.NamingService.NamingServiceTransient; |
49 |
|
|
50 |
import org.omg.CORBA.BAD_INV_ORDER; |
import org.omg.CORBA.BAD_INV_ORDER; |
84 |
import java.util.Properties; |
import java.util.Properties; |
85 |
import java.util.StringTokenizer; |
import java.util.StringTokenizer; |
86 |
import java.util.TreeMap; |
import java.util.TreeMap; |
|
import gnu.CORBA.GIOP.CloseMessage; |
|
87 |
|
|
88 |
/** |
/** |
89 |
* The ORB implementation, capable to handle remote invocations on the |
* The ORB implementation, capable to handle remote invocations on the |
206 |
} |
} |
207 |
|
|
208 |
/** |
/** |
209 |
|
* The default value where the first instance of this ORB will start |
210 |
|
* looking for a free port. |
211 |
|
*/ |
212 |
|
public static int DEFAULT_INITIAL_PORT = 1126; |
213 |
|
|
214 |
|
/** |
215 |
* The property of port, on that this ORB is listening for requests from clients. |
* The property of port, on that this ORB is listening for requests from clients. |
216 |
* This class supports one port per ORB only. |
* This class supports one port per ORB only. |
217 |
*/ |
*/ |
332 |
private String ns_host; |
private String ns_host; |
333 |
|
|
334 |
/** |
/** |
335 |
* The port, under that the ORB is listening for remote requests. |
* Probably free port, under that the ORB will try listening for |
336 |
* Then the new object is connected, this port is used first, then |
* remote requests first. When the new object is connected, this |
337 |
* it is incremented by 1, etc. If the given port is not available, |
* port is used first, then it is incremented by 1, etc. If the given |
338 |
* up to 20 subsequent values are tried and then the parameterless |
* port is not available, up to 20 subsequent values are tried and then |
339 |
* server socket contructor is called. |
* the parameterless server socket contructor is called. The constant is |
340 |
|
* shared between multiple instances of this ORB. |
341 |
*/ |
*/ |
342 |
private static int Port = 1126; |
private static int Port = DEFAULT_INITIAL_PORT; |
343 |
|
|
344 |
/** |
/** |
345 |
* The port, on that the name service is expected to be running. |
* The port, on that the name service is expected to be running. |
473 |
|
|
474 |
/** |
/** |
475 |
* Set the port, on that the server is listening for the client requests. |
* Set the port, on that the server is listening for the client requests. |
476 |
* In this implementation, the server is listening at only one port, |
* If only one object is connected to the orb, the server will be |
477 |
* the default value being 1126. |
* try listening on this port first. It the port is busy, or if more |
478 |
|
* objects are connected, the subsequent object will receive a larger |
479 |
|
* port values, skipping unavailable ports, if required. The change |
480 |
|
* applies globally. |
481 |
* |
* |
482 |
* @param a_Port a port, on that the server is listening for requests. |
* @param a_Port a port, on that the server is listening for requests. |
|
* |
|
|
* @throws BAD_INV_ORDER if the server has already been started. The port |
|
|
* can only be changed when the server is not yet started. |
|
|
*/ |
|
|
public void setPort(int a_Port) |
|
|
{ |
|
|
if (running) |
|
|
throw new BAD_INV_ORDER("The server is running"); |
|
|
this.Port = a_Port; |
|
|
} |
|
|
|
|
|
/** |
|
|
* Get the port, on that the server is listening for the client requests. |
|
|
* In this implementation, the server is listening at only one port, |
|
|
* the default value being 1126. |
|
|
* |
|
|
* @return the port. |
|
483 |
*/ |
*/ |
484 |
public int getPort() |
public static void setPort(int a_Port) |
485 |
{ |
{ |
486 |
return Port; |
Port = a_Port; |
487 |
} |
} |
488 |
|
|
489 |
/** |
/** |