Public Member Functions | |
NCPublisher (String channelName, ContainerServicesBase services) throws AcsJException | |
NCPublisher (String channelName, String channelNotifyServiceDomainName, ContainerServicesBase services) throws AcsJException | |
void | disconnect () |
void | subscription_change (EventType[] added, EventType[] removed) throws InvalidEventType |
void | disconnect_structured_push_supplier () |
void | publishEvent (IDLEntity customStruct) throws AcsJException |
void | reconnect (EventChannelFactory ecf) |
Protected Member Functions | |
String | getChannelKind () |
String | getChannelDomain () |
String | getNotificationFactoryName () |
void | publishCORBAEvent (StructuredEvent se) throws AcsJException |
StructuredEvent | getCORBAEvent (String typeName, String eventName) |
Protected Attributes | |
final Helper | helper |
final String | channelName |
final String | channelNotifyServiceDomainName |
SupplierAdmin | supplierAdmin |
StructuredProxyPushConsumer | proxyConsumer |
volatile long | count = 0 |
EventChannel | channel |
final Logger | logger |
final ContainerServicesBase | services |
final AnyAide | anyAide |
AcsNcReconnectionCallback | m_callback |
NCPublisher is the Notificaction Channel implementation to be used with the event channel API to publish events using the Java programming language.
alma.acs.nc.refactored.NCPublisher.NCPublisher | ( | String | channelName, | |
ContainerServicesBase | services | |||
) | throws AcsJException |
Creates a new instance of NCPublisher. Make sure you call disconnect() when you no longer need this event supplier object.
channelName | Name of the notification channel events will be published to. | |
services | This is used to get the name of the component and to access the ACS logging system. |
AcsJException | There are literally dozens of CORBA exceptions that could be thrown by the NCPublisher class. Instead, these are converted into an ACS Error System exception for the developer's convenience. |
References alma.acs.nc.refactored.NCPublisher.channelName, and alma.acs.nc.refactored.NCPublisher.services.
alma.acs.nc.refactored.NCPublisher.NCPublisher | ( | String | channelName, | |
String | channelNotifyServiceDomainName, | |||
ContainerServicesBase | services | |||
) | throws AcsJException |
Creates a new instance of SimpleSupplier. Make sure you call disconnect() when you no longer need this event supplier object.
channelName | name of the notification channel events will be published to. | |
channelNotifyServiceDomainName | Channel domain name, which is being used to determine notification service. | |
services | This is used to get the name of the component and to access the ACS logging system. |
AcsJException | There are literally dozens of CORBA exceptions that could be thrown by the SimpleSupplier class. Instead, these are converted into an ACS Error System exception for the developer's convenience. |
References alma.acs.container.ContainerServicesBase.activateOffShoot(), alma.acs.nc.refactored.NCPublisher.anyAide, alma.acs.nc.refactored.NCPublisher.channel, alma.acs.nc.refactored.NCPublisher.channelName, alma.acs.nc.refactored.NCPublisher.channelNotifyServiceDomainName, alma.acs.nc.refactored.NCPublisher.getChannelKind(), alma.acs.container.ContainerServicesBase.getLogger(), alma.acs.nc.refactored.NCPublisher.getNotificationFactoryName(), alma.acs.nc.refactored.NCPublisher.helper, alma.acs.nc.AcsNcReconnectionCallback.init(), alma.acs.nc.refactored.NCPublisher.logger, alma.acs.nc.refactored.NCPublisher.m_callback, alma.acs.nc.refactored.NCPublisher.proxyConsumer, alma.acs.nc.refactored.NCPublisher.services, and alma.acs.nc.refactored.NCPublisher.supplierAdmin.
void alma.acs.nc.refactored.NCPublisher.disconnect | ( | ) |
User code must call this method when the Supplier is no longer useful. Failure to do so can result in remote memory leaks. User should not call this method multiple times either. Once disconnect has been called, all of SimpleSupplier's methods will cease to function properly.
References alma.acs.nc.refactored.NCPublisher.channelName, alma.acs.container.ContainerServicesBase.deactivateOffShoot(), alma.acs.nc.refactored.NCPublisher.logger, alma.acs.nc.refactored.NCPublisher.proxyConsumer, alma.acs.nc.refactored.NCPublisher.services, and alma.acs.nc.refactored.NCPublisher.supplierAdmin.
void alma.acs.nc.refactored.NCPublisher.disconnect_structured_push_supplier | ( | ) |
Override this method to do something when a consumer unsubscribes from the channel. Do not call it from your code!
(HSO): The CORBA NC spec (3.3.10.1) says: The disconnect_structured_push_supplier operation is invoked to terminate a connection between the target StructuredPushSupplier and its associated consumer. This operation takes no input parameters and returns no values. The result of this operation is that the target StructuredPushSupplier will release all resources it had allocated to support the connection, and dispose its own object reference. Is it really true what the log message says, that one of many consumers has disconnected, and we should continue for our other consumers? It may be so, given that the life cycle of a SimpleSupplier seemss unaffected of consumers in the ACS NC design.
References alma.acs.nc.refactored.NCPublisher.channelName, and alma.acs.nc.refactored.NCPublisher.logger.
String alma.acs.nc.refactored.NCPublisher.getChannelDomain | ( | ) | [protected] |
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.
Referenced by alma.acs.nc.refactored.NCPublisher.getCORBAEvent().
String alma.acs.nc.refactored.NCPublisher.getChannelKind | ( | ) | [protected] |
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.
Referenced by alma.acs.nc.refactored.NCPublisher.NCPublisher().
StructuredEvent alma.acs.nc.refactored.NCPublisher.getCORBAEvent | ( | String | typeName, | |
String | eventName | |||
) | [protected] |
Method used to create a pre-filled CORBA event.
typeName | The structured event's type_name. | |
eventName | Name of the event. |
References alma.acs.nc.refactored.NCPublisher.getChannelDomain().
Referenced by alma.acs.nc.refactored.NCPublisher.publishEvent().
String alma.acs.nc.refactored.NCPublisher.getNotificationFactoryName | ( | ) | [protected] |
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.
References alma.acs.nc.refactored.NCPublisher.channelName, alma.acs.nc.refactored.NCPublisher.channelNotifyServiceDomainName, and alma.acs.nc.refactored.NCPublisher.helper.
Referenced by alma.acs.nc.refactored.NCPublisher.NCPublisher().
void alma.acs.nc.refactored.NCPublisher.publishCORBAEvent | ( | StructuredEvent | se | ) | throws AcsJException [protected] |
Method which publishes an entire CORBA StructuredEvent without making any modifications to it.
se | A complete structured event |
AcsJException | if the event cannot be published for some reason or another. |
References alma.acs.nc.refactored.NCPublisher.channelName, and alma.acs.nc.refactored.NCPublisher.proxyConsumer.
Referenced by alma.acs.nc.refactored.NCPublisher.publishEvent().
void alma.acs.nc.refactored.NCPublisher.publishEvent | ( | IDLEntity | customStruct | ) | throws AcsJException |
Takes a generic Java object and tries to pack it into a CORBA Any and publish it to the event channel. This will fail if the parameter is not CORBA-generated from a user-defined IDL struct. In simple terms, trying to publish native Java types is impossible because they have no CORBA mapping to say Python or C++ types.
customStruct | An instance of the IDL struct (Java class) to be published. |
AcsJException | There are an enormous amount of possibilities pertaining to why an AcsJException would be thrown by publishEvent. |
References alma.acs.nc.refactored.NCPublisher.anyAide, alma.acs.nc.refactored.NCPublisher.channelName, alma.acs.nc.AnyAide.complexObjectToCorbaAny(), alma.acs.nc.refactored.NCPublisher.count, alma.acs.container.ContainerServicesBase.getAdvancedContainerServices(), alma.acs.nc.refactored.NCPublisher.getCORBAEvent(), alma.acs.container.ContainerServicesBase.getName(), alma.acs.nc.refactored.NCPublisher.logger, alma.acs.nc.refactored.NCPublisher.publishCORBAEvent(), and alma.acs.nc.refactored.NCPublisher.services.
void alma.acs.nc.refactored.NCPublisher.reconnect | ( | EventChannelFactory | ecf | ) |
void alma.acs.nc.refactored.NCPublisher.subscription_change | ( | EventType[] | added, | |
EventType[] | removed | |||
) | throws InvalidEventType |
ACS does not provide an implementation of this method.
final AnyAide alma.acs.nc.refactored.NCPublisher.anyAide [protected] |
Helper class used to manipulate CORBA anys
Referenced by alma.acs.nc.refactored.NCPublisher.NCPublisher(), and alma.acs.nc.refactored.NCPublisher.publishEvent().
EventChannel alma.acs.nc.refactored.NCPublisher.channel [protected] |
Channel we'll be sending events to
Referenced by alma.acs.nc.refactored.NCPublisher.NCPublisher(), and alma.acs.nc.refactored.NCPublisher.reconnect().
final String alma.acs.nc.refactored.NCPublisher.channelName [protected] |
The event channel has exactly one name registered in the naming service.
Referenced by alma.acs.nc.refactored.NCPublisher.disconnect(), alma.acs.nc.refactored.NCPublisher.disconnect_structured_push_supplier(), alma.acs.nc.refactored.NCPublisher.getNotificationFactoryName(), alma.acs.nc.refactored.NCPublisher.NCPublisher(), alma.acs.nc.refactored.NCPublisher.publishCORBAEvent(), alma.acs.nc.refactored.NCPublisher.publishEvent(), and alma.acs.nc.refactored.NCPublisher.reconnect().
final String alma.acs.nc.refactored.NCPublisher.channelNotifyServiceDomainName [protected] |
The channel notification service domain name, can be null
.
Referenced by alma.acs.nc.refactored.NCPublisher.getNotificationFactoryName(), and alma.acs.nc.refactored.NCPublisher.NCPublisher().
volatile long alma.acs.nc.refactored.NCPublisher.count = 0 [protected] |
The total number of successful events published by this particular supplier. The current count is attached to the EventDescription that gets sent along as additional data (remainder_of_body).
Referenced by alma.acs.nc.refactored.NCPublisher.publishEvent().
final Helper alma.acs.nc.refactored.NCPublisher.helper [protected] |
Provides useful methods.
Referenced by alma.acs.nc.refactored.NCPublisher.getNotificationFactoryName(), alma.acs.nc.refactored.NCPublisher.NCPublisher(), and alma.acs.nc.refactored.NCPublisher.reconnect().
final Logger alma.acs.nc.refactored.NCPublisher.logger [protected] |
Provides access to the ACS logging system.
Referenced by alma.acs.nc.refactored.NCPublisher.disconnect(), alma.acs.nc.refactored.NCPublisher.disconnect_structured_push_supplier(), alma.acs.nc.refactored.NCPublisher.NCPublisher(), alma.acs.nc.refactored.NCPublisher.publishEvent(), and alma.acs.nc.refactored.NCPublisher.reconnect().
Referenced by alma.acs.nc.refactored.NCPublisher.NCPublisher().
StructuredProxyPushConsumer alma.acs.nc.refactored.NCPublisher.proxyConsumer [protected] |
The proxy consumer object used by supplier to push events onto the channel.
Referenced by alma.acs.nc.refactored.NCPublisher.disconnect(), alma.acs.nc.refactored.NCPublisher.NCPublisher(), and alma.acs.nc.refactored.NCPublisher.publishCORBAEvent().
final ContainerServicesBase alma.acs.nc.refactored.NCPublisher.services [protected] |
To access the ORB among other things
Referenced by alma.acs.nc.refactored.NCPublisher.disconnect(), alma.acs.nc.refactored.NCPublisher.NCPublisher(), and alma.acs.nc.refactored.NCPublisher.publishEvent().
SupplierAdmin alma.acs.nc.refactored.NCPublisher.supplierAdmin [protected] |
Supplier Admin object is responsible for creating & managing proxy consumers.
Referenced by alma.acs.nc.refactored.NCPublisher.disconnect(), and alma.acs.nc.refactored.NCPublisher.NCPublisher().