ColdBox Platform v3.8.0

coldbox.system.plugins
Class JavaLoader

WEB-INF.cftags.component
        extended by coldbox.system.FrameworkSupertype
            extended by coldbox.system.Plugin
                extended by coldbox.system.plugins.JavaLoader

public class JavaLoader
extends Plugin

Loads External Java Classes, while providing access to ColdFusion classes

Constructor Summary
init(any controller)
          Constructor
 
Method Summary
 void appendPaths(string dirPath='', [string filter='*.jar'])
          Appends a directory path of *
 any create(string className)
          Retrieves a reference to the java class
 any getJavaLoader()
          Get the original JavaLoader object
private any getJavaLoaderFromScope()
          Get the javaloader from server scope
 array getLoadedURLs()
          Returns the paths of all the loaded java classes and resources
 string getStaticIDKey()
          Return the original server id static key
 any getURLClassLoader()
          Returns the java
 string getVersion()
          Retrieves the version of the loader you are using
private boolean isJavaLoaderInScope()
          Checks if the javaloader has been loaded into server scope
 array queryJars(string dirPath, [string filter='*.jar'])
          pulls a query of all the jars in the folder passed
private any setJavaLoaderInScope(JavaLoader javaloader)
          Set the javaloader in server scope
 void setStaticIDKey(string staticIDKey)
          override the static server key for this javaloader instance
 any setup([array loadPaths='[runtime expression]'], [boolean loadColdFusionClassPath='false'], [any parentClassLoader=''])
          Setup the URL loader with paths to load and how to treat class loaders
 
Methods inherited from class coldbox.system.Plugin
getPluginDescription, getPluginName, getPluginVersion, getRequestCollection, getRequestContext, getpluginAuthor, getpluginAuthorURL, getpluginPath, setPluginDescription, setPluginName, setPluginVersion, setpluginAuthor, setpluginAuthorURL
 
Methods inherited from class coldbox.system.FrameworkSupertype
$abort, $dump, $htmlhead, $include, $rethrow, $throw, addAsset, announceInterception, getColdboxOCM, getController, getDatasource, getDebugMode, getInterceptor, getMailService, getMailSettings, getMemento, getModel, getModuleSettings, getMyPlugin, getNewMail, getPlugin, getResource, getSetting, getSettingStructure, getSettingsBean, getValidationManager, getfwLocale, includeUDF, loadGlobalUDFLibraries, locateDirectoryPath, locateFilePath, persistVariables, populateModel, relocate, renderExternalView, renderLayout, renderView, runEvent, setDebugMode, setNextEvent, setNextRoute, setSetting, setfwLocale, settingExists, validateModel
 
Methods inherited from class WEB-INF.cftags.component
None
 

Constructor Detail

init

public init(any controller)
Constructor

Parameters:
controller - coldbox.system.web.Controller
Method Detail

appendPaths

public void appendPaths(string dirPath='', [string filter='*.jar'])
Appends a directory path of *.jar's,*.classes to the current loaded class loader.

Parameters:
dirPath - The directory path to query
filter - The directory filter to use

create

public any create(string className)
Retrieves a reference to the java class. To create a instance, you must run init() on this object

Parameters:
className - The name of the class to create

getJavaLoader

public any getJavaLoader()
Get the original JavaLoader object


getJavaLoaderFromScope

private any getJavaLoaderFromScope()
Get the javaloader from server scope


getLoadedURLs

public array getLoadedURLs()
Returns the paths of all the loaded java classes and resources.


getStaticIDKey

public string getStaticIDKey()
Return the original server id static key


getURLClassLoader

public any getURLClassLoader()
Returns the java.net.URLClassLoader in case you need access to it


getVersion

public string getVersion()
Retrieves the version of the loader you are using


isJavaLoaderInScope

private boolean isJavaLoaderInScope()
Checks if the javaloader has been loaded into server scope


queryJars

public array queryJars(string dirPath, [string filter='*.jar'])
pulls a query of all the jars in the folder passed

Parameters:
dirPath - The directory path to query
filter - The directory filter to use

setJavaLoaderInScope

private any setJavaLoaderInScope(JavaLoader javaloader)
Set the javaloader in server scope

Parameters:
javaloader - The javaloader instance to scope

setStaticIDKey

public void setStaticIDKey(string staticIDKey)
override the static server key for this javaloader instance.

Parameters:
staticIDKey

setup

public any setup([array loadPaths='[runtime expression]'], [boolean loadColdFusionClassPath='false'], [any parentClassLoader=''])
Setup the URL loader with paths to load and how to treat class loaders

Parameters:
loadPaths - An array of directories of classes, or paths to .jar files to load
loadColdFusionClassPath - Loads the ColdFusion libraries
parentClassLoader - (Expert use only) The parent java.lang.ClassLoader to set when creating the URLClassLoader

ColdBox Platform v3.8.0