<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:erlang="http://www.springframework.org/schema/erlang" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/erlang http://www.springframework.org/schema/erlang/spring-erlang.xsd"> <erlang:node name="myErlangNode" cookie="erlangCookie" home="${erlang.home}" path="${erlang.path}"/> </beans> erlang -module(my_module). -export([start/0]). -include_lib("spring_erl/include/application.hrl"). -annotation({autowired, [#{bean => my_other_bean}]}). -annotation({gen_server, [#{callbacks => #{init => {my_module, init, 1}, handle_call => {my_module, handle_call, 3}, handle_cast => {my_module, handle_cast, 2}, handle_info => {my_module, handle_info, 2}, terminate => {my_module, terminate, 2}, code_change => {my_module, code_change, 3}}}}]}). start() -> erlang:start_runtime(), spring_erl:launch_app(my_module). init(_Args) -> ok. handle_call(_Request, _From, State) -> {reply, ok, State}. handle_cast(_Msg, State) -> {noreply, State}. handle_info(_Info, State) -> {noreply, State}. terminate(_Reason, State) -> ok. code_change(_OldVsn, State, _Extra) -> {ok, State}.


上一篇:
下一篇:
切换中文