test_class.declarator: servletContainer
test_class.modifier: private
test_class.original_string: private ServletContainerImpl servletContainer;
test_class.type: ServletContainerImpl
test_class.var_name: servletContainer
test_class.declarator: servletConfig
test_class.modifier: private
test_class.original_string: private ServletConfig servletConfig;
test_class.type: ServletConfig
test_class.var_name: servletConfig
test_class.declarator: filterConfig
test_class.modifier: private
test_class.original_string: private FilterConfig filterConfig;
test_class.type: FilterConfig
test_class.var_name: filterConfig
test_class.file: http/src/test/java/ro/polak/http/servlet/impl/ServletContainerImplTest.java
test_class.identifier: ServletContainerImplTest
test_case.body: @Test
      public void shouldDestroyOutdatedServlet() throws Exception {
          servletContainer = new ServletContainerImpl(new DateProvider(), 50, 50);
          SampleServlet servlet = (SampleServlet) servletContainer.getServletForClass(SampleServlet.class, servletConfig);
          assertThat(servlet, is(not(nullValue())));
  
          Thread.sleep(200);
  
          SampleServlet servlet2 = (SampleServlet) servletContainer.getServletForClass(SampleServlet.class, servletConfig);
  
          assertThat(servlet, is(not(nullValue())));
          assertThat(servlet, is(not(sameInstance(servlet2))));
      }
