This module contains the stub/skeleton functions generated by IC.
Starting a Orber server can be done in three ways:
{sup_child, true}
the oe_create_link/2
function returns {ok, Pid, ObjRef}
which
can be handled by the application supervisor/stdlib-1.7 or later.
{persistent, true}
and {regname, {global, term()}}
Orber will remember the object reference until the
server terminates with reason normal or shutdown. Hence,
if the server is started as a transient supervisor child we do not
receive a 'OBJECT_NOT_EXIST' exception when it has crashed and is being restarted.
The Orber stub can be used to start a pseudo object
, which will create a non-server implementation.
A pseudo object introduce some limitations:
oe_create_link/2
is equal to oe_create/2
, i.e.,
no link can or will be created.
BIF:s self()
and process_flag(trap_exit,true)
behaves incorrectly.
IC
option {{impl, "M::I"}, "other_impl"}
has no effect. The call-back
functions must be implemented in a file called M_I_impl.erl
IC
option
{this, "M::I"}
was used.
State
changes have no effect. The user can provide information via
the Env
start parameter and the State returned from init/2
will be the State
passed in following invocations.
Timeout
have no effect.
{pseudo, true}
overrides all other start options.
init/2
(called via oe_create*/2) and
terminate/2
(called via corba:dispose/1) must be implemented.
By adopting the rules for pseudo
objects described above we can use oe_create/2
to create server
or pseudo
objects, by excluding or including the
option {pseudo, true}
, without changing the call-back module.
If you start a object without {regname, RegName}
it can only be accessed through the returned object key.
Started with a {regname, RegName}
the name is registered locally or globally.
To avoid flooding Orber with old object references start erlang using the flag -orber objectkeys_gc_time Time, which will remove all object references related to servers being dead for Time seconds. To avoid extra overhead, i.e., performing garbage collect if no persistent objects are started, the objectkeys_gc_time default value is infinity. For more information, see the orber and corba documentation. |
TypeId = string(), e.g., "IDL:Module/Interface:1.0"
Returns the Type ID related to this stub/skeleton
ObjRef = #object reference
Start a Orber server.
ObjRef = #object reference
Start a linked Orber server.
Env = term()
ObjRef = #object reference
Start a Orber server passing Env to init/1
.
Env = term()
ObjRef = #object reference
Start a linked Orber server passing Env to init/1
.
oe_create(Env, Options) -> ObjRef
Env = term()
ObjRef = #object reference
Options = [{sup_child, false} | {persistent, Bool} | {regname, RegName} | {pseudo, Bool}]
Bool = true | false
RegName = {global, term()} | {local, atom()}
Start a Orber server passing Env to init/1
.
If the option {pseudo, true}
is used, all other options are overridden.
As default, this option is set to false.
This function cannot be used for starting a server as supervisor child.
If started as persistent
, the options [{persistent, true}, {regname, {global, term()}}]
must be used and
Orber will only forget the object reference if it terminates with reason normal or shutdown.
oe_create_link(Env, Options) -> Return
Env = term()
Return = ObjRef | {ok, Pid, ObjRef}
ObjRef = #object reference
Options = [{sup_child, Bool} | {persistent, Bool} | {regname, RegName} | {pseudo, Bool}]
Bool = true | false
RegName = {global, term()} | {local, atom()}
Start a linked Orber server passing Env to init/1
.
If the option {pseudo, true}
is used, all other options are overridden and no link will be created.
As default, this option is set to false.
This function can be used for starting a server as persistent or supervisor child. At the moment
[{persistent, true}, {regname, {global, term()}}]
must be used to start
a server as persistent, i.e., if a server died and is in the process of being restarted
a call to the server will not raise 'OBJECT_NOT_EXIST'
exception.
Orber will only forget the object reference if it terminates with reason normal or shutdown,
hence, the server must be started as transient (for more information see the
supervisor documentation).
Module_Interface:own_functions(ObjRef, Arg1, ..., ArgN) -> Reply
ObjRef = #object reference
ArgX = specified in the IDL-code.
Reply = specified in the IDL-code.
If the configuration parameter {timeout, "Module::Interface"} is not passed to IC this function must be called when invoking an operation.
Module_Interface:own_functions(ObjRef, Timeout, Arg1, ..., ArgN) -> Reply
ObjRef = #object reference
Timeout = int() >= 0 | infinity
ArgX = specified in the IDL-code.
Reply = specified in the IDL-code.
If the configuration parameter {timeout, "Module::Interface"} is passed to IC this function must be called when invoking an operation.
Module_Interface_impl:init(Env) -> CallReply
Env = term()
CallReply = {ok, State} | {ok, State, Timeout} | ignore | {stop, StopReason}
State = term()
Timeout = int() >= 0 | infinity
StopReason = term()
Whenever a new server is started, init/1 is the first function called in the specified call-back module.
Module_Interface_impl:terminate(Reason, State) -> ok
Reason = term()
State = term()
This call-back function is called whenever the server is about to terminate.
Module_Interface_impl:code_change(OldVsn, State, Extra) -> CallReply
OldVsn = undefined | term()
State = term()
Extra = term()
CallReply = {ok, NewState}
NewState = term()
Update the internal State
.
Module_Interface_impl:handle_info(Info, State) -> CallReply
Info = term()
State = term()
CallReply = {noreply, State} | {noreply, State, Timeout} | {stop, StopReason, State}
Timeout = int() >= 0 | infinity
StopReason = normal | shutdown | term()
If the configuration parameter {{handle_info, "Module::Interface"}, true} is passed to IC and process_flag(trap_exit,true) is set in the init() call-back this function must be exported.
To be able to handle the |
Module_Interface_impl:own_functions(This, State, Arg1, ..., ArgN) -> CallReply
This = the servers #object reference
State = term()
ArgX = specified in the IDL-code.
CallReply = {reply, Reply, State} |
{reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} |
{stop, StopReason, Reply, State} | {stop, StopReason, State}
Reply = specified in the IDL-code.
Timeout = int() >= 0 | infinity
StopReason = normal | shutdown | term()
If the configuration parameter {this, "Module::Interface"} is passed to IC and the function is defined to be two-way this function must be exported.
Module_Interface_impl:own_functions(State, Arg1, ..., ArgN) -> CallReply
State = term()
CallReply = {reply, Reply, State} |
{reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} |
{stop, StopReason, Reply, State} | {stop, StopReason, State}
ArgX = specified in the IDL-code.
Reply = specified in the IDL-code.
Timeout = int() >= 0 | infinity
StopReason = normal | shutdown | term()
If the configuration parameter {this, "Module::Interface"} is not passed to IC and the function is defined to be two-way this function must be exported.
Module_Interface_impl:own_functions(This, State, Arg1, ..., ArgN) -> CallReply
This = the servers #object reference
State = term()
CallReply = {noreply, State} | {noreply, State, Timeout} | {stop, StopReason, State}
ArgX = specified in the IDL-code.
Reply = specified in the IDL-code.
Timeout = int() >= 0 | infinity
StopReason = normal | shutdown | term()
If the configuration parameter {this, "Module::Interface"} is passed to IC and the function is defined to be one-way this function must be exported.
Module_Interface_impl:own_functions(State, Arg1, ..., ArgN) -> CallReply
State = term()
CallReply = {noreply, State} | {noreply, State, Timeout} | {stop, StopReason, State}
ArgX = specified in the IDL-code.
Reply = specified in the IDL-code.
Timeout = int() >= 0 | infinity
StopReason = normal | shutdown | term()
If the configuration parameter {this, "Module::Interface"} is not passed to IC and the function is defined to be one-way this function must be exported.