Erlang -- interceptors

User's Guide
Reference Manual
Release Notes
PDF
Top

orber
Reference Manual
Version 3.6.22

Expand All
Contract All

Table of Contents

- any
  - Top of manual page
  - create/0
  - create/2
  - set_typecode/2
  - get_typecode/1
  - set_value/2
  - get_value/1
- fixed
  - Top of manual page
  - create/3
  - get_typecode/1
  - add/2
  - subtract/2
  - multiply/2
  - divide/2
  - unary_minus/1
- corba
  - Top of manual page
  - create/2
  - create/3
  - create/4
  - create_link/2
  - create_link/3
  - create_link/4
  - dispose/1
  - create_nil_objref/0
  - create_subobject_key/2
  - get_subobject_key/1
  - get_pid/1
  - raise/1
  - reply/2
  - resolve_initial_references/1
  - resolve_initial_references/2
  - add_initial_service/2
  - remove_initial_service/1
  - list_initial_services/0
  - resolve_initial_references_remote/2
  - resolve_initial_references_remote/3
  - list_initial_services_remote/1
  - list_initial_services_remote/2
  - object_to_string/1
  - string_to_object/1
  - string_to_object/2
  - print_object/1
  - add_alternate_iiop_address/3
  - orb_init/1
- corba_object
  - Top of manual page
  - get_interface/1
  - is_nil/1
  - is_a/2
  - is_a/3
  - is_remote/1
  - non_existent/1
  - non_existent/2
  - not_existent/1
  - not_existent/2
  - is_equivalent/2
  - hash/2
- orber
  - Top of manual page
  - start/0
  - start/1
  - jump_start/1
  - stop/0
  - info/0
  - info/1
  - exception_info/1
  - is_system_exception/1
  - get_tables/0
  - get_ORBInitRef/0
  - get_ORBDefaultInitRef/0
  - domain/0
  - iiop_port/0
  - iiop_out_ports/0
  - iiop_out_ports_random/0
  - iiop_out_ports_attempts/0
  - iiop_ssl_port/0
  - iiop_timeout/0
  - iiop_connection_timeout/0
  - iiop_connections/0
  - iiop_connections/1
  - iiop_connections_pending/0
  - iiop_in_connection_timeout/0
  - iiop_acl/0
  - activate_audit_trail/0
  - activate_audit_trail/1
  - deactivate_audit_trail/0
  - add_listen_interface/2
  - add_listen_interface/3
  - add_listen_interface/3
  - remove_listen_interface/1
  - close_connection/1
  - close_connection/2
  - secure/0
  - ssl_server_certfile/0
  - ssl_client_certfile/0
  - set_ssl_client_certfile/1
  - ssl_server_verify/0
  - ssl_client_verify/0
  - set_ssl_client_verify/1
  - ssl_server_depth/0
  - ssl_client_depth/0
  - set_ssl_client_depth/1
  - objectkeys_gc_time/0
  - orber_nodes/0
  - install/1
  - install/2
  - uninstall/0
  - add_node/2
  - remove_node/1
  - configure/2
- orber_ifr
  - Top of manual page
  - init/2
  - find_repository/0
  - get_def_kind/1
  - destroy/1
  - get_id/1
  - set_id/2
  - get_name/1
  - set_name/2
  - get_version/1
  - set_version/2
  - get_defined_in/1
  - get_absolute_name/1
  - get_containing_repository/1
  - describe/1
  - move/4
  - lookup/2
  - contents/3
  - lookup_name/5
  - describe_contents/4
  - create_module/4
  - create_constant/6
  - create_struct/5
  - create_union/6
  - create_enum/5
  - create_alias/5
  - create_interface/5
  - create_exception/5
  - get_type/1
  - lookup_id/2
  - get_primitive/2
  - create_string/2
  - create_wstring/2
  - create_fixed/3
  - create_sequence/3
  - create_array/3
  - create_idltype/2
  - get_type_def/1
  - set_type_def/2
  - get_value/1
  - set_value/2
  - get_members/1
  - set_members/2
  - get_discriminator_type/1
  - get_discriminator_type_def/1
  - set_discriminator_type_def/2
  - get_original_type_def/1
  - set_original_type_def/2
  - get_kind/1
  - get_bound/1
  - set_bound/2
  - get_element_type/1
  - get_element_type_def/1
  - set_element_type_def/2
  - get_length/1
  - set_length/2
  - get_mode/1
  - set_mode/2
  - get_result/1
  - get_result_def/1
  - set_result_def/2
  - get_params/1
  - set_params/2
  - get_contexts/1
  - set_contexts/2
  - get_exceptions/1
  - set_exceptions/2
  - get_base_interfaces/1
  - set_base_interfaces/2
  - is_a/2
  - describe_interface/1
  - create_attribute/6
  - create_operation/9
