public abstract class AbstractDestinationFactory extends Object implements InitializingBean, DisposableBean, BeanNameAware, BeanFactoryAware, ServletConfigAware
| Constructor and Description |
|---|
AbstractDestinationFactory() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected void |
configureAdapter(flex.messaging.Destination destination)
Configure the service adapter for the destination.
|
protected abstract flex.messaging.Destination |
createDestination(String destinationId,
flex.messaging.MessageBroker broker)
Create a specific destination and add it to the
MessageBroker |
void |
destroy() |
protected abstract void |
destroyDestination(String destinationId,
flex.messaging.MessageBroker broker)
Stops and removes the specified destination from the
MessageBroker |
protected BeanFactory |
getBeanFactory()
Expose the BeanFactory to subclasses
|
protected String |
getDestinationId()
Returns the id for the destination created by this factory
|
protected abstract flex.messaging.services.Service |
getTargetService(flex.messaging.MessageBroker broker)
Returns the target
Service that will manage the destination |
protected abstract void |
initializeDestination(flex.messaging.Destination destination)
Perform any necessary initialization logic on the created
Destination |
void |
setBeanFactory(BeanFactory beanFactory) |
void |
setBeanName(String name) |
void |
setChannels(String[] channels)
Specify the BlazeDS channel ids (in order of preference) for communication with this destination
|
void |
setDestinationId(String destinationId)
Specify the id for the destination
|
void |
setMessageBroker(flex.messaging.MessageBroker broker)
Set the
MessageBroker where this destination will be created. |
void |
setServiceAdapter(String serviceAdapter)
Specify a custom service adapter id to be used by this destination
|
void |
setServletConfig(javax.servlet.ServletConfig servletConfig) |
public final void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic final void destroy()
throws Exception
destroy in interface DisposableBeanExceptionpublic void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory in interface BeanFactoryAwareBeansExceptionpublic void setBeanName(String name)
setBeanName in interface BeanNameAwarepublic void setChannels(String[] channels)
channels - an array of BlazeDS channel idspublic void setDestinationId(String destinationId)
destinationId - the id to setpublic void setMessageBroker(flex.messaging.MessageBroker broker)
MessageBroker where this destination will be created.broker - the message broker for this destinationpublic void setServiceAdapter(String serviceAdapter)
serviceAdapter - the custom service adapter idpublic void setServletConfig(javax.servlet.ServletConfig servletConfig)
setServletConfig in interface ServletConfigAwareprotected void configureAdapter(flex.messaging.Destination destination)
This implementation will first search the BeanFactory for a bean with a matching id and use it if found.
Otherwise the normal createAdapter method on the destination will be called.
May be overridden by subclasses that wish to specify custom adapter creation logic.
destination - the destination being createdprotected abstract flex.messaging.Destination createDestination(String destinationId, flex.messaging.MessageBroker broker) throws Exception
MessageBrokerdestinationId - the id of the destination to createbroker - the MessageBroker where the destination should be createdException - if the destination could not be created successfullyprotected abstract void destroyDestination(String destinationId, flex.messaging.MessageBroker broker) throws Exception
MessageBrokerdestinationId - the id of the destination being destroyedbroker - the MessageBroker from which the destination must be removedException - if the destination could not be destroyed successfullyprotected BeanFactory getBeanFactory()
protected String getDestinationId()
protected abstract flex.messaging.services.Service getTargetService(flex.messaging.MessageBroker broker)
Service that will manage the destinationbroker - the MessageBroker that controls the serviceCopyright © 2014. All rights reserved.