This content has been marked as final. Show 2 replies
A few potential gotchas, other than that, it's OK....
- "Name" is an invalid attribute! Perhaps you meant
- Be careful with the "variables" scope in components. Declare
these outside the cffunction if they are meant for the whole
Use "this" scope for anything meant to be public (not usually a good idea).
Use the "var" qualifier for any variables declared inside functions.
- If that java uses a shared resource or spawns asynchronous
threads, there might be trouble. Use locking if needed and monitor
thread state if applicable.
- "Name" is an invalid attribute! Perhaps you meant displayName?
Thank you very much for your answer.
1. Yes, I did know that the name is not supported - I didnt cut and paste this, I actually typed it here so I added that by mistake
2. Id like to make it so whenever the CFC is constructed (init function), I make the Java object. This way, in later functions of the CFC, I am able to use methods of the java object. Is there any harm in using the variables scope for where I have the object sitting right now. As I understood it, the variables scope exists only as long as the object exists.
3. This is what I am the most concerned about. I was thinking about using jvmstat as well as a load simulator to put a bunch of load on the server and then monitor how well the GC was taking place. Also, at a simpler level, I could monitor how much memory was used before and after the load simulator. For example, if the java process is taking 250MB of memory at idle and then I run a test that generates 5000 of these objects and then stops. I should see a sharp rise of the amount of memory taken but then it should go back to idle, right?
Thank you for your very valuable input. I really appreciate it!