com.boylesoftware.cb2
Interface BroadcastMessagingProvider

All Known Implementing Classes:
HttpBCMProvider, LocalProvider, SocketHubBCMProvider

public interface BroadcastMessagingProvider

Interface for CB2 Broadcast Messaging provider implementations. CB2 Broadcast Messaging subsystem (the BCM), supported by the application context, helps building server clusters providing means for sending broadcast messages to application instances in the cluster. A BCM provider is an object behind application context's broadcastBCMMessage method, and that is the provider, which actually does all the work of the delivery of messages to the cluster members.

When provider receives a message for the local instance, it should call processBCMMessage on the application context to deliver it to the appropriate BCM terminal.

The provider implementation used by the application context is specified by com.boylesoftware.cb2.broadcastMessaging.provider.class application property.

CB2 has several BCM provider implementations packaged with it - see com.boylesoftware.cb2.bcmproviders.* packages.

Version:
$Id: BroadcastMessagingProvider.java,v 1.3 2004/04/16 21:43:27 levahim Exp $
Author:
Lev Himmelfarb
See Also:
ApplicationContext.broadcastBCMMessage(java.lang.String, java.io.Serializable), ApplicationContext.processBCMMessage(java.lang.String, java.lang.String, java.io.Serializable)

Field Summary
static java.lang.String LOG_SUBSYS
          Channel for the logger.
 
Method Summary
 void broadcastMessage(java.lang.String channelName, java.io.Serializable messageParam)
          Makes the provider to broadcast a message to all registered instances in the cluster including the local instance.
 void destroy()
          Destroys the provider and frees any used resources.
 void init(ApplicationContext appCtx)
          Initializes the provider.
 

Field Detail

LOG_SUBSYS

public static final java.lang.String LOG_SUBSYS
Channel for the logger. Provider implementations should use this channel name for logging.

See Also:
Constant Field Values
Method Detail

init

public void init(ApplicationContext appCtx)
          throws ApplicationException
Initializes the provider. The application context calls this method once just after the provider has been instantiated.

Parameters:
appCtx - reference to the application context.
Throws:
ApplicationException - if a serious error happens, the provider cannot be initialized and the application should shut down itself.

destroy

public void destroy()
Destroys the provider and frees any used resources. The application context calls this method once when it does not need the provider anymore, usually when the application goes down or is being reinitialized.


broadcastMessage

public void broadcastMessage(java.lang.String channelName,
                             java.io.Serializable messageParam)
Makes the provider to broadcast a message to all registered instances in the cluster including the local instance. Note, that depending on the BCM provider implementation this method may return before the message is actually delivered to the local, as well as to any remote cluster member.

Parameters:
channelName - name of the channel, to which the message is targeted.
messageParam - optional general purpose message parameter, may be null.


Copyright © 2002,2003,2004 - Boyle Software, Inc.