Package com.noelios.restlet.ext.servlet

Examples of com.noelios.restlet.ext.servlet.ServletConverter


    @Override
    protected void initFrameworkServlet() throws ServletException,
            BeansException {
        super.initFrameworkServlet();
        this.converter = new ServletConverter(getServletContext());

        org.restlet.Application application;
        if (getTargetRestlet() instanceof Application) {
            application = (Application) getTargetRestlet();
        } else {
View Full Code Here


    }

    protected void initApplicationContext() throws BeansException {
        super.initApplicationContext();

        myConverter = new ServletConverter(getServletContext());
        myConverter.setTarget(createRoot());
    }
View Full Code Here

     * Overridden to make the ServletConverter aware of the SpringContext
     */
    protected void initApplicationContext() throws BeansException {
        super.initApplicationContext();

        myConverter = new ServletConverter(getServletContext());
        myConverter.setTarget(createRoot());
    }
View Full Code Here

    }

    protected void initApplicationContext() throws BeansException {
        super.initApplicationContext();

        myConverter = new ServletConverter(getServletContext());
        myConverter.setTarget(createRoot());
    }
View Full Code Here

    private ServletConverter converter;

    public void init() throws ServletException {
        super.init();
        log.debug(".init() - start");
        this.converter = new ServletConverter(getServletContext());

        Restlet restlet = new Restlet() {
            public void handle(Request req, Response res) {
                String name = (String) req.getAttributes().get("name");
                String msg = null;
View Full Code Here

     * @return
     */
    protected ServletConverter getServletConverter(ServletConfig servletConfig) {
        //
        // get converter from cache
        ServletConverter converter = (ServletConverter)converters.get(servletConfig.getServletName());
        //
        // check if converter exists
        if (converter == null) {
            //
            // if not, create one
            converter = new ServletConverter(servletConfig.getServletContext());
            //
            // create e router
            TuboRestletRouter router = new TuboRestletRouter(converter.getContext());
            //
            // for each 'route' property, attach a route to router
            Properties tuboProps = this.getProperties();
            for (Enumeration e = tuboProps.propertyNames(); e.hasMoreElements();) {
                String aRoute = (String)e.nextElement();
                // check if this prop is a route
                if ("route[".equals(aRoute.substring(0,6))) {
                    String[] aRouteArray = aRoute.split("=");
                    String route = aRouteArray[1];
                    String event = tuboProps.getProperty(aRoute);
                    Map props = parseRouteProperties(event);
                    //set properties for TuboRestletResource instance
                    //TuboRestletHandler restlet = new TuboRestletHandler(this,event,servletConfig);
                    //attach handler
                    router.attach(route,TuboRestletResource.class, props);
                    //router.attach(route,restlet);
                }
            }
            //
            // set router to converter
            converter.setTarget(router);
            //
            // store the new converter in cache
            converters.put(servletConfig.getServletName(),converter);
        }
        //
View Full Code Here

     */
    public FlowContext processRequest() throws ServletException, IOException {
        if (log.isTraceEnabled()) log.trace(".processRequest() - Begin");
        //
        // get (or create) converter
        ServletConverter converter = getServletConverter(getCurrentServletConfig());
        //
        // execute converter
        converter.service(getCurrentHttpServletRequest(), getCurrentHttpServletResponse());
        if (log.isTraceEnabled()) log.trace(".processRequest() - Done");
        //
        // return the currentFlowContext because the flow execution appends on
        // TuboRestletResource and is stored on this attribute on
        // doConsumerLifeCycle
View Full Code Here

    }

    protected void initApplicationContext() throws BeansException {
        super.initApplicationContext();

        myConverter = new ServletConverter(getServletContext());
        myConverter.setTarget(myRouter);
    }
View Full Code Here

TOP

Related Classes of com.noelios.restlet.ext.servlet.ServletConverter

Copyright © 2018 www.massapicom. 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.