public Value generate(Value scm, Value senv, Value sargs)
throws Exception
{
SchemeSitemap sitemap = schemeSitemap(scm);
StreamPipeline pipeline = sitemap.getStreamPipeline();
EventPipeline eventPipeline = pipeline.getEventPipeline();
// Obtain the 'src' attribute
Value ssrc = assq(sargs, Symbol.get("src"));
if (ssrc.eq(FALSE))
throw new RuntimeException("No 'src' attribute specified for 'generate'!");
String src = string(pair(ssrc).cdr);
// Obtain the 'type' attribute
Value stype = assq(sargs, Symbol.get("type"));
String type;
if (!stype.eq(FALSE))
type = string(pair(stype).cdr);
else
type = sitemap.getDefaultGeneratorType();
// Obtain the parameters
Value sparams = assq(sargs, Symbol.get("params"));
Parameters params = getParameters(sparams);
// System.out.println("generate type " + type + ", src " + src
// + " params " + params);
eventPipeline.setGenerator(type, src, params);
return new J2S.JavaObject(pipeline);
}