Public Member Functions | Protected Member Functions | Protected Attributes

alma.acs.nc.refactored.NCPublisher Class Reference

Inheritance diagram for alma.acs.nc.refactored.NCPublisher:
alma.acs.nc.AcsEventPublisher alma.acs.nc.ReconnectableSubscriber

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

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

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 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.

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(), 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.


Member Function Documentation

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.

Returns:
string

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.

Returns:
string

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.

Parameters:
typeName The structured event's type_name.
eventName Name of the event.
Returns:
A pre-filled CORBA 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.

Returns:
string

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.

Parameters:
se A complete structured event
Exceptions:
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.

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 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.subscription_change ( EventType[]  added,
EventType[]  removed 
) throws InvalidEventType

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

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().

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().

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().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties