Getting thread name via CF

2012-09-06 Thread Rick Root

Hi,

I have a process that runs using an event gateway.  Sometimes, I'd like to
be able to look in FusionReactor and see what it is currently doing, if
anything.

But I don't alwaysk now what thread to look at, and I don't want to have to
look and every thread to find it.

I know that if I do a cflog statement, it will log the thread name...

I wondered if there's a way I can access the current java thread name from
within the CF code itself.

Thanks.

Rick

-- 
*The beatings will continue until morale improves.*


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352432
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Getting thread name via CF

2012-09-06 Thread .jonah

Take a look at the CFTracker source:

http://www.cftracker.net/

On 9/6/12 12:28 PM, Rick Root wrote:
 Hi,

 I have a process that runs using an event gateway.  Sometimes, I'd like to
 be able to look in FusionReactor and see what it is currently doing, if
 anything.

 But I don't alwaysk now what thread to look at, and I don't want to have to
 look and every thread to find it.

 I know that if I do a cflog statement, it will log the thread name...

 I wondered if there's a way I can access the current java thread name from
 within the CF code itself.

 Thanks.

 Rick



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352433
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Getting thread name via CF

2012-09-06 Thread Pete Freitag

Yes the java.lang.Thread class has a static method you can call
currentThread() which gives you the current thread, just call getName() on
it, eg:

cfset currentThread = CreateObject(java,
java.lang.Thread).currentThread()
cfoutputCurrent Thread: #currentThread.getName()#/cfoutput


--
Pete Freitag - Adobe Community Professional
http://foundeo.com/ - ColdFusion Consulting  Products
http://petefreitag.com/ - My Blog
http://hackmycf.com - Is your ColdFusion Server Secure?




On Thu, Sep 6, 2012 at 3:28 PM, Rick Root rick.r...@gmail.com wrote:


 Hi,

 I have a process that runs using an event gateway.  Sometimes, I'd like to
 be able to look in FusionReactor and see what it is currently doing, if
 anything.

 But I don't alwaysk now what thread to look at, and I don't want to have to
 look and every thread to find it.

 I know that if I do a cflog statement, it will log the thread name...

 I wondered if there's a way I can access the current java thread name from
 within the CF code itself.

 Thanks.

 Rick

 --
 *The beatings will continue until morale improves.*


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352443
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Getting thread name via CF

2012-09-06 Thread Mark Mandel

Another example for you:
http://www.compoundtheory.com/?action=displayPostID=251

Mark

On Fri, Sep 7, 2012 at 3:05 PM, Pete Freitag p...@foundeo.com wrote:


 Yes the java.lang.Thread class has a static method you can call
 currentThread() which gives you the current thread, just call getName() on
 it, eg:

 cfset currentThread = CreateObject(java,
 java.lang.Thread).currentThread()
 cfoutputCurrent Thread: #currentThread.getName()#/cfoutput


 --
 Pete Freitag - Adobe Community Professional
 http://foundeo.com/ - ColdFusion Consulting  Products
 http://petefreitag.com/ - My Blog
 http://hackmycf.com - Is your ColdFusion Server Secure?




 On Thu, Sep 6, 2012 at 3:28 PM, Rick Root rick.r...@gmail.com wrote:

 
  Hi,
 
  I have a process that runs using an event gateway.  Sometimes, I'd like
 to
  be able to look in FusionReactor and see what it is currently doing, if
  anything.
 
  But I don't alwaysk now what thread to look at, and I don't want to have
 to
  look and every thread to find it.
 
  I know that if I do a cflog statement, it will log the thread name...
 
  I wondered if there's a way I can access the current java thread name
 from
  within the CF code itself.
 
  Thanks.
 
  Rick
 
  --
  *The beatings will continue until morale improves.*
 
 
 

 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352445
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm