%ZHSLIB.Context.NamedInstanceBase
abstract class %ZHSLIB.Context.NamedInstanceBase extends %Library.RegisteredObject
Property Inventory
Method Inventory
- %%CheckSubClassValidity()
- %OnNew()
- EnsureInstance()
- InstanceKeyGet()
- InvalidateInstances()
- SetDebugMode()
- fullKey()
Parameters
final parameter Global = ^IRIS.Temp.ZHSLIB.NamedInstance;
Properties
property InstanceKey as %String;
The 'instance key' used to acquire this instance object
Property methods: InstanceKeyDisplayToLogical(), InstanceKeyGet(), InstanceKeyIsValid(), InstanceKeyLogicalToDisplay(), InstanceKeyLogicalToOdbc(), InstanceKeyNormalize(), InstanceKeySet()
Methods
classmethod %%CheckSubClassValidity() [ Language = objectscript ]
Ensure non-abstract subclasses have abstract parameters defined correctly
Inherited description: This callback method is invoked by the %New() method to
provide notification that a new instance of an object is being created.
If this method returns an error then the object will not be created.
It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:
Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.
classmethod EnsureInstance(pKey As %String) as %ZHSLIB.Context.NamedInstanceBase [ Language = objectscript ]
This method is called to acquire a specific Named instance of a service. The service
instance may have been previously registered with the Context using RegisterNamedInstance.
First the Context object is called to attempt to acquire a previously registered instance. If
the instance is present and its class has not be re-compiled since it was registered, then the
registered instance is returned. Otherwise, the subclass implementation of CreateInstance is
called to acquire and register an instance.
method InstanceKeyGet() as %String [ Language = objectscript ]
Implement Get for the Calculated 'Instance' property
classmethod InvalidateInstances(pKey) [ Language = objectscript ]
Calling this method ensures that the next time EnsureInstance is called, a new service
will be instantiated and initialized. Call this method after changing settings that the
service caches in order to have the setting take effect.
This method provides control of debug mode. When in debug mode, the EnsureInstance
method will always force a CreateInstance. This is useful during the development of a service,
but adds overhead in production because the service instance is created and initialized on each
request.
Inherited Members
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()