Fusioncube

The online journey of a technophile, by Steve Brownlee

Now that the ColdFusion server runs on top of a Java subsystem, I thought it was time for the Server scope to actually contain information about the Java server as well as the CFML processor. The Enhancer adds a new JVM key to the Server scope and adds more keys to the Server.OS structure.

*click image to view full size
Enahncer-781708.jpg

New keys:

  • server.jvm.memory
  • server.jvm.memory.pools
  • server.jvm.threads
  • server.jvm.arguments
  • server.os.CommittedVirtualMemorySize
  • server.os.FreePhysicalMemorySize
  • server.os.FreeSwapSpaceSize
  • server.os.ProcessCpuTime
  • server.os.TotalPhysicalMemorySize
  • server.os.TotalSwapSpaceSize
  • server.os.AvailableProcessors
  • server.os.MBeanInfo

Of course, you can remove any information that you don’t want from the code, but even on my wimpy 500MB RAM/1.33 MHz laptop, execution time for the code was max 67ms and averaged about 32ms.

I made two versions of the code. All of the features descibed above are in the JDK 1.5 version. The 1.4 version still adds some memory values and has the Thread query, but the 1.4 JDK just doesn’t have as many features.

Download Server Scope Enhancer JDK 1.5
Download Server Scope Enhancer JDK 1.4

Published on Thursday, Jul 6,2006 | 3 Comments

I recently got into designing some Flash forms for a quick demo here at work, just to show folks what it could do. I had problems finding good tutorials on the Web so I had to plow my way through it. If I had found this article, it would have saved me a lot of time. If you’re interested in learning about Flash Forms, check out this article on CommunityMX.

Discovering CFMX 7: Flash Forms – Part 1

Published on Friday, Jun 23,2006 | 0 Comments

I’d published a quick app called Memory Explorer I threw together using Rob Gonda’s ajaxCFC framework a while back. However, one thing that’s been bugging me ever since I made it was that I was using JSP pages to create certain Java objects and then putting them in a scope that ColdFusion could access – specifically the Request scope.

I always knew there had to be a way to create not only a Thread object, but also an array of Threads, however I didn’t make the time to investigate it. Then, by chance, I stumbled across some code I did last year regarding Bytes and Byte arrays and realized that I could use the same principles (after a few blind stabs in the dark) to create what I needed.

I also, then, re-found an article on Chrisian Cantrell’s site regarding creating Byte arrays in ColdFusion which I remembered that I referenced when I did my original code. Using my code and his examples as inspiration, I finally was able to access all of the threads currently running on my JVM and output them nicely to the screen. Here’s what you need to do.

First, create a Thread object which captures the current thread of your JVM
thisThread = createobject(“java”, “java.lang.Thread”);

Then, create a native Java Thread type by using the getClass() method
threadClass = createobject(“java”, “java.lang.Thread”).init().getClass();

Now, you need an Array to hold all of the threads because the ThreadGroup.enumerate() method requires a native Thread array as an argument.
threadList = createobject(“java”, “java.lang.reflect.Array”).newInstance(threadClass,thisThread.activeCount());

Next, you populate the Thread array with each item in the ThreadGroup.
thisThread.currentThread().getThreadGroup().enumerate(threadList);

Now you have your array of Threads which you can access in ColdFusion as a simple one-dimenstional array.
<cfdump var=“#threadList[1]#”>

Published on Friday, Jun 23,2006 | 4 Comments

Jay and Steve McDonald use a tiny bit of Flash to parse their AJAX XML instead of relying on javascript.

“try to go to the Fjax site and point to the Flash. You can’t. It’s not visible anywhere. That’s completely different than how people are used to using Flash.” … not visible unless you have Flashblock installed.

read more | digg story

Published on Friday, Jun 23,2006 | 0 Comments

Hasbrouck Heights (NJ) Library Director Michele Reutty is under fire for following the 4th amendment and not giving private info to the police without a subpoena. She faces a 30 day suspension without pay.

read more | digg story

Anyone prosecuting this case should be absolutely ashamed of themselves. There is zero, none, zilch reasons to justify ignoring the 4th amendment. Unless you’re one of those people who use the cop-out “it’s for the children” line to justify stomping all over people’s consitutionally protected rights.

Published on Friday, Jun 23,2006 | 0 Comments

About Steve

I am a technologist, and have been ever since 1980 when I got my very first TRS-80 and programmed it to do my math homework. I love to share the gift of technology with others and show them the wonderful things it can do for them, and how they should not fear it, but embrace it.
Find out more about me at Vizify....

Subscribe

Entries (RSS)
Comments (RSS)