Hi Jordan,
Create a class (SingeltonCreator), with a method (getMySingleton), which returns a
reference to the Singleton.
Then you can use the returned refernce to invoke the methods of your singleton class.
<CFOBJECT TYPE = "Java"
NAME = "MyClass"
CLASS = "SingeltonCreator"
ACTION = "Create">
<!--- get a reference to singleton---->
<cfset result1 = MyClass.getMySingleton()>
<!--- use it --------->
<cfset result2 = result1.anyMethod(.....)>
laszlo
Jordan Saardchit wrote:
> Does anyone know how to call a static method as opposed to calling the
> constructor to instantiate an object using CFOBJECT? I've got a
> Singleton object that I am trying to implement, but when you use
> CFOBJECT with the CREATE action, it attempts to instantiate the object,
> and throws an exception due to a private constructor. Any help would be
> great. Thanks.
>
> Jordon
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists