* to the DWR engine.js to define the Tuscany SCADomain control functions and
* functions for each SCA service and reference that use <binding.dwr>.
*/
protected void addScriptHandler() {
UrlProcessor urlProcessor = (UrlProcessor)getContainer().getBean(UrlProcessor.class.getName());
final EngineHandler engineHandler =
(EngineHandler)getContainer().getBean(PathConstants.URL_PREFIX + "/engine.js");
final Handler scaDomainScriptHandler = new Handler() {
public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter out = response.getWriter();
out.println("/** Apache Tuscany scaDomain.js Header */");
engineHandler.handle(request, response);
tuscanyFooter(request, out);
}
};
// add the scaDomainScriptHandler to the urlProcessor
// bit of a hack, there's probably cleaner way to get it registered
urlProcessor.afterContainerSetup(new Container() {
public Object getBean(String name) {
return scaDomainScriptHandler;
}
public Collection getBeanNames() {
return Arrays.asList(new String[] {PathConstants.URL_PREFIX + SCADOMAIN_SCRIPT_PATH});