Page MenuHomePhorge

Script.java
No OneTemporary

Script.java

/*
* Copyright (C) 2013-2015 Lannocc Technologies
* @%@~LICENSE~@%@
*/
package com.iovar.web.bin.shell.task;
// local imports:
import com.iovar.web.dev.*;
import com.iovar.web.proc.*;
// java imports:
import java.io.*;
import javax.servlet.*;
// 3rd-party imports:
/**
* An optional named interpreter followed by group of operations.
* Empty input will not assemble.
*
* @author shawn@lannocc.com
*/
public class Script implements Graph, Task
{
HashBang interpreter;
Group ops;
public boolean assemble (final GraphReader in) throws IOException, GraphException
{
interpreter = new HashBang ();
if (! interpreter.assemble (in))
{
interpreter = null;
}
Log.debug ("hashbang: "+interpreter);
if (interpreter != null) Log.info ("interpreter: "+interpreter.getVal());
ops = new Group ();
if (! ops.assemble (in))
{
Log.debug ("no group assembly");
return false;
}
return true;
}
/*
public HashBang getInterpreter ()
{
return interpreter;
}
*/
/*
* this is shell exec only: the calling party is responsible for invoking any other interpreter
*/
public Return exec (final TaskData task) throws IOException, ServletException
{
return ops.exec (task);
}
public String toString ()
{
return super.toString ()+": interpreter="+interpreter+", { "+ops+" }";
}
}

File Metadata

Mime Type
text/x-java
Expires
Wed, Sep 16, 7:47 AM (2 w, 11 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3696
Default Alt Text
Script.java (1 KB)

Event Timeline