org.marketcetera.ors.config
Class SpringConfig

java.lang.Object
  extended by org.marketcetera.ors.config.SpringConfig
All Implemented Interfaces:
InitializingBean

public class SpringConfig
extends Object
implements InitializingBean

The application's Spring-based configuration. A global singleton instance of this class is created by Spring during the creation of the application's ApplicationContext, and it contains all end-user configuration of the application.

Since:
1.0.0
Version:
$Id: SpringConfig.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Constructor Summary
SpringConfig()
          Creates a new application configuration, which becomes the global singleton.
SpringConfig(SpringBrokers brokers, SpringSelector selector, MessageFilter supportedMessages, OrderFilter allowedOrders, String serverHost, int serverPort, long serverSessionLife, ConnectionFactory incomingCF, ConnectionFactory outgoingCF, IDFactory idFactory, ReportHistoryServices reportHistoryServices, OrderInfoCache orderInfoCache)
          Creates a new application configuration with the given properties.
 
Method Summary
 void afterPropertiesSet()
           
 OrderFilter getAllowedOrders()
          Returns the receiver's filter of allowed orders.
 SpringBrokers getBrokers()
          Returns the receiver's broker configurations.
 IDFactory getIDFactory()
          Returns the receiver's ID generation factory.
 ConnectionFactory getIncomingConnectionFactory()
          Returns the receiver's connection factory for incoming connections.
 OrderInfoCache getOrderInfoCache()
          Returns the receiver's order information cache.
 ConnectionFactory getOutgoingConnectionFactory()
          Returns the receiver's connection factory for outgoing connections.
 ReportHistoryServices getReportHistoryServices()
          Returns the receiver's report history services provider.
 SpringSelector getSelector()
          Returns the receiver's broker selector.
 String getServerHost()
          Returns the receiver's host name for web services.
 int getServerPort()
          Returns the receiver's port for web services.
 long getServerSessionLife()
          Returns the receiver's web services session lifetime.
static SpringConfig getSingleton()
          Returns the global singleton configuration.
 MessageFilter getSupportedMessages()
          Returns the receiver's filter of supported messages.
 void setAllowedOrders(OrderFilter allowedOrders)
          Sets the receiver's filter of allowed orders to the given one.
 void setBrokers(SpringBrokers brokers)
          Sets the receiver's broker configurations to the given ones.
 void setIDFactory(IDFactory idFactory)
          Sets the receiver's ID generation factory to the given one.
 void setIncomingConnectionFactory(ConnectionFactory incomingCF)
          Sets the receiver's connection factory for incoming connections to the given one.
 void setOrderInfoCache(OrderInfoCache orderInfoCache)
          Sets the receiver's order information cache to the given one.
 void setOutgoingConnectionFactory(ConnectionFactory outgoingCF)
          Sets the receiver's connection factory for outgoing connections to the given one.
 void setReportHistoryServices(ReportHistoryServices reportHistoryServices)
          Sets the receiver's report history services provider to the given one.
 void setSelector(SpringSelector selector)
          Sets the receiver's broker selector to the given one.
 void setServerHost(String serverHost)
          Sets the receiver's host name for web services to the given value.
 void setServerPort(int serverPort)
          Sets the receiver's port for web services to the given value.
 void setServerSessionLife(long serverSessionLife)
          Sets the receiver's web services session lifetime to the given value.
static void setSingleton(SpringConfig singleton)
          Sets the global singleton configuration to the given one.
 void setSupportedMessages(MessageFilter supportedMessages)
          Sets the receiver's filter of supported messages to the given one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringConfig

public SpringConfig()
Creates a new application configuration, which becomes the global singleton.


SpringConfig

public SpringConfig(SpringBrokers brokers,
                    SpringSelector selector,
                    MessageFilter supportedMessages,
                    OrderFilter allowedOrders,
                    String serverHost,
                    int serverPort,
                    long serverSessionLife,
                    ConnectionFactory incomingCF,
                    ConnectionFactory outgoingCF,
                    IDFactory idFactory,
                    ReportHistoryServices reportHistoryServices,
                    OrderInfoCache orderInfoCache)
             throws I18NException
Creates a new application configuration with the given properties. The new configuration becomes the global singleton.

Parameters:
brokers - The broker configurations.
selector - The broker selector.
supportedMessages - The filter of supported messages.
allowedOrders - The filter of allowed orders.
serverHost - The host name for web services.
serverPort - The port for web services.
serverSessionLife - The web services session lifetime, in seconds.
incomingCF - The connection factory for incoming connections.
outgoingCF - The connection factory for outgoing connections.
idFactory - The ID generation factory.
reportHistoryServices - The report history services provider.
orderInfoCache - The order info cache.
Throws:
I18NException
Method Detail

setSingleton

