1
%%------------------------------------------------------------------------
5
%% Copyright Ericsson AB 2001-2010. All Rights Reserved.
7
%% The contents of this file are subject to the Erlang Public License,
8
%% Version 1.1, (the "License"); you may not use this file except in
9
%% compliance with the License. You should have received a copy of the
10
%% Erlang Public License along with this software. If not, it can be
11
%% retrieved online at http://www.erlang.org/.
13
%% Software distributed under the License is distributed on an "AS IS"
14
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15
%% the License for the specific language governing rights and limitations
21
%%------------------------------------------------------------------------
22
%% Description: a very simple implementation of Pull Supplier interface
23
%%------------------------------------------------------------------------
24
-module(event_test_PullS_impl).
26
-include_lib("orber/include/corba.hrl").
28
-export([init/1, terminate/2, pull/1, try_pull/1, disconnect_pull_supplier/1,
34
terminate(_From, _Reason) ->
38
corba:raise(#'INTERNAL'{completion_status = ?COMPLETED_NO});
39
pull([Event|Events]) ->
40
{reply, Event, Events}.
43
{reply, {#any{typecode=tk_null, value = null}, false}, []};
44
try_pull([Event|Events]) ->
45
{reply, {Event, true}, Events}.
47
disconnect_pull_supplier(Events) ->
48
io:format("event_test_PullS terminates ~p~n", [Events]),
49
{stop, normal, ok, Events}.
52
add_event(Events, Event) ->
53
%% Store in FIFO order; don't really care if we use '++' since
54
%% this operation is used in tests only.
55
{reply, ok, Events ++ [Event]}.