Microsoft SQL Server 2008 R2 Especificações Página 172

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 236
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 171
152 CHAPTER 8 Complex Event Processing with StreamInsight
the elds one at a time and enqueue the event. The untyped output adapter works similarly,
but instead it must be able to use the conguration specication to retrieve query processing
results from a dequeued event.
The next step is to develop an AdapterFactory object as a container class for your input
and output adapters. You use an AdapterFactory object to share resources between adapter
implementations and to pass conguration parameters to adapter constructors. Recall that
an untyped adapter relies on the conguration specication to properly handle an event’s
payload structure. The adapter factory must implement the Create() and Dispose() methods
as shown in the following code example, which shows how to create adapters for events in a
text le:
public class TextFileInputFactory : IInputAdapterFactory<TextFileInputConfig>
{
public InputAdapterBase Create(TextFileInputConfig configInfo,
EventShape eventShape, CepEventType cepEventType)
{
InputAdapterBase adapter = default(InputAdapterBase);
if (eventShape == EventShape.Point)
{
adapter = new TextFilePointInput(configInfo, cepEventType);
}
else if (eventShape == EventShape.Interval)
{
adapter = new TextFileIntervalInput(configInfo, cepEventType);
}
else if (eventShape == EventShape.Edge)
{
adapter = new TextFileEdgeInput(configInfo, cepEventType);
}
else
{
throw new ArgumentException(
string.Format(CultureInfo.InvariantCulture,
"TextFileInputFactory cannot instantiate adapter with event shape {0}",
eventShape.ToString()));
}
return adapter;
}
public void Dispose()
{
}
}
Vista de página 171
1 2 ... 167 168 169 170 171 172 173 174 175 176 177 ... 235 236

Comentários a estes Manuais

Sem comentários