WEB-INF.cftags.component coldbox.system.core.javaloader.JavaLoader
Loads External Java Classes, while providing access to ColdFusion classes
Constructor Summary | |
---|---|
init([array loadPaths='[runtime expression]'], [boolean loadColdFusionClassPath='false'], [any parentClassLoader=''], [array sourceDirectories], [string compileDirectory='[runtime expression]'], [boolean trustedSource='false'])
Constructor. |
Method Summary | |
---|---|
private string
|
calculateJarName(array directoryArray)
returns the jar file name for a directory array. |
private date
|
calculateSourceLastModified()
returns what the source last modified was. |
private void
|
compileSource()
compile dynamic source. |
any
|
create(string className)
Retrieves a reference to the java class. |
private any
|
createJavaProxy(any class)
create a javaproxy, dependent on CF server settings. |
private any
|
createJavaProxyCFC(any class)
create a javaproxy, dependent on CF server settings. |
private any
|
createWithSourceCheck(string className)
does the create call, but first makes a source check. |
private any
|
directoryCopy(string source, string destination, any nameconflict='overwrite')
|
private void
|
ensureNetworkClassLoaderOnServerScope()
makes sure there is a URL class loader on the server scope that can load me up some networkClassLoader goodness. |
private array
|
getClassLoadPaths()
|
private string
|
getCompileDirectory()
|
private JavaCompiler
|
getJavaCompiler()
|
private any
|
getParentClassLoader()
|
private any
|
getServerURLClassLoader()
returns the server URL class loader. |
private array
|
getSourceDirectories()
|
private date
|
getSourceLastModified()
|
any
|
getURLClassLoader()
Returns the com. |
string
|
getVersion()
Retrieves the version of the loader you are using. |
private boolean
|
hasJavaCompiler()
whether this object has a javaCompiler. |
private boolean
|
hasSourceLastModified()
whether this object has a sourceLastModified. |
private string
|
initUseJavaProxyCFC()
initialise whether or not to use the JavaProxy CFC instead of the coldfusion java object. |
private boolean
|
isTrustedSource()
|
private void
|
loadClasses()
loads up the classes in the system. |
private array
|
queryJars()
pulls a query of all the jars in the /resources/lib folder. |
private void
|
setClassLoadPaths(array classLoadPaths)
|
private void
|
setCompileDirectory(string compileDirectory)
|
private void
|
setJavaCompiler(JavaCompiler javaCompiler)
|
private void
|
setParentClassLoader(any parentClassLoader)
|
private void
|
setSourceDirectories(array sourceDirectories)
|
private void
|
setSourceLastModified(date sourceLastModified)
|
private void
|
setTrustedSource(boolean isTrustedSource)
|
private void
|
setURLClassLoader(any ClassLoader)
|
private any
|
throwException(string type, string message, [string detail=''])
Throws an Exception. |
Methods inherited from class WEB-INF.cftags.component |
---|
None |
Constructor Detail |
---|
Constructor
loadPaths
- An array of directories of classes, or paths to .jar files to loadloadColdFusionClassPath
- Loads the ColdFusion librariesparentClassLoader
- (Expert use only) The parent java.lang.ClassLoader to set when creating the URLClassLoadersourceDirectories
- Directories that contain Java source code that are to be dynamically compiledcompileDirectory
- the directory to build the .jar file for dynamic compilation in, defaults to ./tmptrustedSource
- Whether or not the source is trusted, i.e. it is going to change? Defaults to false, so changes will be recompiled and loadedMethod Detail |
---|
returns the jar file name for a directory array
directoryArray
- array of directories to compilereturns what the source last modified was
compile dynamic source
Retrieves a reference to the java class. To create a instance, you must run init() on this object
className
- The name of the class to createcreate a javaproxy, dependent on CF server settings
class
- the java class to create the proxy withcreate a javaproxy, dependent on CF server settings
class
- the java class to create the proxy withdoes the create call, but first makes a source check
className
- The name of the class to createsource
destination
nameconflict
makes sure there is a URL class loader on the server scope that can load me up some networkClassLoader goodness
returns the server URL class loader
Returns the com.compoundtheory.classloader.NetworkClassLoader in case you need access to it
Retrieves the version of the loader you are using
whether this object has a javaCompiler
whether this object has a sourceLastModified
initialise whether or not to use the JavaProxy CFC instead of the coldfusion java object
loads up the classes in the system
pulls a query of all the jars in the /resources/lib folder
classLoadPaths
compileDirectory
javaCompiler
parentClassLoader
sourceDirectories
sourceLastModified
isTrustedSource
ClassLoader
Throws an Exception
type
- The type of exceptionmessage
- The message to accompany the exceptiondetail
- The detail message for the exception