org.springframework.flex.core
Class AbstractServiceConfigProcessor

java.lang.Object
  extended by org.springframework.flex.core.AbstractServiceConfigProcessor
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, MessageBrokerConfigProcessor
Direct Known Subclasses:
MessageServiceConfigProcessor, RemotingServiceConfigProcessor

public abstract class AbstractServiceConfigProcessor
extends java.lang.Object
implements MessageBrokerConfigProcessor, org.springframework.beans.factory.BeanFactoryAware

Base MessageBrokerConfigProcessor implementation for handling automatic Service registration with the MessageBroker

Author:
Jeremy Grelle

Nested Class Summary
protected static class AbstractServiceConfigProcessor.CustomSpringAdapter
          This is simply a marker to denote that a Spring-managed adapter will be injected at the proper initialization point.
 
Constructor Summary
AbstractServiceConfigProcessor()
           
 
Method Summary
protected abstract  void findDefaultChannel(flex.messaging.MessageBroker broker, flex.messaging.services.Service service)
          Find and set an appropriate default channel for the Service
protected abstract  java.lang.String getServiceAdapterClassName()
          Returns the class name of the default ServiceAdapter for the Service
protected abstract  java.lang.String getServiceAdapterId()
          Returns the default ServiceAdapter id for the Service
protected abstract  java.lang.String getServiceClassName()
          Returns the class name of the specific Service implementation being configured
protected abstract  java.lang.String getServiceId()
          Returns the default id for the Service being configured
 flex.messaging.MessageBroker processAfterStartup(flex.messaging.MessageBroker broker)
          Error checking is done on the started MessageBroker to ensure configuration was successful.
 flex.messaging.MessageBroker processBeforeStartup(flex.messaging.MessageBroker broker)
          The MessageBroker is checked to see if the Service has already been configured via the BlazeDS XML config.
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
          
 void setDefaultAdapterId(java.lang.String defaultAdapterId)
          Set the id for the default adapter to be installed in the Service.
 void setDefaultChannels(java.lang.String[] defaultChannels)
          Set the ids of the default channels to be set on the Service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractServiceConfigProcessor

public AbstractServiceConfigProcessor()
Method Detail

processAfterStartup

public flex.messaging.MessageBroker processAfterStartup(flex.messaging.MessageBroker broker)
Error checking is done on the started MessageBroker to ensure configuration was successful.

Specified by:
processAfterStartup in interface MessageBrokerConfigProcessor
Parameters:
broker - the started MessageBroker instance
Returns:
the modified MessageBroker
See Also:
MessageBrokerConfigProcessor.processAfterStartup(MessageBroker)

processBeforeStartup

public flex.messaging.MessageBroker processBeforeStartup(flex.messaging.MessageBroker broker)
The MessageBroker is checked to see if the Service has already been configured via the BlazeDS XML config. If no existing Service is found, one will be installed using the defined configuration properties of this class.

Specified by:
processBeforeStartup in interface MessageBrokerConfigProcessor
Parameters:
broker - the new MessageBroker instance
Returns:
the modified MessageBroker
See Also:
MessageBrokerConfigProcessor.processBeforeStartup(MessageBroker)

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                    throws org.springframework.beans.BeansException

Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Throws:
org.springframework.beans.BeansException

setDefaultAdapterId

public void setDefaultAdapterId(java.lang.String defaultAdapterId)
Set the id for the default adapter to be installed in the Service.

Parameters:
defaultAdapterId - the id to set for the adapter

setDefaultChannels

public void setDefaultChannels(java.lang.String[] defaultChannels)
Set the ids of the default channels to be set on the Service. If not set, the application-wide defaults will be used. If no application-wide defaults can be found, a best guess will be made using the first available channel with an appropriate endpoint.

Parameters:
defaultChannels - the ids of the default channels for the Service

findDefaultChannel

protected abstract void findDefaultChannel(flex.messaging.MessageBroker broker,
                                           flex.messaging.services.Service service)
Find and set an appropriate default channel for the Service

Parameters:
broker - the MessageBroker that controls the Service
service - the service being configured

getServiceAdapterClassName

protected abstract java.lang.String getServiceAdapterClassName()
Returns the class name of the default ServiceAdapter for the Service

Returns:
the default adapter class name

getServiceAdapterId

protected abstract java.lang.String getServiceAdapterId()
Returns the default ServiceAdapter id for the Service

Returns:
the default adapter id

getServiceClassName

protected abstract java.lang.String getServiceClassName()
Returns the class name of the specific Service implementation being configured

Returns:
the service class name

getServiceId

protected abstract java.lang.String getServiceId()
Returns the default id for the Service being configured

Returns:
the default service id