alma::acs::nc::refactored::NCPublisher Class Reference

Inheritance diagram for alma::acs::nc::refactored::NCPublisher:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::nc::refactored::NCPublisher:
Collaboration graph
[legend]

List of all members.

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

Private Attributes

final boolean isTraceEventsEnabled
IntHolder supplierAdminID
IntHolder proxyID

Detailed Description

NCPublisher is the Notificaction Channel implementation to be used with the event channel API to publish events using the Java programming language.

Author:
jslopez

Constructor & Destructor Documentation

alma::acs::nc::refactored::NCPublisher::NCPublisher ( String  channelName,
ContainerServicesBase  services 
) throws AcsJException [inline]

Creates a new instance of NCPublisher. Make sure you call disconnect() when you no longer need this event supplier object.

Parameters:
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.
Exceptions:
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 channelName, and services.

alma::acs::nc::refactored::NCPublisher::NCPublisher ( String  channelName,
String  channelNotifyServiceDomainName,
ContainerServicesBase  services 
) throws AcsJException [inline]

Creates a new instance of SimpleSupplier. Make sure you call disconnect() when you no longer need this event supplier object.

Parameters:
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.
Exceptions:
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(), anyAide, channel, channelName, channelNotifyServiceDomainName, getChannelKind(), alma::acs::nc::Helper::getChannelProperties(), alma::acs::container::ContainerServicesBase::getLogger(), alma::acs::nc::Helper::getNotificationChannel(), getNotificationFactoryName(), alma::acs::nc::Helper::getNotifyFactory(), helper, alma::acs::nc::AcsNcReconnectionCallback::init(), alma::acs::nc::ChannelProperties::isTraceEventsEnabled(), isTraceEventsEnabled, logger, m_callback, proxyConsumer, proxyID, services, supplierAdmin, and supplierAdminID.


Member Function Documentation

void alma::acs::nc::refactored::NCPublisher::disconnect (  )  [inline]

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 channelName, alma::acs::container::ContainerServicesBase::deactivateOffShoot(), logger, proxyConsumer, services, and supplierAdmin.

void alma::acs::nc::refactored::NCPublisher::disconnect_structured_push_supplier (  )  [inline]

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 channelName, and logger.

String alma::acs::nc::refactored::NCPublisher::getChannelDomain (  )  [inline, 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.

Returns:
string

Referenced by getCORBAEvent().

String alma::acs::nc::refactored::NCPublisher::getChannelKind (  )  [inline, 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.

Returns:
string

Referenced by NCPublisher().

StructuredEvent alma::acs::nc::refactored::NCPublisher::getCORBAEvent ( String  typeName,
String  eventName 
) [inline, protected]

Method used to create a pre-filled CORBA event.

Parameters:
typeName The structured event's type_name.
eventName Name of the event.
Returns:
A pre-filled CORBA event.

References getChannelDomain().

Referenced by publishEvent().

String alma::acs::nc::refactored::NCPublisher::getNotificationFactoryName (  )  [inline, 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.

Returns:
string

References channelName, channelNotifyServiceDomainName, alma::acs::nc::Helper::getNotificationFactoryNameForChannel(), and helper.

Referenced by NCPublisher().

void alma::acs::nc::refactored::NCPublisher::publishCORBAEvent ( StructuredEvent  se  )  throws AcsJException [inline, protected]

Method which publishes an entire CORBA StructuredEvent without making any modifications to it.

Parameters:
se A complete structured event
Exceptions:
AcsJException if the event cannot be published for some reason or another.

References channelName, proxyConsumer, alma::ACSErrTypeCommon::wrappers::AcsJCORBAProblemEx::setInfo(), and alma::ACSErrTypeCommon::wrappers::AcsJCORBAProblemEx::setMinor().

Referenced by publishEvent().

void alma::acs::nc::refactored::NCPublisher::publishEvent ( IDLEntity  customStruct  )  throws AcsJException [inline]

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.

Parameters:
customStruct An instance of the IDL struct (Java class) to be published.
Exceptions:
AcsJException There are an enormous amount of possibilities pertaining to why an AcsJException would be thrown by publishEvent.

References anyAide, channelName, alma::acs::nc::AnyAide::complexObjectToCorbaAny(), count, alma::acs::container::ContainerServicesBase::getAdvancedContainerServices(), alma::acs::container::AdvancedContainerServices::getAny(), getCORBAEvent(), alma::acs::container::ContainerServicesBase::getName(), isTraceEventsEnabled, logger, publishCORBAEvent(), and services.

Referenced by alma::acs::nc::refactored::NCPublisherTest::testPublisherSendingEvents().

void alma::acs::nc::refactored::NCPublisher::reconnect ( EventChannelFactory  ecf  )  [inline]
void alma::acs::nc::refactored::NCPublisher::subscription_change ( EventType[]  added,
EventType[]  removed 
) throws InvalidEventType [inline]

ACS does not provide an implementation of this method.

See also:
org.omg.CosNotifyComm.NotifySubscribeOperations::subscription_change(org.omg.CosNotification.EventType[], org.omg.CosNotification.EventType[])

Member Data Documentation

Helper class used to manipulate CORBA anys

Referenced by NCPublisher(), and publishEvent().

Channel we'll be sending events to

Referenced by NCPublisher(), and reconnect().

The event channel has exactly one name registered in the naming service.

Referenced by disconnect(), disconnect_structured_push_supplier(), getNotificationFactoryName(), NCPublisher(), publishCORBAEvent(), publishEvent(), and reconnect().

The channel notification service domain name, can be null.

Referenced by getNotificationFactoryName(), and 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 publishEvent(), and alma::acs::nc::refactored::NCPublisherTest::testPublisherSendingEvents().

Provides useful methods.

Referenced by getNotificationFactoryName(), NCPublisher(), and reconnect().

Whether sending of events should be logged

Referenced by NCPublisher(), and publishEvent().

Provides access to the ACS logging system.

Referenced by disconnect(), disconnect_structured_push_supplier(), NCPublisher(), publishEvent(), and reconnect().

Referenced by NCPublisher().

StructuredProxyPushConsumer alma::acs::nc::refactored::NCPublisher::proxyConsumer [protected]

The proxy consumer object used by supplier to push events onto the channel.

Referenced by disconnect(), NCPublisher(), and publishCORBAEvent().

Referenced by NCPublisher().

To access the ORB among other things

Referenced by disconnect(), NCPublisher(), and publishEvent().

Supplier Admin object is responsible for creating & managing proxy consumers.

Referenced by disconnect(), and NCPublisher().

Referenced by NCPublisher().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2