@Test public void testPerformance() { for (int i = 0; i< 100; i++) { activeToolManager.register(getClass().getResourceAsStream("site-info-original.xml")); } }
public void register(Tool tool, ServletContext context) { ActiveTool at = null; if (tool instanceof MyActiveTool) { at = (MyActiveTool) tool; } else if (tool instanceof ActiveTool) { at = (ActiveTool) tool; } else { at = new MyActiveTool(tool); } if (at instanceof MyActiveTool) { ((MyActiveTool) at).setServletContext(context); } String portletContext = null; Properties toolProps = at.getFinalConfig(); if (toolProps != null) { portletContext = toolProps .getProperty(TOOL_PORTLET_CONTEXT_PATH); } if (!"websphere".equals(serverConfigurationService().getString("servlet.container")) && portletContext == null ) { RequestDispatcher dispatcher = context.getNamedDispatcher(at.getId()); if (dispatcher == null) { M_log.warn("missing dispatcher for tool: " + at.getId()); } } m_tools.put(at.getId(), at); }
ActiveToolComponent extends ToolComponent implements ActiveToolManager { public void register(Tool tool, ServletContext context) { ActiveTool at = null; if (tool instanceof MyActiveTool) { at = (MyActiveTool) tool; } else if (tool instanceof ActiveTool) { at = (ActiveTool) tool; } else { at = new MyActiveTool(tool); } if (at instanceof MyActiveTool) { ((MyActiveTool) at).setServletContext(context); } String portletContext = null; Properties toolProps = at.getFinalConfig(); if (toolProps != null) { portletContext = toolProps .getProperty(TOOL_PORTLET_CONTEXT_PATH); } if (!"websphere".equals(serverConfigurationService().getString("servlet.container")) && portletContext == null ) { RequestDispatcher dispatcher = context.getNamedDispatcher(at.getId()); if (dispatcher == null) { M_log.warn("missing dispatcher for tool: " + at.getId()); } } m_tools.put(at.getId(), at); } }
ActiveToolComponent extends ToolComponent implements ActiveToolManager { public void register(Tool tool, ServletContext context) { ActiveTool at = null; if (tool instanceof MyActiveTool) { at = (MyActiveTool) tool; } else if (tool instanceof ActiveTool) { at = (ActiveTool) tool; } else { at = new MyActiveTool(tool); } if (at instanceof MyActiveTool) { ((MyActiveTool) at).setServletContext(context); } String portletContext = null; Properties toolProps = at.getFinalConfig(); if (toolProps != null) { portletContext = toolProps .getProperty(TOOL_PORTLET_CONTEXT_PATH); } if (!"websphere".equals(serverConfigurationService().getString("servlet.container")) && portletContext == null ) { RequestDispatcher dispatcher = context.getNamedDispatcher(at.getId()); if (dispatcher == null) { M_log.warn("missing dispatcher for tool: " + at.getId()); } } m_tools.put(at.getId(), at); }  }
ActiveToolComponent extends ToolComponent implements ActiveToolManager { public void register(Tool tool, ServletContext context) { ActiveTool at = null; if (tool instanceof MyActiveTool) { at = (MyActiveTool) tool; } else if (tool instanceof ActiveTool) { at = (ActiveTool) tool; } else { at = new MyActiveTool(tool); } if (at instanceof MyActiveTool) { ((MyActiveTool) at).setServletContext(context); } String portletContext = null; Properties toolProps = at.getFinalConfig(); if (toolProps != null) { portletContext = toolProps .getProperty(TOOL_PORTLET_CONTEXT_PATH); } if (!"websphere".equals(serverConfigurationService().getString("servlet.container")) && portletContext == null ) { RequestDispatcher dispatcher = context.getNamedDispatcher(at.getId()); if (dispatcher == null) { M_log.warn("missing dispatcher for tool: " + at.getId()); } } m_tools.put(at.getId(), at); }  void register(Tool tool, ServletContext context); void register(Document toolXml, ServletContext context); List<Tool> parseTools(File toolXmlFile); List<Tool> parseTools(InputStream toolXmlStream); List<Tool> parseTools(Document toolXml); void register(File toolXmlFile, ServletContext context); void register(InputStream toolXmlStream, ServletContext context); ActiveTool getActiveTool(String id); }
ActiveToolComponent extends ToolComponent implements ActiveToolManager { public void register(Tool tool, ServletContext context) { ActiveTool at = null; if (tool instanceof MyActiveTool) { at = (MyActiveTool) tool; } else if (tool instanceof ActiveTool) { at = (ActiveTool) tool; } else { at = new MyActiveTool(tool); } if (at instanceof MyActiveTool) { ((MyActiveTool) at).setServletContext(context); } String portletContext = null; Properties toolProps = at.getFinalConfig(); if (toolProps != null) { portletContext = toolProps .getProperty(TOOL_PORTLET_CONTEXT_PATH); } if (!"websphere".equals(serverConfigurationService().getString("servlet.container")) && portletContext == null ) { RequestDispatcher dispatcher = context.getNamedDispatcher(at.getId()); if (dispatcher == null) { M_log.warn("missing dispatcher for tool: " + at.getId()); } } m_tools.put(at.getId(), at); }  void register(Tool tool, ServletContext context); void register(Document toolXml, ServletContext context); List<Tool> parseTools(File toolXmlFile); List<Tool> parseTools(InputStream toolXmlStream); List<Tool> parseTools(Document toolXml); void register(File toolXmlFile, ServletContext context); void register(InputStream toolXmlStream, ServletContext context); ActiveTool getActiveTool(String id); static final String TOOL_PORTLET_CONTEXT_PATH; }