org.apache.shindig.common.servlet
Class InjectedServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.apache.shindig.common.servlet.InjectedServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
ApiServlet

public abstract class InjectedServlet
extends javax.servlet.http.HttpServlet

Supports DI for servlets. Can't handle ctor injection since the servlet spec requires configuration being done in init().

See Also:
Serialized Form

Field Summary
protected  boolean initialized
           
protected  com.google.inject.Injector injector
           
 
Constructor Summary
InjectedServlet()
           
 
Method Summary
protected  void checkInitialized()
          Called in each guice injected method to insure we are not initialized twice
 void init(javax.servlet.ServletConfig config)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

injector

protected com.google.inject.Injector injector

initialized

protected transient boolean initialized
Constructor Detail

InjectedServlet

public InjectedServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

checkInitialized

protected void checkInitialized()
Called in each guice injected method to insure we are not initialized twice



Copyright © 2007-2012. All Rights Reserved.