org.planx.xmlstore.stores
Class ExecuteXMLStore<R extends Reference>

java.lang.Object
  extended by org.planx.xmlstore.stores.AbstractXMLStore<R>
      extended by org.planx.xmlstore.stores.ExecuteXMLStore<R>
All Implemented Interfaces:
ExecXMLStore<R>, XMLStore<R>

public class ExecuteXMLStore<R extends Reference>
extends AbstractXMLStore<R>
implements ExecXMLStore<R>

An implementation of ExecXMLStore that simply loads code and arguments from the decorated XMLStore and uses the system class loader to turn the binary node into a Java class.

Author:
Omar Sharif, Mustafa Temiz, Henning Niss

Constructor Summary
ExecuteXMLStore(XMLStore<R> xmlstore)
           
ExecuteXMLStore(XMLStore<R> xmlstore, ClassLoader cl)
           
 
Method Summary
 R exec(R codeRef, R argsRef)
          Execute the code referenced by codeRef supplied with the argument reference by argsRef.
 
Methods inherited from class org.planx.xmlstore.stores.AbstractXMLStore
close, getNameServer, load, save, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.planx.xmlstore.XMLStore
close, getNameServer, load, save
 

Constructor Detail

ExecuteXMLStore

public ExecuteXMLStore(XMLStore<R> xmlstore)

ExecuteXMLStore

public ExecuteXMLStore(XMLStore<R> xmlstore,
                       ClassLoader cl)
Method Detail

exec

public R exec(R codeRef,
              R argsRef)
                         throws IOException,
                                ExecException
Execute the code referenced by codeRef supplied with the argument reference by argsRef. Returns a reference to the result of the execution.

TODO: Any classes on which the code referenced by codeRef depends, should have already been made available to the JVM before starting the XML Store.

Specified by:
exec in interface ExecXMLStore<R extends Reference>
Parameters:
codeRef - the Reference to a binary node containing class code implementing StoredCode
argsRef - reference to arguments
Returns:
a reference to the result
Throws:
IOException - if an error occurs during loading of code or arguments
ExecException


Copyright © 2004-2005 Plan-X. All Rights Reserved.