Public Member Functions | |
Consumer (String channelName, ContainerServicesBase services) throws AcsJException | |
Consumer (String channelName, String channelNotifyServiceDomainName, ContainerServicesBase services) throws AcsJException | |
void | consumerReady () throws AcsJException |
void | addSubscription (Class<?extends IDLEntity > structClass) throws AcsJException |
void | addSubscription (Class<?extends IDLEntity > structClass, Object receiver) throws AcsJException |
void | removeSubscription (Class structClass) throws AcsJException |
int | addFilter (Class<?extends IDLEntity > structClassName, String filter) throws AcsJException |
boolean | removeFilter (int filter) throws AcsJException |
void | disconnect_structured_push_consumer () |
void | push_structured_event (StructuredEvent structuredEvent) throws org.omg.CosEventComm.Disconnected |
void | offer_change (EventType[] eventType, EventType[] eventType1) throws org.omg.CosNotifyComm.InvalidEventType |
void | disconnect () |
void | suspend () |
void | resume () |
alma.acs.nc.Helper | getHelper () |
Protected Member Functions | |
EventChannel | getNotificationChannel (String channelName) throws AcsJException |
String | getChannelKind () |
String | getChannelDomain () |
String | getNotificationFactoryName () |
void | createConsumer () throws AcsJException |
EventChannel | getNotificationChannel () throws AcsJException |
void | configSubscriptions () |
void | configFilters () |
String | getFilterLanguage () |
void | processEvent (IDLEntity corbaData, EventDescription eventDescrip) |
void | processEvent (Object corbaData) |
Protected Attributes | |
final ChannelInfo | m_channelInfo |
final Logger | m_logger |
final Helper | m_helper |
EventChannel | m_channel |
final String | m_channelName |
final String | m_channelNotifyServiceDomainName |
final HashMap< String, Object > | m_handlerFunctions = new HashMap<String Object>() |
final HashMap< String, Double > | m_handlerTimeoutMap |
ConsumerAdmin | m_consumerAdmin |
StructuredProxyPushSupplier | m_proxySupplier |
OSPushConsumer | m_corbaRef = null |
AnyAide | m_anyAide = null |
Private Attributes | |
final StopWatch | profiler |
final boolean | isTraceEventsEnabled |
Static Private Attributes | |
final String | RECEIVE_METHOD_NAME = "receive" |
final long | DEFAULT_MAX_PROCESS_TIME = 2000 |
|
Creates a new instance of Consumer
|
|
Creates a new instance of Consumer
|
|
Adds a single filter to this consumer. With ALMA's use of IDL structs for ICD events, this method is no longer useful. May become deprecated in future ACS releases.
|
|
Add a subscription to a given (IDL struct) Java class and also register a method capable of processing that event (IDL struct). Each time an event of the (IDL struct) type is received, the Consumer will automatically invoke the receiver object's "receive" method using the (IDL struct) data extracted from the CORBA event.
|
|
Add a subscription to a given (IDL struct) Java class. Use this method only when Consumer has been subclassed and processEvent overriden.
|
|
Override this method in subclasses to specify all filters this Consumer will use. The method would then just make a lot of calls to addFilter(...). Important to note this is the last method invoked by consumer's constructor. |
|
Override this method to setup any number of event subscriptions. That is, this method is invoked by consumer's constructor after everything else has been initialized. Reimplemented in alma::acs::nc::ArchiveConsumer, and alma::acs::nc::LoggingConsumer.
|
|
After invoking this method, the user has no control over when push_structured_event is invoked by the notification channel. User may still add and remove subscriptions at any given time though. Also, the connection can be suspended and resumed. Finally, consumerReady may spawn a thread to search for the channel if it does not already exist. Once the channel becomes available, all saved subscription are subscribed to and consumerReady is automatically invoked again.
|
|
createConsumer handles the CORBA creation of a consumer.
|
|
This method must be invoked before a component or client is destroyed. Failure to do so can cause remote memory leaks. Make sure it is not invoked multiple times. Once it has been called, events will no longer be received. Reimplemented in alma::acs::nc::CorbaReceiver.
|
|
Override this method to do some "housekeeping". Invoked by the CORBA Notification Service itself each time a Supplier subclass is destroyed. Do not call it from your code! |
|
This method returns a constant character pointer to the notification channel domain which is normally equivalent to acscommon::ALMADOMAIN. The sole reason this method is provided is to accomodate subclasses which subscribe/publish non-ICD style events (ACS archiving channel for example).In that case, the developer would override this method.
|
|
This method returns a constant character pointer to the "kind" of notification channel as registered with the naming service (i.e., the kind field of a CosNaming::Name) which is normally equivalent to acscommon::NC_KIND. The sole reason this method is provided is to accomodate subclasses which subscribe/publish non-ICD style events (ACS archiving channel for example).In that case, the developer would override this method.
Reimplemented in alma::acs::nc::ArchiveConsumer, and alma::acs::nc::LoggingConsumer.
|
|
This method returns a string to the type of filter constraint language to be used for filtering events which is normally equivalent to acsnc::FILTER_LANGUAGE_NAME. Override to change this behavior.
|
|
Returns a reference to this instance's helper. Not too useful outside this class.
|
|
Gets a reference to the event channel specified during construction.
|
|
This method gets a reference to the event channel. If it is not already registered with the naming service, it is created.
|
|
This method returns a the notify service name as registered with the CORBA Naming Service. This is normally equivalent to acscommon::ALMADOMAIN. The sole reason this method is provided is to accomodate subclasses which subscribe/publish non-ICD style events (ACS archiving channel for example).In that case, the developer would override this method.
Reimplemented in alma::acs::nc::ArchiveConsumer, and alma::acs::nc::LoggingConsumer.
|
|
A "smart" consumer will override this method to subscribe to new domain/type events as suppliers offer them. A fairly advanced feature. Do not call it from your code!
|
|
The method invoked each time an ICD-style event is received. Consumer subclasses must override this method. If receiver object(s) have been registered using the addSubscription method, this method does not need to be overriden.
Reimplemented in alma::nctest::clients::FridgeConsumer.
|
|
The method invoked each time an ICD-style event is received. Consumer subclasses must override this method or the other signature of processEvent (if they do not care about the EventDescription parameter). If receiver object(s) have been registered using the addSubscription method, this method does not need to be overriden.
|
|
As of ACS 3.0, override processEvent(Object) instead of this CORBA method. push_structured_event is what is called each time an event is received. Do not call it from your code!
Reimplemented in alma::acssampGUI::acssampGUIConsumer, cl::utfsm::samplingSystemUI::core::NotificationChannelSuscription, alma::acs::nc::ArchiveConsumer, alma::acs::nc::CorbaReceiver, and alma::acs::nc::LoggingConsumer.
|
|
Removes a single filter from this consumer. See deprecation comments on the addFilter method.
|
|
Remove a subscription from this consumer. After invoking this, events of the parameter's type will no longer be received.
|
|
Used to reenable the Consumer after a call to the This call has no effect if the consumer is not connected at all (see consumerReady()), or if it has not been suspended. |
|
Used to temporarily halt receiving events of all types.
If the consumer has been connected already (method consumerReady(), then after calling this method, incoming events will be buffered instead of being discarded; unexpired events will be received later, after a call to resume(). |
|
The default maximum amount of time an event handler is given to process event before an exception is logged. this is used when an enduser does *not* define the appropriate XML elements within the ACS CDB. see the inline doc on EventChannel.xsd for more info |
|
Whether sending of events should be logged |
|
Helper class used to manipulate CORBA anys |
|
There can be only one notification channel for any given consumer. Constructed on demand. |
|
|
|
The channel has exactly one name registered in the CORBA Naming Service. |
|
The channel notification service domain name, can be |
|
The consumer admin object used by consumers to get a reference to the structured supplier proxy. |
|
CORBA reference to ourself |
|
Contains a list of handler/receiver functions to be invoked when an event of a particular type is received. |
|
maps event names to the maximum amount of time allowed for receiver methods to complete. Time is given in floating point seconds. |
|
Provides access to the naming service among other things. |
|
Provides access to the ACS logging system. |
|
The supplier proxy we are connected to. |
|
|
|
|