Group Manager

This section looks at the object model exposed for XLANG hosting COM+ applications. You get a reference to this object as an item in the collection exposed by System Manager described previously. The object interface is used to stop, suspend, resume, and get information about a running schedule instances in the hosting application.

In Visual Basic, the type library for this object is available in SkedCore.dll, which is nominally located at Program FilesMicrosoft BizTalk ServerXLANG SchedulerSkedCore.dll. This is the XLANG Scheduler Runtime Type Library. See Figure 11.7 for references.

The following code fragments show how to get a reference to the default group manager. This is the idiomatic use of the default property, Item, of the System Manager. In the code fragment, the collection of group managers exposed by the System Manager is being indexed by the name of the default group manager, which is XLANG Scheduler. You could substitute that with another name to access another group manager.

Dim oGrp As COMRUNTIME.IWFGroupAdmin 
Set oGrp = oMgr("XLANG Scheduler")

The following fragment iterates through all running group managers on the system. This is the idiomatic enumeration of a collection in Visual Basic.

For Each oGrp in oMgr 
    ' your code goes here...
Next

The following code fragment gets a reference to a group manager by asking COM to bind the moniker to the class implementation. The GetObject call results in resolving the moniker, activating the class server, and returning a reference to the group manager. In the example, the server name is missing and defaults to the local server. Note that the group manager's name is case-sensitive, and spaces are significant.

Set oGrp = GetObject("sked://!XLANG Scheduler") 

The properties and methods of a group manager are described in this section. Table 11.3 summarizes the properties, and Table 11.4 summarizes the methods of a group manager.

Table 11.3. Properties of a Group Manager
PropertyDescription
CountNumber of running schedule instances
FullyQualifiedNameMoniker for the group manager
IntanceIsResidentTrue if schedule instance is in memory
InstanceIsSuspendedTrue if schedule instance is suspended
ItemCollection of running schedule instances
NameName of the group manager
UseFileDSNTrue if group manager uses a file DSN

Table 11.4. Methods of a Group Manager
MethodDescription
ResumeInstanceResumes a previously suspended schedule instance
ShutdownControlled shutdown of the group manager
StartUpStarts group manager and rehydrates its instances
SuspendInstanceSuspends a running schedule instance
TerminateInstanceStops a schedule instance

Each property and method is described in the order listed in Tables 11.3 and 11.4. The property or method is identified with a bolded label; this is followed by a signature and a description.

Property Count

Property Count As Long 

The Count property returns the number of running XLANG schedule instances in this group manager.

This is a read-only property.

Property FullyQualifiedName

Property FullyQualifiedName As String 

The FullyQualifiedName property returns a String containing a moniker for the group manager. The moniker contains a full, DNS style, system name; hence, you can parse this moniker to extract the system name for this hosting application.

This is a read-only property

Property InstanceIsResident

Property InstanceIsResident(varParam As String) As Boolean 

The property InstanceIsResident returns True if the named XLANG schedule instance is in memory or False if the instance is dehydrated.

The instance name specified in the varParam is a GUID assigned to it by the engine. This GUID is visible in the moniker assigned to a schedule instance—for example, the following is a valid moniker with the GUID identity of the running instance:

sked://MyMachine!XLANG Scheduler/{7DFE4B47-19EB-45a1-AE35-492886B4FF74} 

This is a read-only property.

Property InstanceIsSuspended

Property InstanceIsSuspended(varParam As String) As Boolean 

The property InstanceIsSuspended returns True if the named instance is suspended; False otherwise. The instance is identified by the GUID assigned to it. A suspended instance is still in memory and not dehydrated. A suspended instance cannot be within a short-lived transaction or any method call.

This is a read-only property. You must check this property before calling the ResumeInstance method.

Property Item

Property Item(name As String) As Unknown 

The Item property is the default member of the group manager object and returns a reference to a collection of running schedule instances. You can get a reference to a specific running instance by using the GUID name for that instance as an index into the collection.

This is a read-only property.

Property Name

Property Name As String 

The property Name returns the name of the group manager as a String. This is also the name of the COM+ application hosting the XLANG schedules.

This is a read-only property.

Property UseFileDSN

Property UseFileDSN As Boolean 

The property UseFileDSN returns True if the group manager uses a file DSN to persist dehydrated schedules.

This is a read-only property. The value of the property is not necessarily the configured setting through the SysMgr.UseFileDSN property; instead, it is the setting at the time the group manager was launched.

Method ResumeInstance

Sub ResumeInstance(bInstanceId As String) 

This method resumes a previously suspended schedule instance. The instance ID is the GUID assigned to it by the engine. Check whether a schedule is in fact suspended by getting the value of InstanceIsSuspended property first.

Method Shutdown

Sub Shutdown() 

The Shutdown method dehydrates all running schedules to the database and then stops the group manager. Only schedules in the current group manager are affected.

When called, no new schedule activation requests are entertained until shutdown completes. This method should not be called by a component bound to a schedule; use an external application instead.

Method Startup

Sub Startup() 

The Startup method rehydrates previously dehydrated schedule instances of this group manager. Microsoft recommends that you not use this method; use the SysMgr.StartUp method instead. This method is for internal use by the System Manager.

Method SuspendInstance

Sub SuspendInstance(bstrInstanceId As String) 

The SuspendInstance method suspends the further execution of the specified running schedule in the current group manager.

This is a synchronous call. The call may block if the schedule is waiting for the completion of a method call or for a short-lived transaction to resolve.

Method TerminateInstance

Sub TerminateInstance(bstrInstanceId As String) 

The TerminateInstance method stops the named schedule instance in the current group. A terminated schedule instance can never be restarted or resumed.

This is a synchronous call. The call may block if a component bound port is in the middle of a method call or if the schedule is waiting for a short-lived transaction to resolve.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset