| org.springframework.jms.support.destination.JmsDestinationAccessor org.springframework.jms.listener.AbstractJmsListeningContainer
All known Subclasses: org.springframework.jms.listener.AbstractMessageListenerContainer,
Inner Class :public static class SharedConnectionNotInitializedException extends RuntimeException | |
Method Summary | |
public void | afterPropertiesSet() Delegates to
AbstractJmsListeningContainer.validateConfiguration() and
AbstractJmsListeningContainer.initialize() . | protected Connection | createSharedConnection() Create a shared Connection for this container. | public void | destroy() Calls
AbstractJmsListeningContainer.shutdown() when the BeanFactory destroys the container instance. | abstract protected void | doInitialize() Register any invokers within this container. | protected void | doRescheduleTask(Object task) Reschedule the given task object immediately. | abstract protected void | doShutdown() Close the registered invokers. | protected void | doStart() Start the shared Connection, if any, and notify all invoker tasks. | protected void | doStop() Notify all invoker tasks and stop the shared Connection, if any. | protected void | establishSharedConnection() Establish a shared Connection for this container. | final protected String | getBeanName() Return the bean name that this listener container has been assigned
in its containing bean factory, if any. | public String | getClientId() Return the JMS client ID for the shared Connection created and used
by this container, if any. | final protected Connection | getSharedConnection() Return the shared JMS Connection maintained by this container. | public void | initialize() Initialize this container. | final public boolean | isActive() Return whether this container is currently active,
that is, whether it has been set up but not shut down yet. | final public boolean | isRunning() Return whether this container is currently running,
that is, whether it has been started and not stopped yet. | protected void | prepareSharedConnection(Connection connection) Prepare the given Connection, which is about to be registered
as shared Connection for this container. | final protected void | refreshSharedConnection() Refresh the shared Connection that this container holds. | final protected boolean | rescheduleTaskIfNecessary(Object task) Take the given task object and reschedule it, either immediately if
this container is currently running, or later once this container
has been restarted. | public void | setAutoStartup(boolean autoStartup) Set whether to automatically start the container after initialization. | public void | setBeanName(String beanName) | public void | setClientId(String clientId) Specify the JMS client id for a shared Connection created and used
by this container.
Note that client ids need to be unique among all active Connections
of the underlying JMS provider. | abstract protected boolean | sharedConnectionEnabled() Return whether a shared JMS Connection should be maintained
by this container base class. | public void | shutdown() Stop the shared Connection, call
AbstractJmsListeningContainer.doShutdown() ,
and close this container. | public void | start() Start this container. | protected void | startSharedConnection() Start the shared Connection. | public void | stop() Stop this container. | protected void | stopSharedConnection() Stop the shared Connection. | protected void | validateConfiguration() Validate the configuration of this container.
The default implementation is empty. | final protected void | waitWhileNotRunning() Wait while this container is not running. |
lifecycleMonitor | final protected Object lifecycleMonitor(Code) | | |
sharedConnectionMonitor | final protected Object sharedConnectionMonitor(Code) | | |
createSharedConnection | protected Connection createSharedConnection() throws JMSException(Code) | | Create a shared Connection for this container.
The default implementation creates a standard Connection
and prepares it through
AbstractJmsListeningContainer.prepareSharedConnection .
the prepared Connection throws: JMSException - if the creation failed |
doInitialize | abstract protected void doInitialize() throws JMSException(Code) | | Register any invokers within this container.
Subclasses need to implement this method for their specific
invoker management process.
A shared JMS Connection, if any, will already have been
started at this point.
throws: JMSException - if registration failed See Also: AbstractJmsListeningContainer.getSharedConnection() |
doRescheduleTask | protected void doRescheduleTask(Object task)(Code) | | Reschedule the given task object immediately.
To be implemented by subclasses if they ever call
rescheduleTaskIfNecessary .
This implementation throws an UnsupportedOperationException.
Parameters: task - the task object to reschedule See Also: AbstractJmsListeningContainer.rescheduleTaskIfNecessary |
doShutdown | abstract protected void doShutdown() throws JMSException(Code) | | Close the registered invokers.
Subclasses need to implement this method for their specific
invoker management process.
A shared JMS Connection, if any, will automatically be closed
afterwards.
throws: JMSException - if shutdown failed See Also: AbstractJmsListeningContainer.shutdown() |
establishSharedConnection | protected void establishSharedConnection() throws JMSException(Code) | | Establish a shared Connection for this container.
The default implementation delegates to
AbstractJmsListeningContainer.createSharedConnection() ,
which does one immediate attempt and throws an exception if it fails.
Can be overridden to have a recovery process in place, retrying
until a Connection can be successfully established.
throws: JMSException - if thrown by JMS API methods |
getBeanName | final protected String getBeanName()(Code) | | Return the bean name that this listener container has been assigned
in its containing bean factory, if any.
|
getClientId | public String getClientId()(Code) | | Return the JMS client ID for the shared Connection created and used
by this container, if any.
|
isActive | final public boolean isActive()(Code) | | Return whether this container is currently active,
that is, whether it has been set up but not shut down yet.
|
isRunning | final public boolean isRunning()(Code) | | Return whether this container is currently running,
that is, whether it has been started and not stopped yet.
|
prepareSharedConnection | protected void prepareSharedConnection(Connection connection) throws JMSException(Code) | | Prepare the given Connection, which is about to be registered
as shared Connection for this container.
The default implementation sets the specified client id, if any.
Subclasses can override this to apply further settings.
Parameters: connection - the Connection to prepare throws: JMSException - if the preparation efforts failed See Also: AbstractJmsListeningContainer.getClientId() |
refreshSharedConnection | final protected void refreshSharedConnection() throws JMSException(Code) | | Refresh the shared Connection that this container holds.
Called on startup and also after an infrastructure exception
that occurred during invoker setup and/or execution.
throws: JMSException - if thrown by JMS API methods |
rescheduleTaskIfNecessary | final protected boolean rescheduleTaskIfNecessary(Object task)(Code) | | Take the given task object and reschedule it, either immediately if
this container is currently running, or later once this container
has been restarted.
If this container has already been shut down, the task will not
get rescheduled at all.
Parameters: task - the task object to reschedule whether the task has been rescheduled(either immediately or for a restart of this container) See Also: AbstractJmsListeningContainer.doRescheduleTask |
setAutoStartup | public void setAutoStartup(boolean autoStartup)(Code) | | Set whether to automatically start the container after initialization.
Default is "true"; set this to "false" to allow for manual startup
through the
AbstractJmsListeningContainer.start() method.
|
setClientId | public void setClientId(String clientId)(Code) | | Specify the JMS client id for a shared Connection created and used
by this container.
Note that client ids need to be unique among all active Connections
of the underlying JMS provider. Furthermore, a client id can only be
assigned if the original ConnectionFactory hasn't already assigned one.
See Also: javax.jms.Connection.setClientID See Also: AbstractJmsListeningContainer.setConnectionFactory |
startSharedConnection | protected void startSharedConnection() throws JMSException(Code) | | Start the shared Connection.
throws: JMSException - if thrown by JMS API methods See Also: javax.jms.Connection.start |
stopSharedConnection | protected void stopSharedConnection() throws JMSException(Code) | | Stop the shared Connection.
throws: JMSException - if thrown by JMS API methods See Also: javax.jms.Connection.start |
validateConfiguration | protected void validateConfiguration()(Code) | | Validate the configuration of this container.
The default implementation is empty. To be overridden in subclasses.
|
waitWhileNotRunning | final protected void waitWhileNotRunning()(Code) | | Wait while this container is not running.
To be called by asynchronous tasks that want to block
while the container is in stopped state.
|
|
|