I am writing an event gateway and I need to be able to pass a complex
object in the event to the outgoingMessage() method. All of the
examples only show strings being passed.
If I understand it correctly, when ColdFusion isn't sure of the object
type it casts it as type JavaProxy. After playing around with it, I was
finally able to pass the object in by using the method below. Does
anyone know if there is a better way to write this or is this the only
way?
public String outgoingMessage(coldfusion.eventgateway.CFEvent cfmsg)
{
JavaProxy message;
Map data = cfmsg.getData();
message = (JavaProxy) data.get("message");
MyClass myObject = (MyClass) message.getObject();
}
Thanks for the feedback.
Eric Lackey
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232805
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54