Examples of ServletConfig


Examples of javax.servlet.ServletConfig

  }

  @Override
  public ServletConfig getServletConfig() {
    return new ServletConfig() {
      public String getServletName() {
        return "JibeSpringMvcDispatcher";
      }

      public ServletContext getServletContext() {
View Full Code Here

Examples of javax.servlet.ServletConfig

    private static final String ALREADY_INITED = "synapseAlreadyInited";

    public static final String SYNAPSE_SERVER_MANAGER = "synapse.server.manager";

    public void init() throws ServletException {
        ServletConfig servletConfig = getServletConfig();
        ServletContext servletContext = servletConfig.getServletContext();
        if (Boolean.TRUE.equals(servletContext.getAttribute(ALREADY_INITED))) {
            return;
        }
        ServerManager serverManager = new ServerManager();
        ServerConfigurationInformation information =
View Full Code Here

Examples of javax.servlet.ServletConfig

    public void testTurbineConfigWithPropertiesFile() throws Exception
    {
        String value = new File("/conf/test/TemplateService.properties").getPath();
        tc = new TurbineConfig(".", value);

        ServletConfig config = (ServletConfig) tc;
        ServletContext context = config.getServletContext();

        String confFile= Turbine.findInitParameter(context, config,
                TurbineConfig.PROPERTIES_PATH_KEY,
                null);
        assertEquals(value, confFile);
View Full Code Here

Examples of javax.servlet.ServletConfig

    public void testTurbineXmlConfigWithConfigurationFile() throws Exception
    {
        String value = new File("/conf/test/TurbineConfiguration.xml").getPath();
            txc = new TurbineXmlConfig(".", value);

        ServletConfig config = (ServletConfig) txc;
        ServletContext context = config.getServletContext();

            String confFile= Turbine.findInitParameter(context, config,
                    TurbineConfig.CONFIGURATION_PATH_KEY,
                    null);
        assertEquals(value, confFile);
View Full Code Here

Examples of javax.servlet.ServletConfig

    public final void init() throws ServletException
    {
        synchronized (this.getClass())
        {
            super.init();
            ServletConfig config = getServletConfig();

            if (!firstInit)
            {
                log.info("Double initialization of Turbine was attempted!");
                return;
            }
            // executing init will trigger some static initializers, so we have
            // only one chance.
            firstInit = false;

            try
            {
                ServletContext context = config.getServletContext();

                configure(config, context);

                templateService = TurbineTemplate.getService();
                rundataService = TurbineRunDataFacade.getService();
View Full Code Here

Examples of javax.servlet.ServletConfig

     *         stage
     */
    public void init()
            throws InitializationException
    {
        ServletConfig config = Turbine.getTurbineServletConfig();
        Configuration loaderConf = new BaseConfiguration();

        String[] names = getConfiguration().getStringArray(NAME);

        log.warn("The ComponentService is deprecated!");

        for (int i = 0; i < names.length; i++)
        {
            String key = names[i];

            loaderConf.addProperty(COMPONENT + "." + NAME, key);

            String subProperty = COMPONENT + "." + key;
            Configuration subConf = getConfiguration().subset(key);

            for (Iterator it = subConf.getKeys(); it.hasNext();)
            {
                String subKey = (String) it.next();
                Object subVal = subConf.getProperty(subKey);

                if (subKey.equals(CONFIG))
                {
                    log.debug("Fixing up " + subVal);
                    String newPath =
                            config.getServletContext().getRealPath((String) subVal);

                    if (newPath == null)
                    {
                      throw new InitializationException("Could not translate path " + subVal);
                    }
View Full Code Here

Examples of javax.servlet.ServletConfig

        String tmpPath = getConfiguration().getString(
                UploadService.REPOSITORY_KEY,
                UploadService.REPOSITORY_DEFAULT);

        // return the expanded path name
        ServletConfig config = Turbine.getTurbineServletConfig();
        return ServletUtils.expandRelative(config, tmpPath);

    }
View Full Code Here

Examples of javax.servlet.ServletConfig

        }
        return is;
    }
   
    public final void init(final FilterConfig filterConfig) throws ServletException {
        init(new ServletConfig() {
            public String getServletName() {
                return filterConfig.getFilterName();
            }
            public ServletContext getServletContext() {
                return filterConfig.getServletContext();
View Full Code Here

Examples of javax.servlet.ServletConfig

    }

    @SuppressWarnings("unchecked")
    private void doInitialization() throws ServletException
    {
        ServletConfig config = getServletConfig();
        String hierarchy = config.getInitParameter(HIERARCHY_INIT_PARAMETER);
        if (hierarchy != null && !"".equals(hierarchy))
        {
            List<Class<? extends ConfiguredObject>> classes = new ArrayList<Class<? extends ConfiguredObject>>();
            String[] hierarchyItems = hierarchy.split(",");
            for (String item : hierarchyItems)
            {
                Class<?> itemClass = null;
                try
                {
                    itemClass = Class.forName(item);
                }
                catch (ClassNotFoundException e)
                {
                    try
                    {
                        itemClass = Class.forName("org.apache.qpid.server.model." + item);
                    }
                    catch (ClassNotFoundException e1)
                    {
                        throw new ServletException("Unknown configured object class '" + item
                                + "' is specified in hierarchy for " + config.getServletName());
                    }
                }
                Class<? extends ConfiguredObject> clazz = (Class<? extends ConfiguredObject>)itemClass;
                classes.add(clazz);
            }
View Full Code Here

Examples of javax.servlet.ServletConfig

    }

    @Override
    public void init() throws ServletException
    {
        ServletConfig servletConfig = getServletConfig();
        ServletContext servletContext = servletConfig.getServletContext();
        _broker = HttpManagementUtil.getBroker(servletContext);
        _managementConfiguration = HttpManagementUtil.getManagementConfiguration(servletContext);
        super.init();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.