/razpub/test_src/com/razie/pub/agent/test/SampleJavaService.java

http://razpub.googlecode.com/ · Java · 37 lines · 22 code · 6 blank · 9 comment · 0 complexity · b5721999d06a15896992e5f9048ba9b1 MD5 · raw file

  1. /**
  2. * Razvan's public code. Copyright 2008 based on Apache license (share alike) see LICENSE.txt for
  3. * details. No warranty implied nor any liability assumed for this code.
  4. */
  5. package com.razie.pub.agent.test;
  6. import com.razie.pub.agent.AgentService;
  7. import com.razie.pub.base.log.Log;
  8. import com.razie.pub.lightsoa.SoaMethod;
  9. import com.razie.pub.lightsoa.SoaService;
  10. /**
  11. * sample agent service in java
  12. *
  13. * @author razvanc
  14. */
  15. @SoaService(name = "samplejavaservice", bindings = { "http" }, descr = "sample in java")
  16. public class SampleJavaService extends AgentService {
  17. protected void onStartup() {
  18. Log.logThis("SampleJavaService onStartup()");
  19. }
  20. protected void onShutdown() {
  21. Log.logThis("SampleJavaService onShutdown()");
  22. }
  23. @SoaMethod(descr = "echo with args", args = { "msg" })
  24. public String echo1(String msg) {
  25. return "echo1: " + msg;
  26. }
  27. @SoaMethod(descr = "echo no args")
  28. public String echo2() {
  29. return "echo2...";
  30. }
  31. }