gnu.CORBA

Class OrbFocused


public class OrbFocused
extends ORB_1_4

This class implements the ORB that uses a single port or the restricted port range for all its objects. It is required to for use together with various firewalls that does not allow opening multiple randomly selected ports, as the defauld CORBA implementation used to do. The firewal must be configured to allow CORBA to work on one fixed port or (for better performance) on a small fixed range of ports. This does not restrict the maximal number of the connected objects as the objects can share the same port. The used port or the used port range can be specified via property gnu.CORBA.ListenerPort. The value of this property is a single port or range of ports, boundary values (inclusive) being separeted by dash (for instance, "1245-1250"). It is possible to instantiate multiple instances of the focused ORBs and combine them with the ordinary ORBs. If you instantiate several instances of the focused ORBs on the same host, they used port sets should not overlap.

Nested Class Summary

Nested classes/interfaces inherited from class gnu.CORBA.OrbFunctional

OrbFunctional.portServer, OrbFunctional.sharedPortServer

Field Summary

static String
LISTENER_PORT
The name of the fixed port range property.

Fields inherited from class gnu.CORBA.Poa.ORB_1_4

currents, factory, ic_current, rootPOA

Fields inherited from class gnu.CORBA.OrbFunctional

AFTER_RECEIVING, DEFAULT_INITIAL_PORT, LISTEN_ON, LOCAL_HOST, NAME_SERVICE, NS_HOST, NS_PORT, ORB_ID, RANDOM_PORT_ATTEMPTS, RANDOM_PORT_FROM, RANDOM_PORT_TO, REFERENCE, SERVER_ERROR_PAUSE, SERVER_ID, START_READING_MESSAGE, TANDEM_REQUESTS, TOUT_AFTER_RECEIVING, TOUT_START_READING_MESSAGE, TOUT_WHILE_READING, TWAIT_SERVER_ERROR_PAUSE, WHILE_READING, asynchron, connected_objects, freed_ports, identities, initial_references, max_version, orb_id, portServers, running, server_id, socketFactory

Fields inherited from class gnu.CORBA.OrbRestricted

Singleton, factories, iClient, iIor, iServer, icSlotSize, policyFactories

Method Summary

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.
int
getFreePort()
Get free port from the allowed range.
protected OrbFunctional.portServer
getPortServer(int type)
Get the shared port server where the new object can be added.
void
run()
Start the ORBs main working cycle (receive invocation - invoke on the local object - send response - wait for another invocation).
void
setPortRange(int from, int to)
Set the port range.
void
setPortRange(String property)
Parse the "gnu.CORBA.ListenerPort" property and initialize the valid port set range.
protected void
set_parameters(Applet applet, Properties props)
Set parameters (additionally search for the port range property).
protected void
set_parameters(String[] args, Properties props)
Set parameters (additionally search for the port range property).
void
startService(IOR ior)
In this type of ORB, the service is started by getPortServer(int).
protected void
useProperties(Properties props)
Additionally set the port range property, when applicable.

Methods inherited from class gnu.CORBA.Poa.ORB_1_4

createIOR, create_policy, destroy, object_to_string, registerInterceptors, set_delegate, set_parameters, set_parameters

Methods inherited from class gnu.CORBA.OrbFunctional

connect, connect, connect_1_thread, countConnectedObjects, createIOR, destroy, disconnect, ensureRunning, finalize, find_connected_object, find_local_object, getDefaultNameService, getFreePort, getLocalIor, getMaxVersion, get_next_response, identityDestroyed, ior_to_object, list_initial_services, object_to_string, poll_next_response, prepareObject, resolve_initial_references, run, send_multiple_requests_deferred, send_multiple_requests_oneway, setMaxVersion, setPort, set_parameters, set_parameters, shutdown, startService, string_to_object, useProperties

Methods inherited from class gnu.CORBA.OrbRestricted

create_alias_tc, create_any, create_array_tc, create_context_list, create_enum_tc, create_environment, create_exception_list, create_exception_tc, create_interface_tc, create_list, create_named_value, create_output_stream, create_recursive_sequence_tc, create_sequence_tc, create_string_tc, create_struct_tc, create_union_tc, create_wstring_tc, destroy, get_default_context, get_next_response, get_primitive_tc, list_initial_services, lookup_value_factory, object_to_string, poll_next_response, register_value_factory, resolve_initial_references, run, send_multiple_requests_deferred, send_multiple_requests_oneway, set_parameters, set_parameters, shutdown, string_to_object, unregister_value_factory

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 org.omg.CORBA.ORB

connect, create_abstract_interface_tc, create_alias_tc, create_any, create_array_tc, create_basic_dyn_any, create_context_list, create_dyn_any, create_dyn_array, create_dyn_enum, create_dyn_sequence, create_dyn_struct, create_dyn_union, create_enum_tc, create_environment, create_exception_list, create_exception_tc, create_fixed_tc, create_interface_tc, create_list, create_named_value, create_native_tc, create_operation_list, create_output_stream, create_policy, create_recursive_sequence_tc, create_recursive_tc, create_sequence_tc, create_string_tc, create_struct_tc, create_union_tc, create_value_box_tc, create_value_tc, create_wstring_tc, destroy, disconnect, get_current, get_default_context, get_next_response, get_primitive_tc, get_service_information, init, init, init, list_initial_services, object_to_string, perform_work, poll_next_response, resolve_initial_references, run, send_multiple_requests_deferred, send_multiple_requests_oneway, set_parameters, set_parameters, shutdown, string_to_object, work_pending

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

LISTENER_PORT

public static final String LISTENER_PORT
The name of the fixed port range property. The presence of this property indicates that the default focused ORB must be used.
Field Value:
"gnu.CORBA.ListenerPort"

Method Details

connect_1_thread

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.
Overrides:
connect_1_thread in interface OrbFunctional
Parameters:
object - the object, must implement the InvokeHandler) interface.
key - the object key, usually used to identify the object from remote side.
Throws:
BAD_PARAM - if the object does not implement the InvokeHandler).

getFreePort

public int getFreePort()
            throws BAD_OPERATION
Get free port from the allowed range. This method instantiates the port server for the returned port.
Overrides:
getFreePort in interface OrbFunctional

getPortServer

protected OrbFunctional.portServer getPortServer(int type)
Get the shared port server where the new object can be added. This may result reusing the existing server or instantiating a new server. If the new server is instantiated and the ORB is already running, the server is started.

run

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 calling shutdown(boolean).
Overrides:
run in interface OrbFunctional

setPortRange

public void setPortRange(int from,
                         int to)
Set the port range.
Parameters:
from - - start of the port range, inclusive.
to - - end of the port range, inclusive.

setPortRange

public void setPortRange(String property)
Parse the "gnu.CORBA.ListenerPort" property and initialize the valid port set range.

set_parameters

protected void set_parameters(Applet applet,
                              Properties props)
Set parameters (additionally search for the port range property).
Overrides:
set_parameters in interface ORB_1_4

set_parameters

protected void set_parameters(String[] args,
                              Properties props)
Set parameters (additionally search for the port range property).
Overrides:
set_parameters in interface ORB_1_4

startService

public void startService(IOR ior)
In this type of ORB, the service is started by getPortServer(int). The method below is not in use and should return without action.
Overrides:
startService in interface OrbFunctional

useProperties

protected void useProperties(Properties props)
Additionally set the port range property, when applicable.
Overrides:
useProperties in interface OrbFunctional

OrbFocused.java -- Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.