How do I access CFCProxy in Lucee?

I want to use CFCProxy to make calls into CF from a Java class. In the
examples I’ve seen I need import the CFCProxy class into my java class as
follows:

import coldfusion.cfc.CFCProxy;

First question… is CFCProxy implemented? If so, how do I tell my Java
compiler where it is?

To anyone looking to build a java class that uses the CFCProxy, here’s what
I figured out:

Add the lucee.jar to your classpath when compiling your class (for me
it’s C:/lucee/lib/lucee.jar)

In your yourclass.java, add:

import coldfusion.cfc.CFCProxy;

Create an instance of your CFC:

cfcConnector = new CFCProxy(cfcPath, true); //cfcPath needs to be absolute

Then to call the onMessage() method in your CFC:

Object args = { “my message” };
cfcConnector.invoke(“onMessage”, args); // call the method “onMessage”
defined in your CFCOn Thursday, September 22, 2016 at 4:49:56 PM UTC-6, JP wrote:

I want to use CFCProxy to make calls into CF from a Java class. In the
examples I’ve seen I need import the CFCProxy class into my java class as
follows:

import coldfusion.cfc.CFCProxy;

First question… is CFCProxy implemented? If so, how do I tell my Java
compiler where it is?

Hey John,

You can also create a CFC like this:

 CFMLEngine engine = CFMLEngineFactory.getInstance();
 Creation creationUtil = engine.getCreationUtil();
 PageContext pageContext = engine.getThreadPageContext();
 Component cfc = creationUtil.createComponentFromName(pageContext, 

“package.ComponentName”);

See
http://docs.lucee.org/guides/working-with-source/java-using-lucee-in-java.html
for more.

Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/On 9/23/2016 2:39 PM, JP wrote:

To anyone looking to build a java class that uses the CFCProxy, here’s
what I figured out:

Add the lucee.jar to your classpath when compiling your class (for me
it’s C:/lucee/lib/lucee.jar)

In your yourclass.java, add:

|
importcoldfusion.cfc.CFCProxy;
|

Create an instance of your CFC:

|
cfcConnector =newCFCProxy(cfcPath,true);//cfcPath needs to be absolute
|

Then to call the onMessage() method in your CFC:

|
Objectargs ={“my message”};
cfcConnector.invoke(“onMessage”,args);// call the method “onMessage”
defined in your CFC
|

On Thursday, September 22, 2016 at 4:49:56 PM UTC-6, JP wrote:

I want to use CFCProxy to make calls into CF from a Java class. In
the examples I've seen I need import the CFCProxy class into my
java class as follows:

|
importcoldfusion.cfc.CFCProxy;
|

First question... is CFCProxy implemented? If so, how do I tell my
Java compiler where it is?


Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp.
189€ instead of 210€. Visit
https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+unsubscribe@googlegroups.com
mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com
mailto:lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/71e7fe7b-705e-4a96-a0d0-3f4182f2cb0b%40googlegroups.com
https://groups.google.com/d/msgid/lucee/71e7fe7b-705e-4a96-a0d0-3f4182f2cb0b%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.

John,

I wrote that document originally years ago, back in the Railo days.
Micha added to it some recent, Lucee-5 stuff. The PageContext in the
example is not linked to the correct Application, so it does not give
you the correct session.

Lucee is made of two parts: Loader and Core. Loader provides an API,
while Core is “use-at-your-own-risk” private implementations. To run
the code examples, you need to have the Lucee Loader, which is exposed
via the Lucee.jar in your classpath.

In general we would love to see more Java users’ involvement and/or
contributions, so it’d be great if you can update whatever errors you
find in the Wiki.

I’m considering working on a Websocket implementation for Lucee,
possibly as an extension, but am still collecting information as to how
it would be best used. I also need to discuss this with Micha and
others before we implement anything.

Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/On 9/28/2016 1:47 PM, JP wrote:

@Igal, will that give me the current session, etc?

