Platform SDK Java 8.5 API Reference

com.genesyslab.platform.applicationblocks.commons.broker
Class BrokerServiceFactory

java.lang.Object
  extended by com.genesyslab.platform.applicationblocks.commons.broker.BrokerServiceFactory

Deprecated. Message Broker Application Block is deprecated. Use setMessageHandler(handler) to handle incoming messages asynchronously.

@Deprecated
public final class BrokerServiceFactory
extends java.lang.Object

BrokerServiceFactory class implements factory for broker services, EventReceivingBrokerService and RequestReceivingBrokerService in particular.

Example:

[Java]
     StatServerProtocol statProtocol = ...;
     AsyncInvoker invoker = new SingleThreadInvoker("statEventHandler");
     EventReceivingBrokerService eventBroker =
             BrokerServiceFactory.createEventBroker(statProtocol, invoker);

     // register handler for the stat protocol messages:
     eventBroker.register(
         new MyStatAction(),
         new MessageFilter(statProtocol.getProtocolId())
     );
 

See Also:
EventReceivingBrokerService, RequestReceivingBrokerService

Constructor Summary
BrokerServiceFactory()
          Deprecated.  
 
Method Summary
static EventBrokerService CreateEventBroker(MessageReceiver receiver)
          Deprecated.  
static EventReceivingBrokerService createEventBroker(MessageReceiverManagement protocol, AsyncInvoker invoker)
          Deprecated. Creates broker service and initializes client protocol with it as with "external receiver".
static RequestBrokerService CreateRequestBroker(RequestReceiver receiver)
          Deprecated.  
static RequestReceivingBrokerService createRequestBroker(RequestReceiverManagement protocol, AsyncInvoker invoker)
          Deprecated. Creates broker service and initializes server channel with it as with "external receiver".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrokerServiceFactory

public BrokerServiceFactory()
Deprecated. 
Method Detail

CreateEventBroker

@Deprecated
public static EventBrokerService CreateEventBroker(MessageReceiver receiver)
Deprecated. 

Creates and activates instance of EventBrokerService class. Activated service contains internal running thread (SingleThreadInvoker) for messages handling purposes. So, when user application creates this service, it must deactivate and dispose it properly. Following methods can be used for this: MessageBrokerService.deactivate() and MessageBrokerService.dispose().

Parameters:
receiver - Initializes event message receiver
Returns:
Activated EventBrokerService instance
See Also:
MessageBrokerService.deactivate(), MessageBrokerService.dispose()

CreateRequestBroker

@Deprecated
public static RequestBrokerService CreateRequestBroker(RequestReceiver receiver)
Deprecated. 

Creates and activates instance of RequestBrokerService class. Activated service contains internal running thread (SingleThreadInvoker) for messages handling purposes. So, when user application creates this service, it must deactivate and dispose it properly. Following methods can be used for this: MessageBrokerService.deactivate() and MessageBrokerService.dispose().

Parameters:
receiver - Initializes event message receiver
Returns:
Activated ReqestBrokerService instance
See Also:
MessageBrokerService.deactivate(), MessageBrokerService.dispose()

createEventBroker

public static EventReceivingBrokerService createEventBroker(MessageReceiverManagement protocol,
                                                            AsyncInvoker invoker)
Deprecated. 
Creates broker service and initializes client protocol with it as with "external receiver".

It is possible to use created service for other protocol connections:

[Java]
     EventReceivingBrokerService eventBroker =
             BrokerServiceFactory.createEventBroker(statProtocol, invoker);

     ixnProtocol.setReceiver(eventBroker);
     routingProtocol.setReceiver(eventBroker);

     // register handler for the stat protocol messages:
     eventBroker.register(
         new MyStatAction(),
         new MessageFilter(statProtocol.getProtocolId())
     );

     // register handler for all of the protocols messages:
     eventBroker.register(
         new MyAction(), null);
     ...
 

Parameters:
protocol - client protocol connection to distribute messages from (usually it's some protocol connection)
invoker - invoker to be used for messages publishing
Returns:
initialized broker service instance
See Also:
MessageReceiverManagement.setReceiver(com.genesyslab.platform.commons.protocol.MessageReceiverSupport)

createRequestBroker

public static RequestReceivingBrokerService createRequestBroker(RequestReceiverManagement protocol,
                                                                AsyncInvoker invoker)
Deprecated. 
Creates broker service and initializes server channel with it as with "external receiver".

When the brokers' invoker handles some client message, all other clients/requests are waiting, so, server side handler must execute request messages fast and schedule long tasks to other threads.

Parameters:
protocol - server channel to distribute clients requests from (it can be some ServerChannel instance)
invoker - invoker to be used for requests messages handling
Returns:
initialized broker service instance
See Also:
RequestReceiverManagement.setReceiver(com.genesyslab.platform.commons.protocol.RequestReceiverSupport)

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.