it.uniroma3.plasm.core
Class Plasm

java.lang.Object
  extended byit.uniroma3.plasm.core.Plasm

public class Plasm
extends java.lang.Object

Class encapsulating the Plasm Process.

Version:
$Id: Plasm.java,v 1.8 2004/07/27 06:57:01 giupo Exp $
Author:
giupo

Field Summary
static byte[] EXIT
          EXIT command for Plasm
static java.lang.String NAME
           
static byte[] POSTFIX
          Postfix in the evaluation statement.
static byte[] PREFIX
          Prefix in the evaluation statement (schema stuff...)
 
Method Summary
 void close()
          Ugly doodly doo, what this method is gonna do?
 void eval(java.lang.String code)
          AHCM (Another Hard comprehension method) this method evaluates the string passed as argument to the running plasm process NOTE: this method DOESN'T provide anysort of syntax evaluation...this is done from the underlying Plasm process.
static Plasm getInstance()
          method to retrieve the actual instance in the JVM See the Singleton Pattern
 java.lang.String getPlasmPath()
           
 java.io.InputStream getPlasmStandardOutput()
           
 boolean isActive()
          Is this process active?
 void open()
          It opens, actually runs the plasm process and it connects the various streams to the crawling process.
 void setPlasmPath(java.lang.String plasmPath)
          Sets the plasm path NEEDED to run Plasm (as it takes it takes it as a parameter...)
 void setStreamListener(org.eclipse.debug.core.IStreamListener listener)
          Set a stream listener for this Plasm Process.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX

public static final byte[] PREFIX
Prefix in the evaluation statement (schema stuff...)


POSTFIX

public static final byte[] POSTFIX
Postfix in the evaluation statement. (Pretty dumb constant)


EXIT

public static final byte[] EXIT
EXIT command for Plasm


NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Method Detail

getInstance

public static Plasm getInstance()
method to retrieve the actual instance in the JVM See the Singleton Pattern


open

public void open()
          throws java.io.IOException
It opens, actually runs the plasm process and it connects the various streams to the crawling process.

Throws:
java.io.IOException - when it's impossible to communicate with the process.

close

public void close()
           throws java.io.IOException
Ugly doodly doo, what this method is gonna do?

Throws:
java.lang.IOException - when somethings goes wrong closing all the streams (because this is what this method does, if it's not straightforward to your eyes...
java.io.IOException

eval

public void eval(java.lang.String code)
          throws java.io.IOException
AHCM (Another Hard comprehension method) this method evaluates the string passed as argument to the running plasm process NOTE: this method DOESN'T provide anysort of syntax evaluation...this is done from the underlying Plasm process.

Parameters:
code - the string containing the Plasm statements
Throws:
java.io.IOException - when something odd (like broken communications) occurs.

isActive

public boolean isActive()
Is this process active?

Returns:
Returns the active.

getPlasmPath

public java.lang.String getPlasmPath()
Returns:
Returns the plasmPath.

setPlasmPath

public void setPlasmPath(java.lang.String plasmPath)
Sets the plasm path NEEDED to run Plasm (as it takes it takes it as a parameter...)

Parameters:
plasmPath - The plasmPath to set.

getPlasmStandardOutput

public java.io.InputStream getPlasmStandardOutput()

setStreamListener

public void setStreamListener(org.eclipse.debug.core.IStreamListener listener)
                       throws java.io.IOException
Set a stream listener for this Plasm Process. I can have only ONE listener

Parameters:
listener -
Throws:
java.io.IOException - Thrown if plasm is not active