Is it possible to invoke an adapter from a java file, like the equivalent for WL.server.invokeProcedure
in the javascript.
Please suggest other ways if thats not an option.
You can see the example in the PDF from Worklight 6.2: http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v620/04_12_Using_Java_in_adapters.pdf
The code example may contain errors there so you'll probably need to adjust it.
However if Leandro's example helped you progress further and implement the correct code - you should go with his answer.