public class JcrGroovyCompiler extends Object implements org.picocontainer.Startable
| Modifier and Type | Field and Description |
|---|---|
protected List<GroovyScriptAddRepoPlugin> |
addRepoPlugins |
protected JcrGroovyClassLoaderProvider |
classLoaderProvider |
| Constructor and Description |
|---|
JcrGroovyCompiler() |
JcrGroovyCompiler(JcrGroovyClassLoaderProvider classLoaderProvider) |
| Modifier and Type | Method and Description |
|---|---|
Class<?>[] |
compile(org.exoplatform.services.rest.ext.groovy.SourceFile[] files)
Compile Groovy source that located in
files. |
Class<?>[] |
compile(org.exoplatform.services.rest.ext.groovy.SourceFolder[] src,
org.exoplatform.services.rest.ext.groovy.SourceFile[] files)
Compile Groovy source that located in
files. |
Class<?>[] |
compile(org.exoplatform.services.rest.ext.groovy.SourceFolder[] src,
UnifiedNodeReference... sourceReferences)
Compile Groovy source that located in
sourceReferences. |
Class<?>[] |
compile(UnifiedNodeReference... sourceReferences)
Compile Groovy source that located in
sourceReferences. |
URL[] |
getDependencies(org.exoplatform.services.rest.ext.groovy.SourceFolder[] sources,
org.exoplatform.services.rest.ext.groovy.SourceFile[] files)
Get URLs of classes (stored in JCR only) required to compile sources
files. |
void |
start() |
void |
stop() |
protected final JcrGroovyClassLoaderProvider classLoaderProvider
protected List<GroovyScriptAddRepoPlugin> addRepoPlugins
public JcrGroovyCompiler(JcrGroovyClassLoaderProvider classLoaderProvider)
public JcrGroovyCompiler()
public Class<?>[] compile(UnifiedNodeReference... sourceReferences) throws IOException
sourceReferences.
Compiled sources can be dependent to each other and dependent to Groovy
sources that are accessible for this compiler.sourceReferences - references to Groovy sources to be compiledIOException - if any i/o errors occurspublic Class<?>[] compile(org.exoplatform.services.rest.ext.groovy.SourceFolder[] src, UnifiedNodeReference... sourceReferences) throws IOException
sourceReferences.
Compiled sources can be dependent to each other and dependent to Groovy
sources that are accessible for this compiler and with additional Groovy
sources src. NOTE To be able load Groovy source files
from specified folders the following rules must be observed:
package c.b.a
import a.b.c.A
class B extends A {
// Do something.
}
Assume we store dependencies in JCR then URL of folder with Groovy sources
may be like this: jcr://repository/workspace#/groovy-library.
Then absolute path to JCR node that contains Groovy source must be as
following: /groovy-library/a/b/c/A.groovysrc - additional Groovy source location that should be added in
class-path when compile sourceReferencessourceReferences - references to Groovy sources to be compiledIOException - if any i/o errors occurspublic Class<?>[] compile(org.exoplatform.services.rest.ext.groovy.SourceFolder[] src, org.exoplatform.services.rest.ext.groovy.SourceFile[] files) throws IOException
files. Compiled sources
can be dependent to each other and dependent to Groovy sources that are
accessible for this compiler and with additional Groovy sources
src. NOTE To be able load Groovy source files from
specified folders the following rules must be observed:
src - additional Groovy source location that should be added in
class-path when compile filesfiles - Groovy sources to be compiledIOException - if any i/o errors occurspublic Class<?>[] compile(org.exoplatform.services.rest.ext.groovy.SourceFile[] files) throws IOException
files. Compiled sources
can be dependent to each other and dependent to Groovy sources that are
accessible for this compiler.files - Groovy sources to be compiledIOException - if any i/o errors occurspublic URL[] getDependencies(org.exoplatform.services.rest.ext.groovy.SourceFolder[] sources, org.exoplatform.services.rest.ext.groovy.SourceFile[] files) throws IOException
files. Result array includes URLs of files plus
URLs of other required sources if they can be found in class-path.sources - additional Groovy source location that should be added in
class-path when analyze filesfiles - set of sources for analyzingIOException - if any i/o errors occurspublic void start()
start in interface org.picocontainer.StartableStartable.start()public void stop()
stop in interface org.picocontainer.StartableStartable.stop()Copyright © 2003–2021 eXo Platform SAS. All rights reserved.