ffead.server.doc
MethodInvoc.h
1 /*
2  Copyright 2009-2012, Sumeet Chhetri
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 /*
17  * MethodInvoc.h
18  *
19  * Created on: Jan 30, 2010
20  * Author: sumeet
21  */
22 
23 #ifndef METHODINVOC_H_
24 #define METHODINVOC_H_
25 
26 #include "Server.h"
27 #include "XmlParser.h"
28 #include "Reflector.h"
29 #include "fstream"
30 #include "Serialize.h"
31 
32 #define BACKLOGMI 500
33 #define MAXBUFLEN 1024
34 
35 using namespace std;
36 typedef vector<Element> ElementList;
37 class MethodInvokerException: public exception
38 {
39  public:
40  MethodInvokerException(string message,string &ret){message="<return:exception>"+message+"</return:exception>";ret=message;}
41  virtual ~MethodInvokerException() throw(){}
42  string getMessage() const{return message;};
43  private:
44  string message;
45 };
46 class MethodInvoc {
47  string className;
48  string methodName;
49  string returntype;
50  string retByValOrRef;
51  map<string,string> arguments;
52  bool startTranx;
53  bool endTranx;
54  Server server;
55  bool running;
56  static void init();
57  static void* service(void* arg);
58 
59 public:
60  MethodInvoc();
61  virtual ~MethodInvoc();
62  static void trigger(string);
63  static void stop();
64  Server getServer(){return this->server;}
65  void setServer(Server server){this->server = server;}
66 };
67 
68 #endif /* METHODINVOC_H_ */
69 /*
70 <method className="ExampleClass" methodName="exampleMethod" returntype="string" retByValOrRef="value" startTranx="true">
71  <arguments>
72  <arg type="string">asdfsdf</arg>
73  <arg type="SomeClass"><SomeClass><id type=""><></SomeClass></arg>
74  <arg type="string">asdfsdf</arg>
75  </arguments>
76 </method>
77 */