Issue Details (XML | Word | Printable)

Key: MULE-3455
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Ross Mason
Reporter: Ross Mason
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Mule

Groovy script component could support component bindings

Created: 16/Jun/08 01:36 AM   Updated: 26/Jun/08 01:57 AM
Component/s: Modules: JSR-223 Scripting
Affects Version/s: 2.0.1
Fix Version/s: 2.0.2

Time Tracking:
Not Specified

Labels:
User impact: Medium
Affects Docs: Yes
Migration Impact: Binding would need to be documented for Groovy scripts
Similar Issues: MULE-3319 Implement script component bindings using expressions
MULE-3422 Bindings on the script component are not well defined
MULE-4135 Nested routers / bindings do not correctly handle NullPayload


 Description  « Hide
Bindings are not currently supported for scripting components but Groovy scripts could support them by adding a binding to the namespace

 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
Ross Mason added a comment - 17/Jun/08 04:52 AM
just thought of an easy way of doing this. Will try it out now.

Daniel Feist added a comment - 17/Jun/08 05:33 PM
Ross, just had a look at your changeset..

Although using the java bindings here is valid and works with java based scripting languages, I'd initially thought of binding to script variables as a more natural/universal way of implementing bindings for this component type. Perhaps we can do both using <binding> (bind to script variables) and <java-binding>/<interface-binding> (bind to java interface?

On a separate note perhaps we can extend the binding concept to allow bindings to use expressions (using new expression evaluator) and other components and not just endpoints. This relates somewhat to the composite component issue.


Ross Mason added a comment - 17/Jun/08 05:45 PM
Hi Dan,

Sounds interesting. By all means write something up. I agree there should be different types of <binding> but my goal here was to match current capabilities, since this isn't a major feature point right now.


Daniel Feist added a comment - 17/Jun/08 06:02 PM
> I agree there should be different types of <binding> my goal here was to match current capabilities, since this isn't a major feature point right now.

Agreed, good idea. Only concern was that we are using "<binding>" element for this java-specific case and therefore won't be able to use this element for more generic/universal script component bindings (to script variables instead of java interface maybe) in the future. A solution would leave what you added as is and just change the element name to "java-binding".

Should probably write up the idea to extend bindings in the composite component issue, or create a new issue for it, i'll do that at some point.


Ross Mason added a comment - 18/Jun/08 03:12 AM
I see your point. So would it be a Java binding or an interface binding? Are they th same thing? For me the logical differentiation could be a Java Binding would bind a java object directly, an interface binding would generate a proxy or even a JNI wrapper.

Daniel Feist added a comment - 18/Jun/08 07:16 AM
Maybe to be clear we should call it <java-interface-binding>. In fact these different binding types probably also apply to the java component.

We should be as clear as possible naming them, and maybe only use the <binding> element if there is a clear default binding type for a given component type.


Ross Mason added a comment - 26/Jun/08 01:57 AM
fixed in: r12167