web services - Compile Scala classes on the fly to implement webservices -


How do I add some webservices dynamically? I am using Scallet for the websary framework.

I am the developer would like to be able to change the certification, for example, that instead of using hard-coded credentials, instead using the database or password file or they need whatever

I also want to allow them to add new web servers inside the servlet.

So, what I want to do is load it in the bootstrap code and then compile the client again and then use that version.

I have seen it, but I do not have to reconstruct the whole class of snippets.

This is what I have tried, but I have added a " .

  class ScalatraBootstrap LifeCycle extends {override def init (context: ServletContext) {val sourceDir = new java.io.File ( "C: /Temp/MyServlet.scala") Val sse = Skalskriptenginekoochangerefres (Sursedir) Sekrifres Println ( "*** -" + Sekkpiltionsatuskstarttime + "" + Sekkpiltionsatuskstoptime) Contekstkmount (Sekget [Misserwlet] ( "Testkprojkmisserwlet ")," / * ")   

I'm using scalascriptengine () at the moment.

So, how can I recompile a class file for webservice, when there can be classes, annotations, and object class in the same file, on the fly?

I am thinking that I need webservice in Groove, but I would prefer to keep it functional.

will add UPDATE

I thought about the first plugins, but ran into a problem that the new web server in the way I It may be that Scalpetra is not going to be the right choice, so that I may need to change my REST service structure.

Finally I want to be able to change webservices on the fly without restarting the application, and allows the source to re-combine.

The realization of a plug-in is not very difficult, at least for the proper cases. The essential elements are as follows:

  • A specific or intangible class defining the obligations of the plug-in.
  • One way to get the code for the plug-in square-path Alternatively, if you are familiar with working with Classloaders, you can do it dynamically. I do not have much experience with it.
  • Once you have java.lang.Class [P , so trivial to get an example, if you Kanstretr No need for parameters.
  • plug-in featuring a protocol that allows the plug-in, for example, to close a top-level URL path segment, which you achieve Skeletro route then all those paths You dispatch requests that match the main path segment through the plug-in example. You just have to make sure that you do not let the two plug-ins claim the same route or if you have some other means to solve it.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -