title: Servlet init() method equivalent in JAX-RS
body: <p>I am working on an application which is running on Glassfish. I am supposed to convert the servlets to proper restful stuff, by using jax-rs and jersey. </p>
  
  <p>I have been trying to find a workaround for init() method, but till now i failed. </p>
  
  <p>Here is the original part, using servlets:</p>
  
  <pre><code>import javax.servlet.*
  
  public void init(ServletConfig config) throws ServletException {
  super.init(config);
   if (!isRunning() == true)) {
       /* Do some stuff here*/
   }
  
   logger.info("Deamon has started");
  }
  </code></pre>
  
  <p>and this one which i am trying to use jax-rs</p>
  
  <pre><code>import javax.ws.rs.*
  import javax.servlet.*
  
  public void init(@Context ServletConfig config) throws ServletException {
  //uper.init(config);
  if (!isRunning() == true)) {
    /* Do some stuff here*/
  }
  
  logger.info("Deamon has started");
  }
  </code></pre>
  
  <p>I have checked mailing lists and googled around but couldnt find a way which could work for this case. </p>
  
  <p>any ideas how to achieve the same behaviour with servlets for init method? </p>