anchor.diff:              end
       end,
       try
  -        InitialState = Module:init(Args),
  -        loop(Module, InitialState, {Options, 0.0})
  +        case Module:init(Args) of
  +            {'$gen_component', Config, InitialState} ->
  +                {value, {on_handler, NewHandler}} =
  +                    lists:keysearch(on_handler, 1, Config),
  +                loop(Module, NewHandler, InitialState, {Options, 0.0});
  +            InitialState ->
  +                loop(Module, on, InitialState, {Options, 0.0})
  +        end
       catch
           throw:Term ->
               log:log(error,"exception in init/loop of ~p: ~p~n", [Module, Term]),
  
positive.code:         %io:format("ok is da~n"),
          ok
      end.
   
  -endif.
  
  -ifdef(SIMULATION).
  loop(Module, State, {Options, Slowest} = _ComponentState) ->
      
      receive
      Message ->
          %io:format("~p ~p ~n", [Message, Module]),
          case Module:on(Message, State) of
          unknown_event ->
              {NewState, NewComponentState} = 
              handle_unknown_event(Message, State, 
                           {Options, Slowest},Module),
              yield(),
              loop(Module, NewState, NewComponentState);
          kill ->
              yield(),
              ok;
          NewState ->
              yield(),
              loop(Module, NewState, {Options, Slowest})
          end
      end.
  wait_for_ok() ->
      %io:format("Warte auf ok~n"),
      release_ok(),
      receive
      {ok} ->
          %io:format("ok is da~n"),
          ok
      end.
  
  release_ok() ->
      scheduler ! {release_ok}.
  
  yield() ->
      scheduler ! {yield}.
  
  -endif.
  
  
  
  
  handle_unknown_event(UnknownMessage, State, ComponentState,Module) ->
     log:log(error,"unknown message: ~p in Module: ~p ~n in State ~p ~n",[UnknownMessage,Module,State]),
  
negative.code: %  Copyright 2007-2009 Konrad-Zuse-Zentrum für Informationstechnik Berlin
  %
  %   Licensed under the Apache License, Version 2.0 (the "License");
  %   you may not use this file except in compliance with the License.
  %   You may obtain a copy of the License at
  %
  %       http://www.apache.org/licenses/LICENSE-2.0
  %
  %   Unless required by applicable law or agreed to in writing, software
  %   distributed under the License is distributed on an "AS IS" BASIS,
  %   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  %   See the License for the specific language governing permissions and
  %   limitations under the License.
  %%%------------------------------------------------------------------------------
  %%% File    : gen_component.erl
  %%% Author  : Thorsten Schuett <schuett@zib.de>
  %%% Description :
  %%%
  %%% Created : 19 Dec 2008 by Thorsten Schuett <schuett@zib.de>
  %%%------------------------------------------------------------------------------
  %% @doc
  %% @author Thorsten Schuett <schuett@zib.de>
  %% @copyright 2008, 2009 Konrad-Zuse-Zentrum für Informationstechnik Berlin
  %% @version $Id$
  