y">} (whiteListOn) {. configuredFilter.setOption (ConnectionFilter.WHITELIST_ON, whiteList_path);
}
}
} String readFile (String configPath) throws IOException {file=new File (configPath); fis; [] buffer; (! file.exists ()) {null;
}=new FileInputStream (file);=new byte [fis.available ()]; (int b, count=0; (b=fis.read ())!=- 1; count + + ) {[count]=(byte) b;
} new String (buffer);
} void setDefaults () throws IOException {. configuredFilter=new ConnectionFilter ();. configuredLogger=new ServerLogger ();. configuredServer=new TCPServer ();. configuredWorker=new Worker (); p>
} ConnectionFilter getConfiguredFilter () {configuredFilter;
} ServerLogger getConfiguredLogger () {configuredLogger;
} TCPServer getConfiguredServer () {configuredServer;
}
Worker getConfiguredWorker () {configuredWorker;
}
}com.gmail.dosofredriver.ajax.serviceserver.util.invoke;java.lang.reflect.Method;java.util.concurrent.ConcurrentHashMap;
/ **
* Date: 29.03.13
* Time: 1:48
*
* @ author DoSOfRR
* / class InvokeCache {static InvokeCache ourInstance=new InvokeCache (); ConcurrentHashMap cachedClasses=new ConcurrentHashMap (); ConcurrentHashMap cachedMethods=new ConcurrentHashMap (); static InvokeCache getInstance () {ourInstance;
} InvokeCache () {
} Method findMethod (String methodName) {cachedMethods.get (methodName);
} Class findClass (String className) {cachedClasses.get (className);
} boolean cacheMethod (Method method) {(findMethod (method.toString ()) == null) {. put (method.toString (), method); true;
} else {false;
}
} boolean cacheClass (Class clazz) {(findClass (clazz.getName ()) == null) {. put (clazz.getName (), clazz); true;
} else {false;
}
} void clearCache () {. clear ();. clear ();
}
}com.gmail.dosofredriver.ajax.serviceserver.util.invoke;com.gmail.dosofredriver.ajax.serviceserver.service.annotations.ServiceMethod;com.gmail.dosofredriver.ajax.serviceserver.util.parser.MethodStruct;java.lang.reflect.Method;java.lang.reflect.Modifier;
/ **
* Date: 28.03.13
* Time: 2:11
*
* @ author DoSOfRR
* / class Invoker {static IllegalArgumentException cachedException=new IllegalArgumentException (new NullPointerException («Method can not be null!")); static Object invoke (MethodStruct param) throws Exception {/ / todo check security fuckupsmethodName=param.methodNamebstring (param.methodName.lastIndexOf («.») +1, param.methodName.length ()); className=param.methodNamebstring (0, param.methodName.lastIndexOf (« ;. »)); clazz=getClass (className); method=getMethod (methodName, clazz, param.argsTypes); (method == ...