orber(3)

MODULE
orber - The main module of the Orber application

DESCRIPTION

This module contains the functions for starting and stopping the application. It also has some utility functions to get some of the configuration information from running application.

EXPORTS

start() -> ok

    Starts the Orber application (it also starts mnesia if it is not running).

start_lightweight() -> ok

    Starts the Orber application as lightweight.

    Preconditions:

        *   Erlang started on the node using the option -orber lightweight, e.g., erl -orber lightweight Addresses.

        *   The Addresses must be a list of RemoteModifiers, equal to the orber:resolve_initial_references_remote/2 argument. The list must contain Orber nodes addresses, to which we have access and are not started as lightweight.

start_lightweight(Addresses) -> ok

    Types
        Addresses = [Address]
        Address =
        RetVal = ok | exit()

    Starts the Orber application as lightweight.

    Preconditions:

        *   If Erlang is started using the configuration parameter -orber lightweight, e.g., erl -orber lightweight Address, the argument supplied to this function will override the configuration parameter. Hence, this function must be used carefully.

        *   The Addresses must be a list of RemoteModifiers, equal to the orber:resolve_initial_references_remote/2 argument. The list must contain Orber nodes addresses, to which we have access and are not started as lightweight.

jump_start(Port) -> ok | {'EXIT', Reason}

    Types
        Port = integer()

    Installs and starts the Orber and the Mnesia applications with the configuration parameters domain and iiop_port set to "IP-number:Port" and the supplied Port respectively. Theses settings are in most cases sufficient to ensure that no clash with any other Orber instance occur. If this operation fails, check if the listen port (iiop_port) is already in use. This function MAY ONLY be used during development and tests; how Orber is configured when using this operation may change at any time without warning.

stop() -> ok

    Stops the Orber application.

info() -> ok

    Generates an Info Report, which contain Orber's configuration settings.

exception_info(Exception) -> {ok, string()} | {error, Reason}

    Returns a printable string, which describes the supplied exception in greater detail. Note, this function is mainly intended for system exceptions.

is_lightweight() -> boolean()

    This function returns the true if Orber is started as lightweight, false otherwise.

get_lightweight_nodes() -> RemoteModifierList | false

    This function returns false if Orber is not started as lightweight, otherwise a list of Remote Modifiers.

get_tables() -> [Tables]

    Returns a list of the Orber specific Mnesia tables. This list is required to restore Mnesia if it has been partitioned.

get_ORBInitRef() -> string() | undefined

    This function returns undefined if we will resolve references locally, otherwise a string describing which host we will contact if the Key given to corba:resolve_initial_references/1 matches the Key set in this configuration variable. For more information see the user's guide.

get_ORBDefaultInitRef() -> string() | undefined

    This function returns undefined if we will resolve references locally, otherwise a string describing which host, or hosts, from which we will try to resolve the Key given to corba:resolve_initial_references/1. For more information see the user's guide.

domain() -> string()

    This function returns the domain name of the current Orber domain as a string.

iiop_port() -> int()

    This function returns the port-number, which is used by the IIOP protocol. It can be configured by setting the application variable iiop_port, if it is not set it will have the default number 4001.

iiop_out_ports() -> 0 | {Min, Max}

    The return value of this operation is what the configuration parameter iiop_out_ports have been set to.

iiop_ssl_port() -> int()

    This function returns the port-number, which is used by the secure IIOP protocol. It can be configured by setting the application variable iiop_ssl_port, if it is not set it will have the default number 4002 if Orber is to configured to run in secure mode. Otherwise it returns -1.