public static void setSingleton(SpringConfig singleton)
Sets the global singleton configuration to the given one.

Parameters:
singleton - The configuration. It may be null.

getSingleton

public static SpringConfig getSingleton()
Returns the global singleton configuration.

Returns:
The configuration. It may be null.

setBrokers

public void setBrokers(SpringBrokers brokers)
Sets the receiver's broker configurations to the given ones. A non-null value should be set during the receiver's initialization.

Parameters:
brokers - The configurations.

getBrokers

public SpringBrokers getBrokers()
Returns the receiver's broker configurations.

Returns:
The configurations.

setSelector

public void setSelector(SpringSelector selector)
Sets the receiver's broker selector to the given one. A non-null value should be set during the receiver's initialization.

Parameters:
selector - The selector.

getSelector

public SpringSelector getSelector()
Returns the receiver's broker selector.

Returns:
The selector.

setSupportedMessages

public void setSupportedMessages(MessageFilter supportedMessages)
Sets the receiver's filter of supported messages to the given one. If this method is not called during initialization, the filter defaults to a MessageFilterNoop.

Parameters:
supportedMessages - The filter.

getSupportedMessages

public MessageFilter getSupportedMessages()
Returns the receiver's filter of supported messages.

Returns:
The filter.

setAllowedOrders

public void setAllowedOrders(OrderFilter allowedOrders)
Sets the receiver's filter of allowed orders to the given one. If this method is not called during initialization, the filter defaults to a OrderFilterNoop.

Parameters:
allowedOrders - The filter.

getAllowedOrders

public OrderFilter getAllowedOrders()
Returns the receiver's filter of allowed orders.

Returns:
The filter.

setServerHost

public void setServerHost(String serverHost)
Sets the receiver's host name for web services to the given value. If this method is not called during initialization, the host name defaults to Node.DEFAULT_HOST.

Parameters:
serverHost - The host name.

getServerHost

public String getServerHost()
Returns the receiver's host name for web services.

Returns:
The host name.

setServerPort

public void setServerPort(int serverPort)
Sets the receiver's port for web services to the given value. If this method is not called during initialization, the port defaults to Node.DEFAULT_PORT.

Parameters:
serverPort - The port.

getServerPort

public int getServerPort()
Returns the receiver's port for web services.

Returns:
The port.

setServerSessionLife

public void setServerSessionLife(long serverSessionLife)
Sets the receiver's web services session lifetime to the given value. If this method is not called during initialization, the lifetime defaults to SessionManager.INFINITE_SESSION_LIFESPAN.

Parameters:
serverSessionLife - The lifetime, in seconds.

getServerSessionLife

public long getServerSessionLife()
Returns the receiver's web services session lifetime.

Returns:
The lifetime, in seconds.

setIncomingConnectionFactory

public void setIncomingConnectionFactory(ConnectionFactory incomingCF)
Sets the receiver's connection factory for incoming connections to the given one. A non-null value should be set during the receiver's initialization.

Parameters:
incomingCF - The factory.

getIncomingConnectionFactory

public ConnectionFactory getIncomingConnectionFactory()
Returns the receiver's connection factory for incoming connections.

Returns:
The factory.

setOutgoingConnectionFactory

public void setOutgoingConnectionFactory(ConnectionFactory outgoingCF)
Sets the receiver's connection factory for outgoing connections to the given one. A non-null value should be set during the receiver's initialization.

Parameters:
outgoingCF - The factory.

getOutgoingConnectionFactory

public ConnectionFactory getOutgoingConnectionFactory()
Returns the receiver's connection factory for outgoing connections.

Returns:
The factory.

setIDFactory

public void setIDFactory(IDFactory idFactory)
Sets the receiver's ID generation factory to the given one. A non-null value should be set during the receiver's initialization.

Parameters:
idFactory - The factory.

getIDFactory

public IDFactory getIDFactory()
Returns the receiver's ID generation factory.

Returns:
The factory.

setReportHistoryServices

public void setReportHistoryServices(ReportHistoryServices reportHistoryServices)
Sets the receiver's report history services provider to the given one. A non-null value should be set during the receiver's initialization.

Parameters:
reportHistoryServices - The provider.

getReportHistoryServices

public ReportHistoryServices getReportHistoryServices()
Returns the receiver's report history services provider.

Returns:
The provider.

setOrderInfoCache

public void setOrderInfoCache(OrderInfoCache orderInfoCache)
Sets the receiver's order information cache to the given one. A non-null value should be set during the receiver's initialization.

Parameters:
orderInfoCache - The cache.

getOrderInfoCache

public OrderInfoCache getOrderInfoCache()
Returns the receiver's order information cache.

Returns:
The cache.

afterPropertiesSet

public void afterPropertiesSet()
                        throws I18NException
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
I18NException


Copyright © 2012. All Rights Reserved.