BusinessLogicHandler 클래스
Represents the server registration for the managed code assembly that implements a business logic handler.
상속 계층
System. . :: . .Object
Microsoft.SqlServer.Replication..::..BusinessLogicHandler
네임스페이스: Microsoft.SqlServer.Replication
어셈블리: Microsoft.SqlServer.Rmo(Microsoft.SqlServer.Rmo.dll)
구문
‘선언
Public NotInheritable Class BusinessLogicHandler
‘사용 방법
Dim instance As BusinessLogicHandler
public sealed class BusinessLogicHandler
public ref class BusinessLogicHandler sealed
[<SealedAttribute>]
type BusinessLogicHandler = class end
public final class BusinessLogicHandler
BusinessLogicHandler 유형에서 다음 멤버를 표시합니다.
속성
이름 | 설명 | |
---|---|---|
DotNetAssemblyName | Gets or sets the name of the assembly that implements the business logic handler. | |
DotNetClassName | Gets or sets the name of the class that implements the business logic handler. | |
FriendlyName | Gets or sets the name that registers the business logic handler on the server. | |
IsDotNetAssembly | Specifies whether the registered business logic handler is a managed code assembly. | |
UserData | Gets or sets an object to which users can attach their own data. |
맨 위로 이동
메서드
이름 | 설명 | |
---|---|---|
CheckValidDefinition | 인프라입니다. | |
Equals | (Object에서 상속됨) | |
Finalize | (Object에서 상속됨) | |
GetHashCode | (Object에서 상속됨) | |
GetType | (Object에서 상속됨) | |
MemberwiseClone | (Object에서 상속됨) | |
ToString | (Object에서 상속됨) |
맨 위로 이동
주의
Business logic handlers are registered by calling RegisterBusinessLogicHandler. The properties of the BusinessLogicHandler object must be set before calling RegisterBusinessLogicHandler.
Business logic handler registrations are removed by calling UnregisterBusinessLogicHandler.
Call EnumBusinessLogicHandlers to get a list of business logic handlers that are registered on a server.
예
// Specify the Distributor name and business logic properties.
string distributorName = publisherInstance;
string assemblyName = @"C:\Program Files\Microsoft SQL Server\100\COM\CustomLogic.dll";
string className = "Microsoft.Samples.SqlServer.BusinessLogicHandler.OrderEntryBusinessLogicHandler";
string friendlyName = "OrderEntryLogic";
ReplicationServer distributor;
BusinessLogicHandler customLogic;
// Create a connection to the Distributor.
ServerConnection distributorConn = new ServerConnection(distributorName);
try
{
// Connect to the Distributor.
distributorConn.Connect();
// Set the Distributor properties.
distributor = new ReplicationServer(distributorConn);
// Set the business logic handler properties.
customLogic = new BusinessLogicHandler();
customLogic.DotNetAssemblyName = assemblyName;
customLogic.DotNetClassName = className;
customLogic.FriendlyName = friendlyName;
customLogic.IsDotNetAssembly = true;
Boolean isRegistered = false;
// Check if the business logic handler is already registered at the Distributor.
foreach (BusinessLogicHandler registeredLogic
in distributor.EnumBusinessLogicHandlers())
{
if (registeredLogic == customLogic)
{
isRegistered = true;
}
}
// Register the custom logic.
if (!isRegistered)
{
distributor.RegisterBusinessLogicHandler(customLogic);
}
}
catch (Exception ex)
{
// Do error handling here.
throw new ApplicationException(string.Format(
"The {0} assembly could not be registered.",
assemblyName), ex);
}
finally
{
distributorConn.Disconnect();
}
' Specify the Distributor name and business logic properties.
Dim distributorName As String = publisherInstance
Dim assemblyName As String = "C:\Program Files\Microsoft SQL Server\100\COM\CustomLogic.dll"
Dim className As String = "Microsoft.Samples.SqlServer.BusinessLogicHandler.OrderEntryBusinessLogicHandler"
Dim friendlyName As String = "OrderEntryLogic"
Dim distributor As ReplicationServer
Dim customLogic As BusinessLogicHandler
' Create a connection to the Distributor.
Dim distributorConn As ServerConnection = New ServerConnection(distributorName)
Try
' Connect to the Distributor.
distributorConn.Connect()
' Set the Distributor properties.
distributor = New ReplicationServer(distributorConn)
' Set the business logic handler properties.
customLogic = New BusinessLogicHandler()
customLogic.DotNetAssemblyName = assemblyName
customLogic.DotNetClassName = className
customLogic.FriendlyName = friendlyName
customLogic.IsDotNetAssembly = True
Dim isRegistered As Boolean = False
' Check if the business logic handler is already registered at the Distributor.
For Each registeredLogic As BusinessLogicHandler _
In distributor.EnumBusinessLogicHandlers
If registeredLogic Is customLogic Then
isRegistered = True
End If
Next
' Register the custom logic.
If Not isRegistered Then
distributor.RegisterBusinessLogicHandler(customLogic)
End If
Catch ex As Exception
' Do error handling here.
Throw New ApplicationException(String.Format( _
"The {0} assembly could not be registered.", _
assemblyName), ex)
Finally
distributorConn.Disconnect()
End Try
스레드 보안
이 유형의 모든 공용 static(Visual Basic에서는 Shared) 멤버는 스레드로부터 안전합니다. 인스턴스 멤버는 스레드로부터의 안전성이 보장되지 않습니다.