Examples of CatalogFactory


Examples of org.apache.beehive.netui.core.chain.CatalogFactory

            todo: neaten up this initialization process.  because of the separation between
                  parsing and configuration, this is a second step.
                  Need to put this somewhere in the framework, preferably in a single
                  place that initializes the PageFlow runtime.
             */
            CatalogFactory catalogFactory = CatalogFactory.getInstance();
            if(catalogFactory.getCatalog() == null)
                catalogFactory = CatalogFactory.getInstance(catalogConfig);

            assert catalogFactory != null;
            Catalog catalog = catalogFactory.getCatalog();
            if(catalog != null) {
                xhrServletCommand = (Chain)catalog.getCommand(COMMAND_XHR);
            }

            if(xhrServletCommand != null) {
View Full Code Here

Examples of org.apache.beehive.netui.core.chain.CatalogFactory

        // Register the default URLRewriter
        URLRewriterService.registerURLRewriter(0, request, new DefaultURLRewriter());

        ServletContext ctxt = getServletContext();
        Command xhrServletCommand = null;
        CatalogFactory catalogFactory = CatalogFactory.getInstance();
        if(catalogFactory != null && catalogFactory.getCatalog() != null) {
            xhrServletCommand = catalogFactory.getCatalog().getCommand(COMMAND_XHR);
        }

        // execute the Command if found or the interceptors if found
        if(xhrServletCommand != null) {
            /* todo: add a chain to create the Context object */
 
View Full Code Here

Examples of org.apache.commons.chain.CatalogFactory

     *
     * @param context The Context we are processing
     * @return The Command to process for this Context
     */
    protected Command getCommand(Context context) {
        CatalogFactory catalogFactory = CatalogFactory.getInstance();
        String catalogName = getCatalogName();
        Catalog catalog;

        if (catalogName == null) {
            catalog = catalogFactory.getCatalog();
            catalogName = "{default}"; // for debugging purposes
        } else {
            catalog = catalogFactory.getCatalog(catalogName);
        }

        if (catalog == null) {
            throw new IllegalArgumentException("Cannot find catalog '"
                + catalogName + "'");
View Full Code Here

Examples of org.apache.commons.chain.CatalogFactory

    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {

        // Retrieve any current Catalog with the specified name
        Catalog catalog = null;
        CatalogFactory factory = CatalogFactory.getInstance();
        String nameValue = attributes.getValue(nameAttribute);
        if (nameValue == null) {
            catalog = factory.getCatalog();
        } else {
            catalog = factory.getCatalog(nameValue);
        }

        // Create and register a new Catalog instance if necessary
        if (catalog == null) {
            Class clazz = digester.getClassLoader().loadClass(catalogClass);
            catalog = (Catalog) clazz.newInstance();
            if (nameValue == null) {
                factory.setCatalog(catalog);
            } else {
                factory.addCatalog(nameValue, catalog);
            }
        }

        // Push this Catalog onto the top of the stack
        digester.push(catalog);
View Full Code Here

Examples of org.apache.commons.chain.CatalogFactory

     *  can be found and the <code>optional</code> property is set
     *  to <code>false</code>
     */
    private Command getCommand(Context context) {

        CatalogFactory catalogFactory = CatalogFactory.getInstance();
        String catalogName = getCatalogName();
        Catalog catalog = null;
        if (catalogName == null) {
            // use default catalog
            catalog = catalogFactory.getCatalog();
        } else {
            catalog = catalogFactory.getCatalog(catalogName);
        }
        if (catalog == null) {
            if (catalogName == null) {
                throw new IllegalArgumentException
                    ("Cannot find default catalog");
View Full Code Here

Examples of org.apache.commons.chain.CatalogFactory

     */
    public void service(HttpServletRequest request,
                        HttpServletResponse response)
        throws IOException, ServletException {
       
        CatalogFactory factory = CatalogFactory.getInstance();
        Catalog catalog = factory.getCatalog(servletName);
        if (catalog == null) {
            catalog = factory.getCatalog();
        }

        ServletWebContext context =
            new ServletWebContext(getServletContext(), request, response);
        Command command = catalog.getCommand("COMMAND_MAPPER");
View Full Code Here

Examples of org.apache.commons.chain.CatalogFactory

     *  can be found
     *
     * @since Chain 1.2
     */
    protected Catalog getCatalog(Context context) {
        CatalogFactory lookupFactory = this.catalogFactory;
        if (lookupFactory == null) {
            lookupFactory = CatalogFactory.getInstance();
        }

        String catalogName = getCatalogName();
        Catalog catalog = null;
        if (catalogName == null) {
            // use default catalog
            catalog = lookupFactory.getCatalog();
        } else {
            catalog = lookupFactory.getCatalog(catalogName);
        }
        if (catalog == null) {
            if (catalogName == null) {
                throw new IllegalArgumentException
                    ("Cannot find default catalog");
View Full Code Here

Examples of org.apache.commons.chain.CatalogFactory

    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {

        // Retrieve any current Catalog with the specified name
        Catalog catalog = null;
        CatalogFactory factory = CatalogFactory.getInstance();
        String nameValue = attributes.getValue(nameAttribute);
        if (nameValue == null) {
            catalog = factory.getCatalog();
        } else {
            catalog = factory.getCatalog(nameValue);
        }

        // Create and register a new Catalog instance if necessary
        if (catalog == null) {
            Class clazz = digester.getClassLoader().loadClass(catalogClass);
            catalog = (Catalog) clazz.newInstance();
            if (nameValue == null) {
                factory.setCatalog(catalog);
            } else {
                factory.addCatalog(nameValue, catalog);
            }
        }

        // Push this Catalog onto the top of the stack
        digester.push(catalog);
View Full Code Here

Examples of org.apache.commons.chain.CatalogFactory

    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {

        // Retrieve any current Catalog with the specified name
        Catalog catalog = null;
        CatalogFactory factory = CatalogFactory.getInstance();
        String nameValue = attributes.getValue(nameAttribute);
        if (nameValue == null) {
            catalog = factory.getCatalog();
        } else {
            catalog = factory.getCatalog(nameValue);
        }

        // Create and register a new Catalog instance if necessary
        if (catalog == null) {
            Class clazz = digester.getClassLoader().loadClass(catalogClass);
            catalog = (Catalog) clazz.newInstance();
            if (nameValue == null) {
                factory.setCatalog(catalog);
            } else {
                factory.addCatalog(nameValue, catalog);
            }
        }

        // Push this Catalog onto the top of the stack
        digester.push(catalog);
View Full Code Here

Examples of org.apache.commons.chain.CatalogFactory

     * @exception IllegalArgumentException if no such {@link Command}
     *  can be found and the <code>optional</code> property is set
     *  to <code>false</code>
     */
    protected Command getCommand(Context context) {
        CatalogFactory lookupFactory = this.catalogFactory;
        if (lookupFactory == null) {
            lookupFactory = CatalogFactory.getInstance();
        }

        String catalogName = getCatalogName();
        Catalog catalog = null;
        if (catalogName == null) {
            // use default catalog
            catalog = lookupFactory.getCatalog();
        } else {
            catalog = lookupFactory.getCatalog(catalogName);
        }
        if (catalog == null) {
            if (catalogName == null) {
                throw new IllegalArgumentException
                    ("Cannot find default catalog");
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.