Btw, I would love to see some working code examples from that page you
referenced
(http://docs.lucee.org/guides/working-with-source/java-using-lucee-in-java.html
http://docs.lucee.org/guides/working-with-source/java-using-lucee-in-java.html).
I’ve played around with some of those code examples, and it was
challenging to find all the import classes that are needed. As someone
who knows just enough about Java to compile and build, and write some
basic code, it’s not clear which libraries are needed and it took me
several hours just to get my code to compile.

On Thursday, September 22, 2016 at 4:49:56 PM UTC-6, JP wrote:

I want to use CFCProxy to make calls into CF from a Java class. In
the examples I've seen I need import the CFCProxy class into my
java class as follows:

|
importcoldfusion.cfc.CFCProxy;
|

First question... is CFCProxy implemented? If so, how do I tell my
Java compiler where it is?


Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp.
189€ instead of 210€. Visit
https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+unsubscribe@googlegroups.com
mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com
mailto:lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/8a7ba7a9-efc5-4ae2-9d5b-eab7ef46c342%40googlegroups.com
https://groups.google.com/d/msgid/lucee/8a7ba7a9-efc5-4ae2-9d5b-eab7ef46c342%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.

@Igal, will that give me the current session, etc?

Btw, I would love to see some working code examples from that page you
referenced (
http://docs.lucee.org/guides/working-with-source/java-using-lucee-in-java.html).
I’ve played around with some of those code examples, and it was challenging
to find all the import classes that are needed. As someone who knows just
enough about Java to compile and build, and write some basic code, it’s not
clear which libraries are needed and it took me several hours just to get
my code to compile.On Thursday, September 22, 2016 at 4:49:56 PM UTC-6, JP wrote:

I want to use CFCProxy to make calls into CF from a Java class. In the
examples I’ve seen I need import the CFCProxy class into my java class as
follows:

import coldfusion.cfc.CFCProxy;

First question… is CFCProxy implemented? If so, how do I tell my Java
compiler where it is?

Might be worth looking at this ??

Mark Drew

  • Sent by typing with my thumbs.> On 28 Sep 2016, at 22:47, Igal @ Lucee.org <@Igal> wrote:

John,

I wrote that document originally years ago, back in the Railo days. Micha added to it some recent, Lucee-5 stuff. The PageContext in the example is not linked to the correct Application, so it does not give you the correct session.

Lucee is made of two parts: Loader and Core. Loader provides an API, while Core is “use-at-your-own-risk” private implementations. To run the code examples, you need to have the Lucee Loader, which is exposed via the Lucee.jar in your classpath.
In general we would love to see more Java users’ involvement and/or contributions, so it’d be great if you can update whatever errors you find in the Wiki.
I’m considering working on a Websocket implementation for Lucee, possibly as an extension, but am still collecting information as to how it would be best used. I also need to discuss this with Micha and others before we implement anything.

Igal Sapir
Lucee Core Developer
Lucee.org

On 9/28/2016 1:47 PM, JP wrote:
@Igal, will that give me the current session, etc?

Btw, I would love to see some working code examples from that page you referenced (http://docs.lucee.org/guides/working-with-source/java-using-lucee-in-java.html). I’ve played around with some of those code examples, and it was challenging to find all the import classes that are needed. As someone who knows just enough about Java to compile and build, and write some basic code, it’s not clear which libraries are needed and it took me several hours just to get my code to compile.

On Thursday, September 22, 2016 at 4:49:56 PM UTC-6, JP wrote:
I want to use CFCProxy to make calls into CF from a Java class. In the examples I’ve seen I need import the CFCProxy class into my java class as follows:

import coldfusion.cfc.CFCProxy;

First question… is CFCProxy implemented? If so, how do I tell my Java compiler where it is?

Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp


You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/8a7ba7a9-efc5-4ae2-9d5b-eab7ef46c342%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/e2ac8ea7-8bdb-850a-4d3f-d33b9d8818ee%40lucee.org.
For more options, visit https://groups.google.com/d/optout.

I was hoping to use cfcproxy to call into my app from within a Java websocket wrapper. That reference page you wrote could be really cool if it included links to working sample code or some sort of SDK would be a great place to start. I don’t consider myself a Java developer, but I’m definitely interested in getting more fluent so that I could extend my Lucee apps.

Lucee really needs a websocket solution badly. I hope a solution can be built soon!