org.instrumentmiddleware.cima.plugin.producer.poller
Class RegularIntervalMultiPollerParcelProducer

java.lang.Object
  extended by org.instrumentmiddleware.cima.plugin.impl.AbstractPlugin
      extended by org.instrumentmiddleware.cima.plugin.producer.impl.AbstractProducer
          extended by org.instrumentmiddleware.cima.plugin.producer.poller.AbstractMultiPollerParcelProducer
              extended by org.instrumentmiddleware.cima.plugin.producer.poller.RegularIntervalMultiPollerParcelProducer
All Implemented Interfaces:
ICIMAOperationExtension, ICIMAPlugin, IPlugin, IParcelProducer, IProducer

public abstract class RegularIntervalMultiPollerParcelProducer
extends AbstractMultiPollerParcelProducer

A parcels producer that has multiple poller threads(one per subscriber/session). Each poller thread will ask this producer to produce parcels on a regular interval(might be different for each poller). The data interval for a given subscriber is specified in the SUBSCRIBE parcel the subscriber sends to notify its interest in the data produced by this producer. This producer can specify how the poller threads will release(send to subscriber) the produced parcels: using a single thread or a pool of threads. This is done with the releaseMode constructor parameter. If set to "multi" the poller threads will use a pool of threads to release the parcels

Author:
Romain

Field Summary
protected  java.lang.String releaseMode
           
 
Fields inherited from class org.instrumentmiddleware.cima.plugin.producer.poller.AbstractMultiPollerParcelProducer
sessionPollerMapping
 
Fields inherited from class org.instrumentmiddleware.cima.plugin.producer.impl.AbstractProducer
deliveryStrategy, director, log, parcelCreator
 
Fields inherited from class org.instrumentmiddleware.cima.plugin.impl.AbstractPlugin
startOnLoad, stopped, subscriptions
 
Constructor Summary
RegularIntervalMultiPollerParcelProducer(java.lang.String id, IParcelCreator creator, ICIMADirector director, java.lang.String releaseMode)
           
 
Method Summary
protected  ParcelProducerPoller getPollerThread(ISession session, org.instrumentmiddleware.cima.parcel.DataIntervalType dataInterval)
           
 org.instrumentmiddleware.cima.parcel.CimaOperationResponseType processGetOperation(org.instrumentmiddleware.cima.parcel.CimaVariable[] variables, java.util.Calendar creationTime, ISession session, org.instrumentmiddleware.cima.parcel.CimaOperationResponseType response)
          Gets the given variables value.
 org.instrumentmiddleware.cima.parcel.CimaOperationResponseType processSetOperation(org.instrumentmiddleware.cima.parcel.CimaVariable[] variables, java.util.Calendar creationTime, ISession session, org.instrumentmiddleware.cima.parcel.CimaOperationResponseType response)
          Sets the given variables value.
 
Methods inherited from class org.instrumentmiddleware.cima.plugin.producer.poller.AbstractMultiPollerParcelProducer
processSubscribeParcel, stop
 
Methods inherited from class org.instrumentmiddleware.cima.plugin.producer.impl.AbstractProducer
getDeliveryStrategy, releaseParcel, setDeliveryStrategy, start
 
Methods inherited from class org.instrumentmiddleware.cima.plugin.impl.AbstractPlugin
doSubscribe, doSubscribe, getBodyHandler, getId, getInformation, getSequenceNumber, internalProcessParcel, processParcel, processSubscribeResponse, setStartOnLoad, setSubscriptions, startOnLoad
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.instrumentmiddleware.cima.plugin.producer.IParcelProducer
produceParcels
 
Methods inherited from interface org.instrumentmiddleware.cima.plugin.producer.IProducer
getDeliveryStrategy, releaseParcel, setDeliveryStrategy
 
Methods inherited from interface org.instrumentmiddleware.cima.plugin.IPlugin
doSubscribe, getId, getInformation, getSequenceNumber, processParcel, setStartOnLoad, start, startOnLoad
 

Field Detail

releaseMode

protected java.lang.String releaseMode
Constructor Detail

RegularIntervalMultiPollerParcelProducer

public RegularIntervalMultiPollerParcelProducer(java.lang.String id,
                                                IParcelCreator creator,
                                                ICIMADirector director,
                                                java.lang.String releaseMode)
                                         throws java.lang.Exception
Parameters:
id -
creator -
director -
releaseMode - releaseMode if set to "multi", the poller threads will the use a pool of threads to released the produced parcels. Every other values, means that a single thread will be used by the poller threads to release the parcels.
Throws:
java.lang.Exception
Method Detail

processGetOperation

public org.instrumentmiddleware.cima.parcel.CimaOperationResponseType processGetOperation(org.instrumentmiddleware.cima.parcel.CimaVariable[] variables,
                                                                                          java.util.Calendar creationTime,
                                                                                          ISession session,
                                                                                          org.instrumentmiddleware.cima.parcel.CimaOperationResponseType response)
                                                                                   throws PluginException
Description copied from interface: ICIMAOperationExtension
Gets the given variables value. The result is a parcel containing the value of given variables

Specified by:
processGetOperation in interface ICIMAOperationExtension
Overrides:
processGetOperation in class AbstractProducer
Parameters:
variables - The variables to get the value from
session - The session this communication belongs to
response - response the partly built response
Returns:
a parcel containing the value of given variables
Throws:
PluginException - if something goes wrong while retrieving variables values

processSetOperation

public org.instrumentmiddleware.cima.parcel.CimaOperationResponseType processSetOperation(org.instrumentmiddleware.cima.parcel.CimaVariable[] variables,
                                                                                          java.util.Calendar creationTime,
                                                                                          ISession session,
                                                                                          org.instrumentmiddleware.cima.parcel.CimaOperationResponseType response)
                                                                                   throws PluginException
Description copied from interface: ICIMAOperationExtension
Sets the given variables value.

Specified by:
processSetOperation in interface ICIMAOperationExtension
Overrides:
processSetOperation in class AbstractProducer
Parameters:
variables - The variables to be set
session - The session this communication belongs to
response - The partly built response
Returns:
a parcel containing the result of set execution
Throws:
PluginException - if something goes wrong while setting variables values

getPollerThread

protected ParcelProducerPoller getPollerThread(ISession session,
                                               org.instrumentmiddleware.cima.parcel.DataIntervalType dataInterval)
Specified by:
getPollerThread in class AbstractMultiPollerParcelProducer


Copyright © 2008. All Rights Reserved.