tracker issue : CF-4010514

select a category, or use search below
(searches all categories and all time range)
Title:

Improve Java integration

| View in Tracker

Status/Resolution/Reason: To Fix//Investigate

Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)

Created: 06/22/2015

Components: Java Integration

Versions: 11.0

Failure Type: Enhancement Request

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Platforms All

Vote Count: 19

From http://blog.adamcameron.me/2015/06/what-id-like-to-see-in-coldfusion12.html

I should be able to use a Java class anywhere and in the same way I use a CFC now, eg:

s = new java.lang.String("Yeah, bad example I know");

I should be able to specify Java class types in function argument type and return types too.

I should be able to extend Java types in CFML. I should be able to implement Java interfaces with a CFC, and have be able to use these CFCs in Java method calls expecting the given parent class / interface.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4010514

External Customer Info:
External Company:  
External Customer Name: Adam
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Definitely agree with this one. We need to leverage as much as we can off Java.
Vote by External U.
7093 | June 29, 2015 03:11:13 AM GMT
+1..................................
Vote by External U.
7094 | June 29, 2015 04:28:22 AM GMT
I would really, truly, love this as a feature.
Vote by External U.
7095 | June 29, 2015 09:00:29 AM GMT
+1 anything that helps leverage core java constructs will make my job easier
Comment by External U.
7087 | June 29, 2015 10:22:50 AM GMT
Better Java interop has been promised for several releases so... get on it!
Vote by External U.
7096 | June 29, 2015 11:10:59 AM GMT
i would love to see java easier to use in cf language, i am all for this
Vote by External U.
7097 | June 29, 2015 03:15:50 PM GMT
+1 why wouldn't you do this? :)
Comment by External U.
7088 | June 30, 2015 02:30:25 AM GMT
+1 makes totally sense to do this - would be a great thing to have
Vote by External U.
7098 | June 30, 2015 05:00:40 AM GMT
Not only would I like the Java integration as described in this ticket, but also the ability to define via the CF Admin "...a pluggable cache architecture that allows you to write a Java adapter class that will connect to any underlying caching engine." (from https://www.ortussolutions.com/blog/couchbase-ortus-railo-extension). I should be able to use any cache engine I want - it happens to be Couchbase btw. These caches should be able to be used for session and/or client storage.
Vote by External U.
7099 | June 30, 2015 11:08:25 AM GMT
................................................................
Vote by External U.
7100 | July 01, 2015 02:53:07 AM GMT
+1. Better/easier Java integration is a good thing.
Vote by External U.
7101 | July 01, 2015 09:27:27 AM GMT
There is so much that Java can do very well, and all of it should be dead simple in ColdFusion.
Vote by External U.
7102 | July 01, 2015 02:13:48 PM GMT
So many times I've said, "It's right there, why is it so hard?"
Comment by External U.
7089 | July 02, 2015 12:57:52 PM GMT
+1 ---------------------------
Vote by External U.
7103 | July 02, 2015 01:35:28 PM GMT
So many times I've said, "It's right there, why is it so hard?"
Vote by External U.
7104 | July 02, 2015 03:12:06 PM GMT
I like this idea but I don't like the idea of trying to work out whether I'm using a java type or a coldfusion type variables in a file with 2000 lines of spaghetti in it.
Vote by External U.
7105 | July 03, 2015 06:45:45 AM GMT
would help keep the language relevant if we could also use all the power of java
Vote by External U.
7106 | July 06, 2015 02:00:30 PM GMT
Please explain in 25 characters or more how this feature impacts productivity and why you are adding a vote
Vote by External U.
7107 | January 20, 2016 01:15:22 AM GMT
Something common when interacting with Java libs is the expectation for me to extend an abstract class and override a couple methods in it. I can do that now only by creating an actual java class, compiling it to a jar and adding it to my classpath. It would be great to be able to create a CFC that extends a Java class, but even BETTER to be able to declare the class on the fly like Java allows. It's actually a shame when Java offers a quicker, more concise syntax to something than CFML! Here's an example of some Java code that creates a class on the fly that extends another class, overriding a method: Authenticator authenticator = new Authenticator() { public PasswordAuthentication getPasswordAuthentication() { return (new PasswordAuthentication("user", "password".toCharArray())); } };
Comment by External U.
7090 | January 20, 2016 01:21:53 AM GMT
How's that "Needs Review" going, after two years?
Comment by Adam C.
7091 | August 02, 2017 07:06:51 AM GMT
+1 Might I suggest a prefix to the class path if you're using java to address the extremely valid concern raised on 07/03/2015. Component foo = new path.to.my.cfc(); Java foo = new java:path.to,my.lib();
Vote by Adrian M.
7108 | August 02, 2017 06:32:49 PM GMT
I agree with the syntax proposed by Adrian Moreno: foo = new java:fully.qualified.class.name();
Comment by Kama S.
7092 | August 02, 2017 07:08:55 PM GMT