- orber_tc
  - Top of manual page
  - null/0
  - void/0
  - short/0
  - unsigned_short/0
  - long/0
  - unsigned_long/0
  - long_long/0
  - unsigned_long_long/0
  - wchar/0
  - float/0
  - double/0
  - boolean/0
  - char/0
  - octet/0
  - any/0
  - typecode/0
  - principal/0
  - object_reference/2
  - struct/3
  - union/5
  - enum/3
  - string/1
  - wstring/1
  - fixed/2
  - sequence/2
  - array/2
  - alias/3
  - exception/3
  - get_tc/1
  - get_tc/1
  - check_tc/1
- orber_acl
  - Top of manual page
  - match/2
  - match/3
  - verify/3
  - range/2
- CosNaming
- CosNaming_NamingContext
  - Top of manual page
  - bind/3
  - rebind/3
  - bind_context/3
  - rebind_context/3
  - resolve/2
  - unbind/2
  - new_context/1
  - bind_new_context/2
  - destroy/1
  - list/2
- CosNaming_NamingContextExt
  - Top of manual page
  - to_string/2
  - to_name/2
  - to_url/3
  - resolve_str/2
- CosNaming_BindingIterator
  - Top of manual page
  - next_one/1
  - next_n/2
  - destroy/1
- lname
  - Top of manual page
  - create/0
  - insert_component/3
  - get_component/2
  - delete_component/2
  - num_component/1
  - equal/2
  - less_than/2
  - to_idl_form/1
  - from_idl_form/1
- lname_component
  - Top of manual page
  - create/0
  - get_id/1
  - set_id/2
  - get_kind/1
  - set_kind/2
- Module_Interface
  - Top of manual page
  - Module_Interface:typeID/0
  - Module_Interface:oe_create/0
  - Module_Interface:oe_create_link/0
  - Module_Interface:oe_create/1
  - Module_Interface:oe_create_link/1
  - Module_Interface:oe_create/2
  - Module_Interface:oe_create_link/2
  - Module_Interface:own_functions/4
  - Module_Interface:own_functions/5
  - Module_Interface_impl:init/1
  - Module_Interface_impl:terminate/2
  - Module_Interface_impl:code_change/3
  - Module_Interface_impl:handle_info/2
  - Module_Interface_impl:own_functions/4
  - Module_Interface_impl:own_functions/5
  - Module_Interface_impl:own_functions/6
  - Module_Interface_impl:own_functions/5
  - Module_Interface_impl:own_functions/4
  - Module_Interface_impl:own_functions/5
- interceptors
  - Top of manual page
  - new_in_connection/3
  - new_in_connection/5
  - new_out_connection/3
  - new_out_connection/5
  - closed_in_connection/1
  - closed_out_connection/1
  - in_reply/6
  - in_reply_encoded/6
  - in_request/6
  - in_request_encoded/6
  - out_reply/6
  - out_reply_encoded/6
  - out_request/6
  - out_request_encoded/6
- orber_diagnostics
  - Top of manual page
  - nameservice/0
  - nameservice/1
  - missing_modules/0

# interceptors

### MODULE

interceptors

### MODULE SUMMARY

Describe the functions which must be exported by any supplied Orber native interceptor.

### DESCRIPTION

This module contains the mandatory functions for user supplied native interceptors and their intended behavior. See also the User's Guide.

Warning

Using Interceptors may reduce the through-put significantly if the supplied interceptors invoke expensive operations. Hence, one should always supply interceptors which cause as little overhead as possible.

Warning

It is possible to alter the Data, Bin and Args parameter for the in_reply and out_reply, in_reply_encoded, in_request_encoded, out_reply_encoded and out_request_encoded, in_request and out_request respectively. But, if it is done incorrectly, the consequences can be serious.

Note

The Extra parameter is set to 'undefined' by Orber when calling the first interceptor and may be set to any Erlang term. If an interceptor change this parameter it will be passed on to the next interceptor in the list uninterpreted.

Note

The Ref parameter is set to 'undefined' by Orber when calling new_in_connection or new_out_connection using the first interceptor. The user supplied interceptor may set NewRef to any Erlang term. If an interceptor change this parameter it will be passed on to the next interceptor in the list uninterpreted.

### EXPORTS

new_in_connection(Ref, PeerHost, PeerPort) -> NewRef
new_in_connection(Ref, PeerHost, PeerPort, SocketHost, SocketPort) -> NewRef

Types:

Ref = term() | undefined
PeerHost = SocketHost = string(), e.g., "myHost@myServer" or "192.0.0.10"
PeerPort = SocketPort = integer()
NewRef = term() | {'EXIT', Reason}

When a new connection is requested by a client side ORB this operation is invoked. If more than one interceptor is supplied, e.g., {native, ['myInterceptor1', 'myInterceptor2']}, the return value from 'myInterceptor1' is passed to 'myInterceptor2' as Ref. Initially, Orber uses the atom 'undefined' as Ref parameter when calling the first interceptor. The return value from the last interceptor, in the example above 'myInterceptor2', is passed to all other functions exported by the interceptors. Hence, the Ref parameter can, for example, be used as a unique identifier to mnesia or ets where information/restrictions for this connection is stored.

