Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ensembl.registry
Class RegistryLoaderJython

    java.lang.Object
      org.ensembl.registry.RegistryLoaderJython

All Implemented Interfaces:
  RegistryLoader

public class RegistryLoaderJython
extends java.lang.Object
implements RegistryLoader

Runs a jython script that can load DriverGroups into a registry. TODO describe how to create jython script. TODO implement script support (this is a stub class at moment). TODO validate script in constructors? TODO investigate security implications of allowing user to run arbitrary script! Jython script can be used as glue to load registry based on data from ANY datasource. Requires including jython.jar in the CLASSPATH. Errors in the script are detected at runtime when load(..) is called.

Author:
  Craig Melsopp

Constructor Summary
`RegistryLoaderJython(byte[] script, java.lang.String scriptDescription)` Loads the script stored in byte array.
`RegistryLoaderJython(java.io.InputStream config, java.lang.String configDescription)` Loads DriverGroups for configuration defined in _srcConfig_.
`RegistryLoaderJython(java.lang.String url)` Loads the script stored at _url_.
`RegistryLoaderJython(java.net.URL url)` Loads DriverGroups for configuration at _url_.

Method Summary
`void` | `load(Registry registry)` Runs the script with _registry_ available in the environment.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RegistryLoaderJython

    public RegistryLoaderJython(java.io.InputStream config,
                                java.lang.String configDescription)
                         throws ConfigurationException,
                                java.io.IOException

  Loads DriverGroups for configuration defined in _srcConfig_.

Parameters:
  `config` - configuration.
  `configDescription` - description of configuration.
Throws:
  `ConfigurationException`
  `java.io.IOException`

### RegistryLoaderJython

    public RegistryLoaderJython(byte[] script,
                                java.lang.String scriptDescription)
                         throws ConfigurationException,
                                java.io.IOException

  Loads the script stored in byte array. This can be used for loading configuration values from a a String like this: `new RegistryLoaderJython(string.getBytes(), "my script")`.

Parameters:
  `script` - jython script.
  `scriptDescription` - description of configuration.
Throws:
  `ConfigurationException`
  `java.io.IOException`

### RegistryLoaderJython

    public RegistryLoaderJython(java.lang.String url)
                         throws java.io.IOException

  Loads the script stored at _url_.

Parameters:
  `url` - url of script.
Throws:
  `java.io.IOException`

### RegistryLoaderJython

    public RegistryLoaderJython(java.net.URL url)
                         throws java.io.IOException

  Loads DriverGroups for configuration at _url_.

Parameters:
  `url` - url of configuration file.

Method Detail

### load

    public void load(Registry registry)

  Runs the script with _registry_ available in the environment.

  Specified by:
    `load` in interface `RegistryLoader`
  Parameters:
    `registry` - registry to load DriverGroups into.
  Throws:
    `org.python.core.PyException` - if there was a problem executing the script.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD