From 7753a6839ac0abb282e2d4372f7a4199243cf4ff Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Wed, 19 Aug 2009 18:31:31 +0000 Subject: Introduce the public includes for the QMF interfaces. Rename Agent to AgentEngine to differentiate the API from the underlying engine. Note that some of these public headers will overlap with the emerging "messaging" API (notably Connection.h and ConnectionSettings.h). It is desirable that these components of the API become common between "messaging" and "qmf". As such, once the differences are reconciled, they will most likely be removed from the qmf space and placed in the messaging space. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@805916 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/bindings/qmf/ruby/Makefile.am | 2 +- qpid/cpp/bindings/qmf/ruby/qmf.rb | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'qpid/cpp/bindings/qmf/ruby') diff --git a/qpid/cpp/bindings/qmf/ruby/Makefile.am b/qpid/cpp/bindings/qmf/ruby/Makefile.am index 532fdb6875..1dc08f646a 100644 --- a/qpid/cpp/bindings/qmf/ruby/Makefile.am +++ b/qpid/cpp/bindings/qmf/ruby/Makefile.am @@ -36,7 +36,7 @@ rubylibarchdir = $(RUBY_LIB_ARCH) rubylibarch_LTLIBRARIES = qmfengine.la qmfengine_la_LDFLAGS = -avoid-version -module -shrext ".$(RUBY_DLEXT)" -qmfengine_la_LIBADD = $(RUBY_LIBS) -L$(top_builddir)/src/.libs -lqpidclient $(top_builddir)/src/libqmfcommon.la +qmfengine_la_LIBADD = $(RUBY_LIBS) -L$(top_builddir)/src/.libs -lqpidclient $(top_builddir)/src/libqmfagent.la qmfengine_la_CXXFLAGS = $(INCLUDES) -I$(RUBY_INC) -I$(RUBY_INC_ARCH) nodist_qmfengine_la_SOURCES = qmfengine.cpp diff --git a/qpid/cpp/bindings/qmf/ruby/qmf.rb b/qpid/cpp/bindings/qmf/ruby/qmf.rb index 7ee447c675..35a76c490a 100644 --- a/qpid/cpp/bindings/qmf/ruby/qmf.rb +++ b/qpid/cpp/bindings/qmf/ruby/qmf.rb @@ -33,11 +33,11 @@ module Qmf class ConnectionSettings < Qmfengine::ConnectionSettings end - class ConnectionEvent + class ConnectionHandler def conn_event_connected(); end def conn_event_disconnected(error); end - def conn_event_session_closed(context, error); end - def conn_event_recv(context, message); end + def sess_event_session_closed(context, error); end + def sess_event_recv(context, message); end end class Query @@ -63,15 +63,10 @@ module Qmf end end - class AgentHandler - def get_query(context, query, userId); end - def method_call(context, name, object_id, args, userId); end - end - class Connection attr_reader :impl - def initialize(settings, event_handler = nil, delay_min = 1, delay_max = 128, delay_factor = 2) + def initialize(settings, delay_min = 1, delay_max = 128, delay_factor = 2) @impl = Qmfengine::ResilientConnection.new(settings, delay_min, delay_max, delay_factor) @sockEngine, @sock = Socket::socketpair(Socket::PF_UNIX, Socket::SOCK_STREAM, 0) @impl.setNotifyFd(@sockEngine.fileno) @@ -232,7 +227,12 @@ module Qmf end end - class Agent + class AgentHandler + def get_query(context, query, userId); end + def method_call(context, name, object_id, args, userId); end + end + + class Agent < ConnectionHandler def initialize(handler, label="") if label == "" @agentLabel = "rb-%s.%d" % [Socket.gethostname, Process::pid] @@ -241,7 +241,7 @@ module Qmf end @conn = nil @handler = handler - @impl = Qmfengine::Agent.new(@agentLabel) + @impl = Qmfengine::AgentEngine.new(@agentLabel) @event = Qmfengine::AgentEvent.new @xmtMessage = Qmfengine::Message.new end -- cgit v1.2.1