org.exoplatform.services.jcr.ext.script.groovy
Class GroovyScript2RestLoader

java.lang.Object
  extended by org.exoplatform.services.jcr.ext.script.groovy.GroovyScript2RestLoader
All Implemented Interfaces:
org.picocontainer.Startable

public class GroovyScript2RestLoader
extends java.lang.Object
implements org.picocontainer.Startable

Version:
$Id: GroovyScript2RestLoader.java 35186 2009-08-07 14:23:43Z pnedonosko $
Author:
Andrey Parfonov

Nested Class Summary
static class GroovyScript2RestLoader.ObservationListenerConfiguration
           
 
Field Summary
static java.lang.String DEFAULT_NODETYPE
           
 
Constructor Summary
GroovyScript2RestLoader(org.exoplatform.services.rest.ResourceBinder binder, org.exoplatform.services.script.groovy.GroovyScriptInstantiator groovyScriptInstantiator, Handler handler, RepositoryService repositoryService, org.exoplatform.container.xml.InitParams params)
           
GroovyScript2RestLoader(org.exoplatform.services.rest.ResourceBinder binder, org.exoplatform.services.script.groovy.GroovyScriptInstantiator groovyScriptInstantiator, Handler handler, RepositoryService repositoryService, RegistryService registryService, org.exoplatform.container.xml.InitParams params)
           
 
Method Summary
 void loadScript(java.lang.String key, java.io.InputStream stream)
          Load script from given stream.
 void loadScript(java.net.URL url)
           
 void start()
           
 void stop()
           
 void unloadScript(java.lang.String key)
          Remove script by specified key from ResourceBinder.
 void unloadScript(java.net.URL url)
          Remove script with specified URL from ResourceBinder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NODETYPE

public static final java.lang.String DEFAULT_NODETYPE
See Also:
Constant Field Values
Constructor Detail

GroovyScript2RestLoader

public GroovyScript2RestLoader(org.exoplatform.services.rest.ResourceBinder binder,
                               org.exoplatform.services.script.groovy.GroovyScriptInstantiator groovyScriptInstantiator,
                               Handler handler,
                               RepositoryService repositoryService,
                               org.exoplatform.container.xml.InitParams params)

GroovyScript2RestLoader

public GroovyScript2RestLoader(org.exoplatform.services.rest.ResourceBinder binder,
                               org.exoplatform.services.script.groovy.GroovyScriptInstantiator groovyScriptInstantiator,
                               Handler handler,
                               RepositoryService repositoryService,
                               RegistryService registryService,
                               org.exoplatform.container.xml.InitParams params)
Method Detail

unloadScript

public void unloadScript(java.net.URL url)
Remove script with specified URL from ResourceBinder.

Parameters:
url - the URL. The url.toString() must be corresponded to script class name, otherwise IllegalArgumentException will be thrown.
See Also:
GroovyScriptRestLoader#loadScript(URL)., loadScript(String, InputStream)

unloadScript

public void unloadScript(java.lang.String key)
Remove script by specified key from ResourceBinder.

Parameters:
key - the key with which script was created.
See Also:
GroovyScriptRestLoader#loadScript(URL)., loadScript(String, InputStream)

loadScript

public void loadScript(java.net.URL url)
                throws org.exoplatform.services.rest.container.InvalidResourceDescriptorException,
                       java.io.IOException
Parameters:
url - the RUL for loading script.
Throws:
org.exoplatform.services.rest.container.InvalidResourceDescriptorException - if loaded object is not valid ResourceContainer.
java.io.IOException - it script can't be loaded.

loadScript

public void loadScript(java.lang.String key,
                       java.io.InputStream stream)
                throws org.exoplatform.services.rest.container.InvalidResourceDescriptorException,
                       java.io.IOException
Load script from given stream.

Parameters:
key - the key which must be corresponded to object class name.
stream - the stream which represents grrovy script.
Throws:
org.exoplatform.services.rest.container.InvalidResourceDescriptorException - if loaded Object can't be added in ResourceBinder.
java.io.IOException - if script can't be loaded or parsed.
See Also:
ResourceBinder.bind(ResourceContainer)

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable


Copyright © 2010 eXo Platform SAS. All Rights Reserved.