The PeerHost and PeerPort variables supplied data of the client ORB which requested a new connection. SocketHost and SocketPort are the local interface and port the client connected to.

If, for some reason, we do not allow the client ORB to connect simply invoke exit(Reason).

new_out_connection(Ref, PeerHost, PeerPort) -> NewRef
new_out_connection(Ref, PeerHost, PeerPort, SocketHost, SocketPort) -> NewRef

Types:

Ref = term() | undefined
PeerHost = SocketHost = string(), e.g., "myHost@myServer" or "192.0.0.10"
PeerPort = SocketPort = integer()
NewRef = term() | {'EXIT', Reason}

When a new connection is set up this function is invoked. Behaves just like new_in_connection; the only difference is that the PeerHost and PeerPort variables identifies the target ORB's bootstrap data and SocketHost and SocketPort are the local interface and port the client ORB connected via.

closed_in_connection(Ref) -> NewRef

Types:

Ref = term()
NewRef = term()

When an existing connection is terminated this operation is invoked. The main purpose of this function is to make it possible for a user to clean up all data associated with the associated connection.

The input parameter Ref is the return value from new_in_connection/3.

closed_out_connection(Ref) -> NewRef

Types:

Ref = term()
NewRef = term()

When an existing connection is terminated this operation is invoked. The main purpose of this function is to make it possible for a user to clean up all data associated with the associated connection.

The input parameter Ref is the return value from new_out_connection/3.

in_reply(Ref, Obj, Ctx, Op, Data, Extra) -> Reply

Types:

Ref = term()
Obj = #objref
Ctx = [#'IOP_ServiceContext'{}]
Op = atom()
Data = [Result, OutParameter1, ..., OutPramaterN]
Reply = {NewData, NewExtra}

When replies are delivered from the server side ORB to the client side ORB this operation is invoked. The Data parameter is a list in which the first element is the return value value from the target object and the rest is a all parameters defined as out or inout in the IDL-specification.

in_reply_encoded(Ref, Obj, Ctx, Op, Bin, Extra) -> Reply

Types:

Ref = term()
Obj = #objref
Ctx = [#'IOP_ServiceContext'{}]
Op = atom()
Bin = #binary
Reply = {NewBin, NewExtra}

When replies are delivered from the server side ORB to the client side ORB this operation is invoked. The Bin parameter is the reply body still uncoded.

in_request(Ref, Obj, Ctx, Op, Args, Extra) -> Reply

Types:

Ref = term()
Obj = #objref
Ctx = [#'IOP_ServiceContext'{}]
Op = atom()
Args = [Argument] - defined in the IDL-specification
Reply = {NewArgs, NewExtra}

When a new request arrives at the server side ORB this operation is invoked.

in_request_encoded(Ref, Obj, Ctx, Op, Bin, Extra) -> Reply

Types:

Ref = term()
Obj = #objref
Ctx = [#'IOP_ServiceContext'{}]
Op = atom()
Bin = #binary
Reply = {NewBin, NewExtra}

When a new request arrives at the server side ORB this operation is invoked before decoding the request body.

out_reply(Ref, Obj, Ctx, Op, Data, Extra) -> Reply

Types:

Ref = term()
Obj = #objref
Ctx = [#'IOP_ServiceContext'{}]
Op = atom()
Data = [Result, OutParameter1, ..., OutPramaterN]
Reply = {NewData, NewExtra}

After the target object have been invoked this operation is invoked with the result. The Data parameter is a list in which the first element is the return value value from the target object and the rest is a all parameters defined as out or inout in the IDL-specification.

out_reply_encoded(Ref, Obj, Ctx, Op, Bin, Extra) -> Reply

Types:

Ref = term()
Obj = #objref
Ctx = [#'IOP_ServiceContext'{}]
Op = atom()
Bin = #binary
Reply = {NewBin, NewExtra}

This operation is similar to out_reply; the only difference is that the reply body have been encoded.

out_request(Ref, Obj, Ctx, Op, Args, Extra) -> Reply

Types:

Ref = term()
Obj = #objref
Ctx = [#'IOP_ServiceContext'{}]
Op = atom()
Args = [Argument] - defined in the IDL-specification
Reply = {NewArgs, NewExtra}

Before a request is sent to the server side ORB, out_request is invoked.

out_request_encoded(Ref, Obj, Ctx, Op, Bin, Extra) -> Reply

Types:

Ref = term()
Obj = #objref
Ctx = [#'IOP_ServiceContext'{}]
Op = atom()
Bin = #binary
Reply = {NewBin, NewExtra}

This operation is similar to out_request; the only difference is that the request body have been encoded.