iiop_timeout() -> int() (milliseconds)

    This function returns the timeout value after which outgoing IIOP requests terminate. It can be configured by setting the application variable iiop_timeout TimeVal (seconds), if it is not set it will have the default value infinity. If a request times out a system exception, e.g. TIMEOUT, is raised.

    Note: the iiop_timeout configuration parameter (TimeVal) may only range between 0 and 1000000 seconds. Otherwise, the default value is used.

    Note: IC supply the compile option ic:gen(IdlFile, [{timeout, "module::interface"}]), which allow the user to add an extra timeout parameter, e.g., module_interface(ObjRef, Timeout, ... Arguments ...), instead of module_interface(ObjRef, ... Arguments ...). If, a stub is compiled with the timeout option, the extra Timeout argument will override the configuration parameter iiop_timeout. It is, however, not possible to use infinity to override the Timeout parameter. The Timeout option is also valid for objects which resides within the same Orber domain.

iiop_connection_timeout() -> int() (milliseconds)

    This function returns the timeout value after which outgoing IIOP connections terminate. It can be configured by setting the application variable iiop_connection_timeout TimeVal (seconds), if it is not set it will have the default value infinity. The connection will not be terminated if there are pending requests.

    Note: the iiop_connection_timeout configuration parameter (TimeVal) may only range between 0 and 1000000 seconds. Otherwise, the default value is used.

iiop_connections() -> [{Host, Port}] | {'EXIT',Reason}

    The list returned by this operation contain tuples of remote hosts/ports Orber is currently connected to. If no such connections exists, the list will be empty.

iiop_connections_pending() -> [{Host, Port}] | {'EXIT',Reason}

    In some cases a connection attempt (i.e. trying to communicate with another ORB) may block due to a number of reasons. This operation allows the user to check if this is the case. The returned list contain tuples of remote hosts/ports. Normally, the list is empty.

secure() -> no | ssl

    This function returns the security mode Orber is running in, which is either no if it is an insecure domain or the type of security mechanism used. For the moment the only security mechanism is ssl. This is configured by setting the application variable secure.

ssl_server_certfile() -> string()

    This function returns a path to a file containing a chain of PEM encoded certificates for the Orber domain as server. This is configured by setting the application variable ssl_server_certfile.

ssl_client_certfile() -> string()

    This function returns a path to a file containing a chain of PEM encoded certificates used in outgoing calls in the current process. The default value is configured by setting the application variable ssl_client_certfile.

set_ssl_client_certfile(Path) -> ok

    Types
        Path = string()

    This function takes a path to a file containing a chain of PEM encoded certificates as parameter and sets it for the current process.

ssl_server_verify() -> 0 | 1 | 2

    This function returns the type of verification used by SSL during authentication of the other peer for incoming calls. It is configured by setting the application variable ssl_server_verify.

ssl_client_verify() -> 0 | 1 | 2

    This function returns the type of verification used by SSL during authentication of the other peer for outgoing calls. The default value is configured by setting the application variable ssl_client_verify.

set_ssl_client_verify(Value) -> ok

    Types
        Value = 0 | 1 | 2

    This function sets the SSL verification type for the other peer of outgoing calls.

ssl_server_depth() -> int()

    This function returns the SSL verification depth for incoming calls. It is configured by setting the application variable ssl_server_depth.

ssl_client_depth() -> int()

    This function returns the SSL verification depth for outgoing calls. The default value is configured by setting the application variable ssl_client_depth.

set_ssl_client_depth(Depth) -> ok

    Types
        Depth = int()

    This function sets the SSL verification depth for the other peer of outgoing calls.

objectkeys_gc_time() -> int() (seconds)

    This function returns the timeout value after which after which terminated object keys, related to servers started with the configuration parameter {persistent, true}, will be removed. It can be configured by setting the application variable objectkeys_gc_time TimeVal (seconds), if it is not set it will have the default value infinity.

    Objects terminating with reason normal or shutdown are removed automatically.

    Note: the objectkeys_gc_time configuration parameter (TimeVal) may only range between 0 and 1000000 seconds. Otherwise, the default value is used.

bootstrap_port() -> int()

    This function returns the port-number, which is used by the CORBA bootstrapping protocol. This protocol is used to fetch an initial reference from another ORB. It can be configured by setting the application variable bootstrap_port, if it is not set it will use the iiop port.

    Note: In the future it will use the port number which is set in the standard (the suggestion is 900). Because the standard is not ready in this area we in the meantime uses a port number, which do not require root permissions in Unix.

