Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.omg.CORBA.ORB
org.omg.CORBA_2_3.ORB
gnu.CORBA.OrbRestricted
gnu.CORBA.OrbFunctional
public class OrbFunctional
extends OrbRestricted
ORB_1_4
.
Nested Class Summary | |
protected class |
|
protected class |
|
Field Summary | |
static String |
|
static int |
|
static String |
|
String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static int |
|
static int |
|
static int |
|
static String |
|
static String |
|
static String |
|
static String |
|
static int |
|
int |
|
int |
|
int |
|
int |
|
static String |
|
protected Asynchron |
|
protected Connected_objects |
|
protected LinkedList<T> |
|
protected Hashtable<K,V> |
|
protected Map<K,V> |
|
protected Version |
|
String |
|
protected ArrayList<E> |
|
protected boolean |
|
static String |
|
SocketFactory |
|
Fields inherited from class gnu.CORBA.OrbRestricted | |
Singleton , factories , iClient , iIor , iServer , icSlotSize , policyFactories |
Constructor Summary | |
|
Method Summary | |
void | |
void | |
void |
|
int |
|
protected IOR |
|
void |
|
void |
|
void |
|
protected void |
|
protected Object |
|
Object |
|
protected Object |
|
int |
|
IOR |
|
Version |
|
Request |
|
void |
|
Object |
|
String[] |
|
String |
|
boolean |
|
protected void |
|
Object |
|
void |
|
void |
|
void |
|
void |
|
static void |
|
protected void |
|
protected void |
|
void |
|
void |
|
Object |
|
protected void |
|
Methods inherited from class org.omg.CORBA_2_3.ORB | |
get_value_def , lookup_value_factory , register_value_factory , set_delegate , unregister_value_factory |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public static String AFTER_RECEIVING
If the message body is received, the time out changes to the specifice value. This must be longer, as includes time, required to process the received task. We make it 40 minutes.
public static int DEFAULT_INITIAL_PORT
The default value where the first instance of this ORB will start looking for a free port.
public static final String LISTEN_ON
The property of port, on that this ORB is listening for requests from clients. This class supports one port per ORB only.
- Field Value:
- "gnu.classpath.CORBA.ListenOn"
public static final String NAME_SERVICE
The string, defining the naming service initial reference.
- Field Value:
- "NameService"
public static final String NS_HOST
The property, defining the host on that the default name service is running.
- Field Value:
- "org.omg.CORBA.ORBInitialHost"
public static final String NS_PORT
The property, defining the port on that the default name service is running.
- Field Value:
- "org.omg.CORBA.ORBInitialPort"
public static final String ORB_ID
Defines the ORB ID that is accessible by IOR interceptors.
- Field Value:
- "org.omg.CORBA.ORBid"
public static int RANDOM_PORT_ATTEMPTS
The number of attempts to try when opening random port.
public static int RANDOM_PORT_FROM
When trying to open the socket on a random port, start of the interval to try.
public static int RANDOM_PORT_TO
When trying to open the socket on a random port, end of the interval to try.
public static final String REFERENCE
The property, defining the IOR of the intial reference to resolve.
- Field Value:
- "org.omg.CORBA.ORBInitRef"
public static String SERVER_ERROR_PAUSE
The server waits for this duration after the potentially transient error during its servicing cycle.
public static final String SERVER_ID
Defines the SERVER ID that is accessible by IOR interceptors.
- Field Value:
- "org.omg.CORBA.ServerId"
public static String START_READING_MESSAGE
The if the client has once opened a socket, it should start sending the message header in a given time. Otherwise the server will close the socket. This prevents server hang when the client opens the socket, but does not send any message, usually due crash on the client side.
public static int TANDEM_REQUESTS
Some clients tend to submit multiple requests over the same socket. The server waits for the next request on the same socket for the duration, specified below. In additions, the request of this implementation also waits for the same duration before closing the socket. The default time is seven seconds.
public int TOUT_AFTER_RECEIVING
If the message body is received, the time out changes to the specifice value. This must be longer, as includes time, required to process the received task. We make it 40 minutes.
public int TOUT_START_READING_MESSAGE
The if the client has once opened a socket, it should start sending the message header in a given time. Otherwise the server will close the socket. This prevents server hang when the client opens the socket, but does not send any message, usually due crash on the client side.
public int TOUT_WHILE_READING
If the client has started to send the request message, the socket time out changes to the specified value.
public int TWAIT_SERVER_ERROR_PAUSE
The server waits for this duration after the potentially transient error during its servicing cycle.
public static String WHILE_READING
If the client has started to send the request message, the socket time out changes to the specified value.
protected Asynchron asynchron
The instance, stored in this field, handles the asynchronous dynamic invocations.
protected final Connected_objects connected_objects
The map of the already conncted objects.
protected LinkedList<T> freed_ports
The list of the freed ports. The ORB reuses ports, when possible.
protected Hashtable<K,V> identities
Maps a single-threaded POAs to they sharedPortServants.
protected Version max_version
The maximal CORBA version, supported by this ORB. The default value 0 means that the ORB will not check the request version while trying to respond.
protected boolean running
Setting this value to false causes the ORB to shutdown after the latest serving operation is complete.
public static String server_id
The Id of this Server. This field is defined static to ensure it has the same value over all ORB's in this machine.
public SocketFactory socketFactory
The producer of the client and server sockets for this ORB.
public void connect(Object object)
Connect the given CORBA object to this ORB. After the object is connected, it starts receiving remote invocations via this ORB. The ORB tries to connect the object to the port, that has been previously set bysetPort(int)
. On failure, it tries 20 subsequent larger values and then calls the parameterless server socked constructor to get any free local port. If this fails, theNO_RESOURCES
is thrown.
- Parameters:
object
- the object, must implement theInvokeHandler
) interface.
- Throws:
BAD_PARAM
- if the object does not implement theInvokeHandler
).
public void connect(Object object, byte[] key)
Connect the given CORBA object to this ORB, explicitly specifying the object key. The ORB tries to connect the object to the port, that has been previously set bysetPort(int)
. On failure, it tries 20 subsequent larger values and then calls the parameterless server socked constructor to get any free local port. If this fails, theNO_RESOURCES
is thrown.
- Parameters:
object
- the object, must implement theInvokeHandler
) interface.key
- the object key, usually used to identify the object from remote side.
- Throws:
BAD_PARAM
- if the object does not implement theInvokeHandler
).
public void connect_1_thread(Object object, byte[] key, Object identity)
Connect the given CORBA object to this ORB, explicitly specifying the object key and the identity of the thread (and port), where the object must be served. The identity is normally the POA. The new port server will be started only if there is no one already running for the same identity. Otherwise, the task of the existing port server will be widened, including duty to serve the given object. All objects, connected to a single identity by this method, will process they requests subsequently in the same thread. The method is used when the expected number of the objects is too large to have a single port and thread per object. This method is used by POAs, having a single thread policy.
- Parameters:
object
- the object, must implement theInvokeHandler
) interface.key
- the object key, usually used to identify the object from remote side.
- Throws:
BAD_PARAM
- if the object does not implement theInvokeHandler
).
public int countConnectedObjects()
Get the number of objects that are connected to this ORB.
- Returns:
- the number of objects, connected to this ORB.
protected IOR createIOR(Connected_objects.cObject ref) throws BAD_OPERATION
Create IOR for the given object references.
public void destroy()
Destroy this server, releasing the occupied resources.
- Overrides:
- destroy in interface OrbRestricted
public void disconnect(Object object)
Disconnect the given CORBA object from this ORB. The object will be no longer receiving the remote invocations. In response to the remote invocation on this object, the ORB will send the exceptionOBJECT_NOT_EXIST
. The object, however, is not destroyed and can receive the local invocations.
- Overrides:
- disconnect in interface ORB
- Parameters:
object
- the object to disconnect.
public void ensureRunning()
Start the server in a new thread, if not already running. This method is used to ensure that the objects being transfered will be served from the remote side, if required. If the ORB is started using this method, it starts as a daemon thread.
protected void finalize() throws Throwable
Set the flag, forcing all server threads to terminate.
protected Object find_connected_object(byte[] key, int port)
Find and return the object, that must be previously connected to this ORB. Return null if no such object is available.
- Parameters:
key
- the object key.port
- the port where the object is connected.
- Returns:
- the connected object, null if none.
public Object find_local_object(IOR ior)
Find the local object, connected to this ORB.
- Parameters:
ior
- the ior of the potentially local object.
- Returns:
- the local object, represented by the given IOR, or null if this is not a local connected object.
protected Object getDefaultNameService()
Get the default naming service for the case when there no NameService entries.
public int getFreePort() throws BAD_OPERATION
Get the currently free port, starting from the initially set port and going up max 20 steps, then trying to bind into any free address.
- Returns:
- the currently available free port.
- Throws:
NO_RESOURCES
- if the server socked cannot be opened on the local host.
public IOR getLocalIor(Object forObject)
Get the local IOR for the given object, null if the object is not local.
public Version getMaxVersion()
Get the maximal supported GIOP version or null if the version is not checked.
public Request get_next_response() throws WrongTransaction
Get the next instance with a response being received. If all currently sent responses not yet processed, this method pauses till at least one of them is complete. If there are no requests currently sent, the method pauses till some request is submitted and the response is received. This strategy is identical to the one accepted by Suns 1.4 ORB implementation. The returned response is removed from the list of the currently submitted responses and is never returned again.
- Overrides:
- get_next_response in interface OrbRestricted
- Returns:
- the previously sent request that now contains the received response.
- Throws:
WrongTransaction
- If the method was called from the transaction scope different than the one, used to send the request. The exception can be raised only if the request is implicitly associated with some particular transaction.
public void identityDestroyed(Object identity)
Notifies ORB that the shared service indentity (usually POA) is destroyed. The matching shared port server is terminated and the identity table entry is deleted. If this identity is not known for this ORB, the method returns without action.
- Parameters:
identity
- the identity that has been destroyed.
public String[] list_initial_services()
List the initially available CORBA objects (services).
- Overrides:
- list_initial_services in interface OrbRestricted
- Returns:
- a list of services.
- See Also:
resolve_initial_references(String)
public String object_to_string(Object forObject)
Get the IOR reference string for the given object. The string embeds information about the object repository Id, its access key and the server internet address and port. With this information, the object can be found by another ORB, possibly located on remote computer.
- Overrides:
- object_to_string in interface OrbRestricted
- Parameters:
forObject
- CORBA object
- Returns:
- the object IOR representation.
- Throws:
BAD_PARAM
- if the object has not been previously connected to this ORB.BAD_OPERATION
- in the unlikely case if the local host address cannot be resolved.
- See Also:
string_to_object(String)
public boolean poll_next_response()
Find if any of the requests that have been previously sent withsend_multiple_requests_deferred(Request[])
, have a response yet.
- Overrides:
- poll_next_response in interface OrbRestricted
- Returns:
- true if there is at least one response to the previously sent request, false otherwise.
protected void prepareObject(Object object, IOR ior) throws BAD_PARAM
Prepare object for connecting it to this ORB.
- Parameters:
object
- the object being connected.
- Throws:
BAD_PARAM
- if the object does not implement theInvokeHandler
).
public Object resolve_initial_references(String name) throws InvalidName
Find and return the easily accessible CORBA object, addressed by name.
- Overrides:
- resolve_initial_references in interface OrbRestricted
- Parameters:
name
- the object name.
- Returns:
- the object
- Throws:
InvalidName
- if the given name is not associated with the known object.
public void run()
Start the ORBs main working cycle (receive invocation - invoke on the local object - send response - wait for another invocation). The method only returns after callingshutdown(boolean)
.
- Overrides:
- run in interface OrbRestricted
public void send_multiple_requests_deferred(Request[] requests)
Send multiple prepared requests expecting to get a reply. All requests are send in parallel, each in its own separate thread. When the reply arrives, it is stored in the agreed fields of the corresponing request data structure. If this method is called repeatedly, the new requests are added to the set of the currently sent requests, but the old set is not discarded.
- Overrides:
- send_multiple_requests_deferred in interface OrbRestricted
- Parameters:
requests
- the prepared array of requests.
public void send_multiple_requests_oneway(Request[] requests)
Send multiple prepared requests one way, do not caring about the answer. The messages, containing requests, will be marked, indicating that the sender is not expecting to get a reply.
- Overrides:
- send_multiple_requests_oneway in interface OrbRestricted
- Parameters:
requests
- the prepared array of requests.
- See Also:
Request.send_oneway()
public void setMaxVersion(Version max_supported)
If the max version is assigned, the orb replies with the error message if the request version is above the supported 1.2 version. This behavior is recommended by OMG, but not all implementations respond that error message by re-sending the request, encoded in the older version.
public static void setPort(int a_Port)
Set the port, on that the server is listening for the client requests. If only one object is connected to the orb, the server will be try listening on this port first. It the port is busy, or if more objects are connected, the subsequent object will receive a larger port values, skipping unavailable ports, if required. The change applies globally.
- Parameters:
a_Port
- a port, on that the server is listening for requests.
protected void set_parameters(Applet app, Properties props)
Set the ORB parameters. This method is normally called frominit(Applet,Properties)
.
- Overrides:
- set_parameters in interface OrbRestricted
- Parameters:
app
- the current applet.props
- application specific properties, passed as the second parameter ininit(Applet,Properties)
. Can benull
.
protected void set_parameters(String[] para, Properties props)
Set the ORB parameters. This method is normally called frominit(String[],Properties)
.
- Overrides:
- set_parameters in interface OrbRestricted
- Parameters:
para
- the parameters, that were passed as the parameters to themain(String[] args)
method of the current standalone application.props
- application specific properties that were passed as a second parameter ininit(String[], Properties)
). Can benull
.
public void shutdown(boolean wait_for_completion)
Shutdown the ORB server.
- Overrides:
- shutdown in interface OrbRestricted
- Parameters:
wait_for_completion
- if true, the current thread is suspended until the shutdown process is complete.
public void startService(IOR ior)
Start the service on the given port of this IOR.
- Parameters:
ior
- the ior (only Internet.port is used).
public Object string_to_object(String an_ior)
Find and return the CORBA object, addressed by the given IOR string representation. The object can (an usually is) located on a remote computer, possibly running a different (not necessary java) CORBA implementation.
- Overrides:
- string_to_object in interface OrbRestricted
- Parameters:
an_ior
- the object IOR representation string.
- Returns:
- the found CORBA object.
- See Also:
object_to_string(org.omg.CORBA.Object)
protected void useProperties(Properties props)
Set the ORB parameters from the properties that were accumulated from several locations.