Browse files

Merge pull request #28 from cfrockstar/develop

Railo Mongo Factory to load jars without Javaloader or requiring them to...
  • Loading branch information...
2 parents 846b320 + c619d52 commit 6061a06b4c4eba78230558efb41de6c690c73873 @marcesher committed Jul 31, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 core/RailoFactory.cfc
View
16 core/RailoFactory.cfc
@@ -0,0 +1,16 @@
+<cfcomponent output="false" extends="AbstractFactory" hint="Uses Railo's createObject('java', path, jarPaths) to create Java objects.">
+
+ <cffunction name="init" output="false" access="public" returntype="any" hint="">
+ <cfscript>
+ variables.jarPaths = directoryList( expandPath("/cfmongodb/lib"), false, "path", "*.jar" );
+ return super.init();
+ </cfscript>
+ </cffunction>
+
+ <cffunction name="getObject" output="false" access="public" returntype="any" hint="Creates a Java object">
+ <cfargument name="path" type="string" required="true">
+ <cfset var result = createObject("java", path, arraytolist(variables.jarPaths))>
+ <cfreturn result>
+ </cffunction>
+
+</cfcomponent>

0 comments on commit 6061a06

Please sign in to comment.