diff --git a/APIG/Makefile b/APIG/Makefile index d9ed428..3ca40f5 100644 --- a/APIG/Makefile +++ b/APIG/Makefile @@ -5,14 +5,16 @@ LOCATION=authoring CC=g++ Cc=gcc -# -# To build apig-cli, you must first build the server -# and put it in operation at port used here because part -# of the client is generated using xml-rpc-api2cpp. -# - -MD_URL= http://localhost:4243/RPC2 - +#--------------------------------------------------------------- +# To build apig-cli, you must first build an XMLRPC entabled +# cliever and put it in operation at URL below because part +# of the generic core client generated using xml-rpc-api2cpp. +#-------------------------------------------------------------- +CD_URL= http://localhost:4243/RPC2 +#--------------------------------------------------------------- +# You can build just CD without XMLRPC by leaving the DEF, LIB +# INCL variables out. Otherwise set them from xmlrpc-c-config. +#-------------------------------------------------------------- ##### Set this to the location of the executables/objects to be produced BUILD_OBJ_DIR = build @@ -20,6 +22,11 @@ BUILD_OBJ_DIR = build BOSTLIB=-L/usr/lib/boost BOSINCL=-L/usr/include/boost LOG4LIB=-L/usr/lib + +#DEF_XML_RPC=-DXMLRPC-C +#XMLRPC_INCL= +#XMLRPC_LIB= + CLIENT=drde SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) -l boost_system -l boost_thread -l log4cpp @@ -52,20 +59,25 @@ cliever: build/$(CLIENT)-cd .c.o: $(Cc) -c $(CLFLAGS) -o $< +# +# xmlrpc utils will create the following by reflection from a running cliever. +# this is only needed for APIG, +# + client/mdClientBehavior.cpp: - xml-rpc-api2cpp $(MD_URL) "behavior" mdClientBehavior >client/mdClientBehavior - bin/after client/mdClientBehavior mdClientBehavior\.cc >client/mdClientBehavior.cpp - bin/before client/mdClientBehavior mdClientBehavior\.cc >include/mdClientBehavior.h + xml-rpc-api2cpp $(CD_URL) "behavior" mdClientBehavior >client/mdClientBehavior + after client/mdClientBehavior mdClientBehavior\.cc >client/mdClientBehavior.cpp + before client/mdClientBehavior mdClientBehavior\.cc >include/mdClientBehavior.h rm src/client/mdClientBehavior client/mdClientDevice.cpp: - xml-rpc-api2cpp $(MD_URL) "device" mdClientDevice >client/mdClientDevice - bin/after client/mdClientDevice mdClientDevice\.cc >client/mdClientDevice.cpp - bin/before client/mdClientDevice mdClientDevice\.cc >include/mdClientDevice.h + xml-rpc-api2cpp $(CD_URL) "device" mdClientDevice >client/mdClientDevice + after client/mdClientDevice mdClientDevice\.cc >client/mdClientDevice.cpp + before client/mdClientDevice mdClientDevice\.cc >include/mdClientDevice.h rm src/client/mdClientDevice client/mdClientState.cpp: - xml-rpc-api2cpp $(MD_URL) "state" mdClientState >client/mdClientState + xml-rpc-api2cpp $(CD_URL) "state" mdClientState >client/mdClientState bin/after client/mdClientState mdClientState\.cc >client/mdClientState.cpp bin/before client/mdClientState mdClientState\.cc >include/mdClientState.h rm src/client/mdClientState diff --git a/APIG/client/ausreg-cd.cpp b/APIG/client/ausreg-cd.cpp index 9907eee..a11f657 100644 --- a/APIG/client/ausreg-cd.cpp +++ b/APIG/client/ausreg-cd.cpp @@ -72,6 +72,17 @@ void acClientServer() { // AKA "Cliever" boost::thread cliever(runCliever); boost::thread apiLayer(runAPILayer); +#ifdef XMLRPC-C + + xmlrpc_c::serverAbyss myAbyssServer( + thisConfig->api_registry, + thisConfig->xmlrpcPort, + thisConfig->xmlrpcLogpath + ); + + +#endif + if (!apiLayer.joinable() || !cliever.joinable()) { if (!apiLayer.joinable()) theseLogs.logN(0,"Failed to start API layer, ausred-cd process will terminate."); @@ -80,7 +91,11 @@ void acClientServer() { // AKA "Cliever" } else { theseLogs.logN(0,"Cliever started OK."); - apiLayer.join(); +#ifdef XMLRPC-C + theseLogs->logN(2,"%s %d","Accepting XMLRPC API Requests on Port",thisConfig->xmlrpcPort); + myAbyssServer.run(); +#endif + apiLayer.join(); theseLogs.logN(0,"ausreg-cd EOJ."); }