I'm not sure of the performance of this but I got this to work using this code:

Object getfile =
oFileManager.getInstance().getClass().getMethod("getFile",String.class).invoke(oFileManager.getInstance(),
"1");
cfJavaObjectData oFile = (cfJavaObjectData) new cfJavaObjectData(getfile);

My java experience is short, I would really appreciate feedback on this if any.
Thanks.

On Sat, Jun 13, 2009 at 7:17 PM, atomi<[email protected]> wrote:
>
> I'm having a lot of fun using OpenBD plugins. They're fast and easy to
> write :)
>
> I'm almost done with my first set of plugins and I'd love for someone
> to review them.
> But first, I have a question about the possibility of calling a method
> belonging to a cfJavaObjectData.
> Here is an example of what I'm doing:
>
> ObjectCFC beanFactory = PluginManager.getPlugInManager().createCFC
> (_session, _session.getApplicationData().getData("beanFactory"));
> beanFactory.addArgument("OBJECTNAME", "FileManager");
> cfJavaObjectData oFileManager = (cfJavaObjectData)
> beanFactory.runMethod(_session, "getSingleton");
>
> _session.getQualifiedData( variableStore.VARIABLES_SCOPE ).setData
> ("FileManager",oFileManager);
>
> So, I've got a FileManager object that is working as expected and is
> set into the variables scope.
> This FileManager has a method called getFile(). What I'd like to do is
> call this getFile() method
> and cast the object returned by this method to cfJavaObjectData as
> well.
>
> What I've been able to do is this:
>
> com.simpleposting.FileManager filemanager = new
> com.simpleposting.FileManager();
> cfJavaObjectData userfile = new cfJavaObjectData(filemanager.getFile
> ("1"));
> _session.getQualifiedData( variableStore.VARIABLES_SCOPE ).setData
> ("file",userfile);
>
> What I'd like to do though is instead use (cfJavaObjectData)
> oFileManager to call getFile()
> Is this possible from within an openbd plugin function ?
> >
>

--~--~---------~--~----~------------~-------~--~----~
Open BlueDragon Public Mailing List
 http://groups.google.com/group/openbd?hl=en
 official site @ http://www.openbluedragon.org/

!! save a network - trim replies before posting !!
-~----------~----~----~----~------~----~------~--~---

Reply via email to