An implementation of the Chain of Responsibility pattern that chains {@link Command}s together.
56575859606162636465666768697071727374757677787980818283848586
{ ServletContext ctxt = getServletContext(); /* Initialize the Command chain and add the ErrorCRI */ Chain xhrServletCommand = null; CatalogConfig catalogConfig = ConfigUtil.getConfig().getCatalogConfig(); if(catalogConfig != null) { /* 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) { xhrServletCommand.addCommand(new ErrorCRI()); } } /* For compatibility, add the ErrorCRI to the list of global Interceptors only if the