test_case.class_method_signature: ServletContainerImplTest.shouldDestroyOutdatedServlet()
test_case.full_signature: @Test public void shouldDestroyOutdatedServlet()
test_case.identifier: shouldDestroyOutdatedServlet
test_case.invocations: getServletForClass assertThat is not nullValue sleep getServletForClass assertThat is not nullValue assertThat is not sameInstance
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldDestroyOutdatedServlet()
focal_class.declarator: LOGGER = Logger.getLogger(ServletContainerImpl.class.getName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = Logger.getLogger(ServletContainerImpl.class.getName());
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: servlets = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<Class<? extends HttpServlet>, Servlet> servlets = new ConcurrentHashMap<>();
focal_class.type: Map<Class<? extends HttpServlet>, Servlet>
focal_class.var_name: servlets
focal_class.declarator: filters = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<Class<? extends Filter>, Filter> filters = new ConcurrentHashMap<>();
focal_class.type: Map<Class<? extends Filter>, Filter>
focal_class.var_name: filters
focal_class.declarator: servletStats = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<Class<? extends HttpServlet>, ServletStats> servletStats = new ConcurrentHashMap<>();
focal_class.type: Map<Class<? extends HttpServlet>, ServletStats>
focal_class.var_name: servletStats
focal_class.declarator: timer = new Timer()
focal_class.modifier: private final
focal_class.original_string: private final Timer timer = new Timer();
focal_class.type: Timer
focal_class.var_name: timer
focal_class.declarator: dateProvider
focal_class.modifier: private final
focal_class.original_string: private final DateProvider dateProvider;
focal_class.type: DateProvider
focal_class.var_name: dateProvider
focal_class.file: http/src/main/java/ro/polak/http/servlet/impl/ServletContainerImpl.java
focal_class.identifier: ServletContainerImpl
focal_class.interfaces: implements ServletContainer
focal_class.class_method_signature: ServletContainerImpl.ServletContainerImpl(final DateProvider dateProvider,
                                  final long servletTimeToLiveInMs,
                                  final long monitoringIntervalInMs)
focal_class.full_signature: public  ServletContainerImpl(final DateProvider dateProvider,
                                  final long servletTimeToLiveInMs,
                                  final long monitoringIntervalInMs)
focal_class.identifier: ServletContainerImpl
focal_class.modifiers: public
focal_class.parameters: (final DateProvider dateProvider,
                                  final long servletTimeToLiveInMs,
                                  final long monitoringIntervalInMs)
focal_class.signature:  ServletContainerImpl(final DateProvider dateProvider,
                                  final long servletTimeToLiveInMs,
                                  final long monitoringIntervalInMs)
focal_class.class_method_signature: ServletContainerImpl.getServletForClass(final Class<? extends HttpServlet> servletClass, final ServletConfig servletConfig)
focal_class.full_signature: @Override public Servlet getServletForClass(final Class<? extends HttpServlet> servletClass, final ServletConfig servletConfig)
focal_class.identifier: getServletForClass
focal_class.modifiers: @Override public
focal_class.parameters: (final Class<? extends HttpServlet> servletClass, final ServletConfig servletConfig)
focal_class.return: Servlet
focal_class.signature: Servlet getServletForClass(final Class<? extends HttpServlet> servletClass, final ServletConfig servletConfig)
focal_class.class_method_signature: ServletContainerImpl.getFilterForClass(final Class<? extends Filter> filterClass, final FilterConfig filterConfig)
focal_class.full_signature: @Override public Filter getFilterForClass(final Class<? extends Filter> filterClass, final FilterConfig filterConfig)
focal_class.identifier: getFilterForClass
focal_class.modifiers: @Override public
focal_class.parameters: (final Class<? extends Filter> filterClass, final FilterConfig filterConfig)
focal_class.return: Filter
focal_class.signature: Filter getFilterForClass(final Class<? extends Filter> filterClass, final FilterConfig filterConfig)
focal_class.class_method_signature: ServletContainerImpl.initializeServlet(final Class<? extends HttpServlet> serverClass, final ServletConfig servletConfig)
focal_class.full_signature: private Servlet initializeServlet(final Class<? extends HttpServlet> serverClass, final ServletConfig servletConfig)
focal_class.identifier: initializeServlet
focal_class.modifiers: private
focal_class.parameters: (final Class<? extends HttpServlet> serverClass, final ServletConfig servletConfig)
focal_class.return: Servlet
focal_class.signature: Servlet initializeServlet(final Class<? extends HttpServlet> serverClass, final ServletConfig servletConfig)
focal_class.class_method_signature: ServletContainerImpl.instantiateServlet(final Class<? extends HttpServlet> serverClass)
focal_class.full_signature: private Servlet instantiateServlet(final Class<? extends HttpServlet> serverClass)
focal_class.identifier: instantiateServlet
focal_class.modifiers: private
focal_class.parameters: (final Class<? extends HttpServlet> serverClass)
focal_class.return: Servlet
focal_class.signature: Servlet instantiateServlet(final Class<? extends HttpServlet> serverClass)
focal_class.class_method_signature: ServletContainerImpl.instantiateFilter(final Class<? extends Filter> filterClass)
focal_class.full_signature: private Filter instantiateFilter(final Class<? extends Filter> filterClass)
focal_class.identifier: instantiateFilter
focal_class.modifiers: private
focal_class.parameters: (final Class<? extends Filter> filterClass)
focal_class.return: Filter
focal_class.signature: Filter instantiateFilter(final Class<? extends Filter> filterClass)
focal_class.class_method_signature: ServletContainerImpl.shutdown()
focal_class.full_signature: @Override public void shutdown()
focal_class.identifier: shutdown
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void shutdown()
focal_class.class_method_signature: ServletContainerImpl.shutdownServlet(final Servlet servlet)
focal_class.full_signature: private void shutdownServlet(final Servlet servlet)
focal_class.identifier: shutdownServlet
focal_class.modifiers: private
focal_class.parameters: (final Servlet servlet)
focal_class.return: void
focal_class.signature: void shutdownServlet(final Servlet servlet)
focal_class.class_method_signature: ServletContainerImpl.getServletStats()
focal_class.full_signature: public Map<Class<? extends HttpServlet>, ServletStats> getServletStats()
focal_class.identifier: getServletStats
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<Class<? extends HttpServlet>, ServletStats>
focal_class.signature: Map<Class<? extends HttpServlet>, ServletStats> getServletStats()
focal_method.body: @Override
      public Servlet getServletForClass(final Class<? extends HttpServlet> servletClass, final ServletConfig servletConfig)
              throws ServletInitializationException, ServletException {
  
          if (servlets.containsKey(servletClass)) {
              servletStats.get(servletClass).setLastRequestedAt(dateProvider.now());
              return servlets.get(servletClass);
          }
  
          return initializeServlet(servletClass, servletConfig);
      }
focal_method.class_method_signature: ServletContainerImpl.getServletForClass(final Class<? extends HttpServlet> servletClass, final ServletConfig servletConfig)
focal_method.full_signature: @Override public Servlet getServletForClass(final Class<? extends HttpServlet> servletClass, final ServletConfig servletConfig)
focal_method.identifier: getServletForClass
focal_method.invocations: containsKey setLastRequestedAt get now get initializeServlet
focal_method.modifiers: @Override public
focal_method.parameters: (final Class<? extends HttpServlet> servletClass, final ServletConfig servletConfig)
focal_method.return: Servlet
focal_method.signature: Servlet getServletForClass(final Class<? extends HttpServlet> servletClass, final ServletConfig servletConfig)