4
%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
21
-module(iiop_module_test_impl).
22
-include_lib("orber/include/corba.hrl").
23
-include("idl_output/iiop_module.hrl").
26
-export([send_void/1, send_short/3, send_ushort/3]).
27
-export([send_long/3, send_ulong/3, send_float/3]).
28
-export([send_double/3, send_boolean/3, send_char/3]).
29
-export([send_octet/3, send_any/3, send_object/3]).
30
-export([send_struct1/3, send_union1/3, send_enum1/3]).
31
-export([send_string/3, send_sequence1/3, send_array1/3]).
32
-export([ret_systemexception/1, ret_userexception/1]).
36
-export([start/0, stop/0]).
37
-export([init/1, terminate/2]).
43
terminate(Reason, _State) ->
44
io:format("~p terminating with reason ~p~n", [?MODULE, Reason]),
49
SFok = corba:create('iiop_module_test', "IDL:iiop_module/test:1.0"),
50
NS = corba:resolve_initial_references("NameService"),
51
NC1 = lname_component:set_id(lname_component:create(), "iiop_test"),
52
NC2 = lname_component:set_id(lname_component:create(), "erl_test"),
53
N = lname:insert_component(lname:create(), 1, NC1),
54
N1 = lname:insert_component(N, 2, NC2),
55
'CosNaming_NamingContext':bind(NS, N1, SFok),
59
NS = corba:resolve_initial_references("NameService"),
60
NC1 = lname_component:set_id(lname_component:create(), "iiop_test"),
61
NC2 = lname_component:set_id(lname_component:create(), "erl_test"),
62
N = lname:insert_component(lname:create(), 1, NC1),
63
N1 = lname:insert_component(N, 2, NC2),
64
'CosNaming_NamingContext':unbind(NS, N1).
71
send_short(S, P1, P2) ->
74
send_ushort(S, P1, P2) ->
77
send_long(S, P1, P2) ->
80
send_ulong(S, P1, P2) ->
83
send_float(S, P1, P2) ->
86
send_double(S, P1, P2) ->
89
send_boolean(S, P1, P2) ->
92
send_char(S, P1, P2) ->
95
send_octet(S, P1, P2) ->
98
send_any(S, P1, P2) ->
101
send_object(S, P1, P2) ->
104
send_struct1(S, P1, P2) ->
107
send_union1(S, P1, P2) ->
110
send_enum1(S, P1, P2) ->
113
send_string(S, P1, P2) ->
116
send_sequence1(S, P1, P2) ->
119
send_array1(S, P1, P2) ->
122
ret_systemexception(S) ->
123
throw(#'BAD_PARAM'{}),
126
ret_userexception(S) ->
127
throw(#iiop_module_Except1{why="not readable",rest_of_name=["foo", "bar"]}),