com.google.code.rees.scope.conversation.context
Class DefaultHttpConversationContextManagerProvider

java.lang.Object
  extended by com.google.code.rees.scope.conversation.context.DefaultHttpConversationContextManagerProvider
All Implemented Interfaces:
PostConstructable, HttpConversationContextManagerProvider, SchedulerProvider, Serializable

public class DefaultHttpConversationContextManagerProvider
extends Object
implements HttpConversationContextManagerProvider, SchedulerProvider

The default implementation of the HttpConversationContextManagerProvider

Author:
rees.byars
See Also:
Serialized Form

Field Summary
protected  ConversationContextFactory conversationContextFactory
           
protected  int maxInstances
           
protected  long monitoringFrequency
           
protected  int monitoringThreadPoolSize
           
protected  ScheduledExecutorService scheduler
           
protected  Lock schedulerGuard
           
 
Constructor Summary
DefaultHttpConversationContextManagerProvider()
           
 
Method Summary
protected  ConversationContextManager createContextManager(javax.servlet.http.HttpSession session)
           
 ConversationContextManager getManager(javax.servlet.http.HttpServletRequest request)
          Return the ConversationContextManager for this request
 ScheduledExecutorService getScheduler()
          
 void init()
           
 void setConversationContextFactory(ConversationContextFactory conversationContextFactory)
          set the ConversationContextFactory
 void setMaxInstances(int maxInstances)
          set the max number of instances of conversations
 void setMonitoringFrequency(long monitoringFrequency)
          set the frequency in milliseconds for monitoring timeouts
 void setMonitoringThreadPoolSize(int monitoringThreadPoolSize)
          The number of threads that will be used to monitor conversation timeouts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

monitoringFrequency

protected long monitoringFrequency

maxInstances

protected int maxInstances

monitoringThreadPoolSize

protected int monitoringThreadPoolSize

conversationContextFactory

protected ConversationContextFactory conversationContextFactory

scheduler

protected transient ScheduledExecutorService scheduler

schedulerGuard

protected Lock schedulerGuard
Constructor Detail

DefaultHttpConversationContextManagerProvider

public DefaultHttpConversationContextManagerProvider()
Method Detail

init

public void init()
Specified by:
init in interface PostConstructable

setMonitoringThreadPoolSize

@Property(value="conversation.monitoring.thread.pool.size")
public void setMonitoringThreadPoolSize(int monitoringThreadPoolSize)
The number of threads that will be used to monitor conversation timeouts

Specified by:
setMonitoringThreadPoolSize in interface HttpConversationContextManagerProvider

setMonitoringFrequency

@Property(value="conversation.monitoring.frequency")
public void setMonitoringFrequency(long monitoringFrequency)
set the frequency in milliseconds for monitoring timeouts

Specified by:
setMonitoringFrequency in interface HttpConversationContextManagerProvider

setMaxInstances

@Property(value="conversation.max.instances")
public void setMaxInstances(int maxInstances)
set the max number of instances of conversations

Specified by:
setMaxInstances in interface HttpConversationContextManagerProvider

setConversationContextFactory

@Component
public void setConversationContextFactory(ConversationContextFactory conversationContextFactory)
set the ConversationContextFactory

Specified by:
setConversationContextFactory in interface HttpConversationContextManagerProvider

getManager

public ConversationContextManager getManager(javax.servlet.http.HttpServletRequest request)
Return the ConversationContextManager for this request

Specified by:
getManager in interface HttpConversationContextManagerProvider
Returns:

getScheduler

public ScheduledExecutorService getScheduler()

Specified by:
getScheduler in interface SchedulerProvider

createContextManager

protected ConversationContextManager createContextManager(javax.servlet.http.HttpSession session)


Copyright © 2012-2013. All Rights Reserved.