This commit is contained in:
Ren RenJuan 2014-01-11 21:55:55 +00:00
parent b7787a7880
commit 633a9992b7
2 changed files with 43 additions and 16 deletions

View File

@ -5,14 +5,16 @@ LOCATION=authoring
CC=g++ CC=g++
Cc=gcc Cc=gcc
# #---------------------------------------------------------------
# To build apig-cli, you must first build the server # To build apig-cli, you must first build an XMLRPC entabled
# and put it in operation at port used here because part # cliever and put it in operation at URL below because part
# of the client is generated using xml-rpc-api2cpp. # of the generic core client generated using xml-rpc-api2cpp.
# #--------------------------------------------------------------
CD_URL= http://localhost:4243/RPC2
MD_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 ##### Set this to the location of the executables/objects to be produced
BUILD_OBJ_DIR = build BUILD_OBJ_DIR = build
@ -20,6 +22,11 @@ BUILD_OBJ_DIR = build
BOSTLIB=-L/usr/lib/boost BOSTLIB=-L/usr/lib/boost
BOSINCL=-L/usr/include/boost BOSINCL=-L/usr/include/boost
LOG4LIB=-L/usr/lib LOG4LIB=-L/usr/lib
#DEF_XML_RPC=-DXMLRPC-C
#XMLRPC_INCL=
#XMLRPC_LIB=
CLIENT=drde CLIENT=drde
SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) -l boost_system -l boost_thread -l log4cpp SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) -l boost_system -l boost_thread -l log4cpp
@ -52,20 +59,25 @@ cliever: build/$(CLIENT)-cd
.c.o: .c.o:
$(Cc) -c $(CLFLAGS) -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: client/mdClientBehavior.cpp:
xml-rpc-api2cpp $(MD_URL) "behavior" mdClientBehavior >client/mdClientBehavior xml-rpc-api2cpp $(CD_URL) "behavior" mdClientBehavior >client/mdClientBehavior
bin/after client/mdClientBehavior mdClientBehavior\.cc >client/mdClientBehavior.cpp after client/mdClientBehavior mdClientBehavior\.cc >client/mdClientBehavior.cpp
bin/before client/mdClientBehavior mdClientBehavior\.cc >include/mdClientBehavior.h before client/mdClientBehavior mdClientBehavior\.cc >include/mdClientBehavior.h
rm src/client/mdClientBehavior rm src/client/mdClientBehavior
client/mdClientDevice.cpp: client/mdClientDevice.cpp:
xml-rpc-api2cpp $(MD_URL) "device" mdClientDevice >client/mdClientDevice xml-rpc-api2cpp $(CD_URL) "device" mdClientDevice >client/mdClientDevice
bin/after client/mdClientDevice mdClientDevice\.cc >client/mdClientDevice.cpp after client/mdClientDevice mdClientDevice\.cc >client/mdClientDevice.cpp
bin/before client/mdClientDevice mdClientDevice\.cc >include/mdClientDevice.h before client/mdClientDevice mdClientDevice\.cc >include/mdClientDevice.h
rm src/client/mdClientDevice rm src/client/mdClientDevice
client/mdClientState.cpp: 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/after client/mdClientState mdClientState\.cc >client/mdClientState.cpp
bin/before client/mdClientState mdClientState\.cc >include/mdClientState.h bin/before client/mdClientState mdClientState\.cc >include/mdClientState.h
rm src/client/mdClientState rm src/client/mdClientState

View File

@ -72,6 +72,17 @@ void acClientServer() { // AKA "Cliever"
boost::thread cliever(runCliever); boost::thread cliever(runCliever);
boost::thread apiLayer(runAPILayer); 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() || !cliever.joinable()) {
if (!apiLayer.joinable()) if (!apiLayer.joinable())
theseLogs.logN(0,"Failed to start API layer, ausred-cd process will terminate."); theseLogs.logN(0,"Failed to start API layer, ausred-cd process will terminate.");
@ -80,7 +91,11 @@ void acClientServer() { // AKA "Cliever"
} }
else { else {
theseLogs.logN(0,"Cliever started OK."); 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."); theseLogs.logN(0,"ausreg-cd EOJ.");
} }