orber_nodes() -> RetVal

    Types
        RetVal = [node()]

    This function returns the list of node names that this orber domain consists of.

install(NodeList) -> ok
install(NodeList, Options) -> ok

    Types
        NodeList = [node()]
        Options = [Option]
         Option = {install_timeout, Timeout} | {ifr_storage_type, TableType} | {nameservice_storage_type, TableType}
         Timeout = infinity | integer()
         TableType = disc_copies | ram_copies

    This function installs all the necessary mnesia tables and load default data in some of them. If one or more Orber tables already exists the installation fails. The function uninstall may be used, if it is safe, i.e., no other application is running Orber.

    Preconditions:

        *   a mnesia schema must exist before the installation

        *   mnesia is running on the other nodes if the new installation shall be a multi node domain

    Mnesia will be started by the function if it is not already running on the installation node and if it was started it will be stopped afterwards.

    The options that can be sent to the installation program is:

        *   {install_timeout, Timeout} - this timeout is how long we will wait for the tables to be created. The Timeout value can be infinity or an integer number in milliseconds. Default is infinity.

        *   {ifr_storage_type, TableType} - this option sets the type of tables used for the interface repository. The TableType can be disc_copies or ram_copies. Default is disc_copies.

        *   {nameservice_storage_type, TableType} - the default behavior of Orber is to install the NameService as ram_copies. This option makes it possible to change this to disc_copies. But the user should be aware of that if a node is restarted, all local object references stored in the NameService is not valid. Hence, you cannot switch to disc_copies and expect exactly the same behavior as before.

uninstall() -> ok

    This function stops the Orber application, terminates all server objects and removes all Orber related mnesia tables.

    Note: Since other applications may be running on the same node using mnesia uninstall will not stop the mnesia application.

add_node(Node, StorageType) -> RetVal

    Types
        Node = node()
        StorageType = disc_copies | ram_copies
        RetVal = ok | exit()

    This function add given node to a existing Orber node group and starts Orber on the new node. orber:add_node is called from a member in the Orber node group.

    Preconditions for new node:

        *   Erlang started on the new node using the option -mnesia extra_db_nodes, e.g., erl -sname new_node_name -mnesia extra_db_nodes ConnectToNodes_List

        *   The new node's domain name is the same for the nodes we want to connect to.

        *   Mnesia is running on the new node (no new schema created).

        *   If the new node will use disc_copies the schema type must be changed using: mnesia:change_table_copy_type(schema, node(), disc_copies).

    Orber will be started by the function on the new node.

    Fails if:

        *   Orber already installed on given node.

        *   Mnesia not started as described above on the new node.

        *   Impossible to copy data in Mnesia tables to the new node.

        *   Not able to start Orber on the new node, due to, for example, the iiop_port is already in use.

    The function do not remove already copied tables after a failure. Use orber:remove_node to remove these tables.

remove_node(Node) -> RetVal

    Types
        Node = node()
        RetVal = ok | exit()

    This function removes given node from a Orber node group. The Mnesia application is not stopped.

configure(Key, Value) -> ok | {'EXIT', Reason}

    Types
        Key = orbDefaultInitRef | orbInitRef | giop_version | iiop_timeout | iiop_connection_timeout | iiop_setup_connection_timeout | objectkeys_gc_time | orber_debug_level
        Value = allowed value associated with the given key

    This function allows the user to configure Orber in, for example, an Erlang shell. It is possible to invoke configure at any time the keys specified above.

    Any other key must be set before installing and starting Orber.

    Trying to change the configuration in any other way is NOT allowed since it may affect the behavior of Orber.

    For more information regarding allowed values, see configuration settings in the User's Guide.

  Note:

Configuring the IIOP timeout values will not affect already existing connections. If you want a guaranteed uniform behavior, you must set these parameters from the start.

AUTHOR
Support - support@erlang.ericsson.se