is loaded.
The difference between plain and shared mode is only indicated by the buit in jerry spring
application context. The plain mode starts a jetty instance per web application instance. The
shared mode uses the same jetty instance for all web applications. The default is plain mode
as it is usually the simpler and preferred way to use it.
The web application started stores within the web servlet context several objects. It stores
all the beans defined within the optional pu.xml
under their respective bean
names (this allows to define a space within the pu.xml
and then get it from within
the servlet context). Other objects, such as the ClusterInfo
,
BeanLevelProperties
, and the acutal ApplicationContext
are also passed to the
servlet context.
Post processing of the web.xml
and jetty-web.xml
is perfomed allowing
to use ${...}
notation within them (for example, using system proeprties, deployed
properties, or ${clusterInfo...}
).
JMX in jetty can be enabled by passing a deployment property JETTY_JMX_PROP
. If set
to true
jetty will be configured with JMX. In plain mode, where there can be more
than one instnace of jetty within the same JVM, the domain each instnace will be registed under
will be gigaspaces.jetty.${clusterInfo.name}.${clusterInfo.runningNumberOffset1}
.
In shraed mode, where there is only one instance of jetty in a single JVM, jetty JMX will be registered
with a domain called gigaspaces.jetty
.
- Author:
- kimchy
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_JETTY_PU
public static final String DEFAULT_JETTY_PU
- The optional location where a jetty spring application context (responsible for configuring
jetty) will be loaded (within the processing unit). If does not exists, will load either the
plain or shared built in jetty configurations (controlled by
JETTY_INSTANCE_PROP
)
defaulting to plain.
- See Also:
- Constant Field Values
INTERNAL_JETTY_PU_PREFIX
public static final String INTERNAL_JETTY_PU_PREFIX
- See Also:
- Constant Field Values
INSTANCE_PLAIN
public static final String INSTANCE_PLAIN
- See Also:
- Constant Field Values
INSTANCE_SHARD
public static final String INSTANCE_SHARD
- See Also:
- Constant Field Values
JETTY_LOCATION_PREFIX_SYSPROP
public static final String JETTY_LOCATION_PREFIX_SYSPROP
- See Also:
- Constant Field Values
JETTY_INSTANCE_PROP
public static final String JETTY_INSTANCE_PROP
- See Also:
- Constant Field Values
JETTY_SESSIONS_URL
public static final String JETTY_SESSIONS_URL
- A deploy property that controls if Jetty will store the session on the Space. Just by specifying the
url it will automatically enable it.
- See Also:
- Constant Field Values
JETTY_SESSIONS_SCAVENGE_PERIOD
public static final String JETTY_SESSIONS_SCAVENGE_PERIOD
- How often the scavenger thread will run in order to check for expired sessions. Set in
seconds and defaults to
60 * 5
seconds (5 minutes).
- See Also:
- Constant Field Values
JETTY_SESSIONS_SAVE_PERIOD
public static final String JETTY_SESSIONS_SAVE_PERIOD
- How often an actual update of a non dirty session will be performed to the Space. Set in
seconds and defaults to
60
seconds.
- See Also:
- Constant Field Values
JETTY_SESSIONS_LEASE
public static final String JETTY_SESSIONS_LEASE
- The lease of the
SessionData
that is written to the Space. Set
in seconds and defaults to FOREVER.
- See Also:
- Constant Field Values
JETTY_SESSIONS_TIMEOUT
public static final String JETTY_SESSIONS_TIMEOUT
- Controls, using a deployment property, the timeout value of sessions. Set in minutes.
- See Also:
- Constant Field Values
JETTY_JMX_PROP
public static final String JETTY_JMX_PROP
- The deployment property controlling if JMX is enabled or not. Defaults to
false
(JMX is disabled).
- See Also:
- Constant Field Values
JettyJeeProcessingUnitContainerProvider
public JettyJeeProcessingUnitContainerProvider()
getCurrentApplicationContext
public static ApplicationContext getCurrentApplicationContext()
- Allows to get the current application context (loaded from
pu.xml
) during web application
startup. Can be used to access beans defined within it (like a Space) by components loaded (such as
session storage). Note, this is only applicable during web application startup. It is cleared right
afterwards.
getCurrentClusterInfo
public static ClusterInfo getCurrentClusterInfo()
getCurrentBeanLevelProperties
public static BeanLevelProperties getCurrentBeanLevelProperties()
setParentContext
public void setParentContext(ApplicationContext parentContext)
- Sets Spring parent
ApplicationContext
that will be used
when constructing this processing unit application context.
setBeanLevelProperties
public void setBeanLevelProperties(BeanLevelProperties beanLevelProperties)
- Sets the
BeanLevelProperties
that will be used to
configure this processing unit. When constructing the container this provider will
automatically add to the application context both
BeanLevelPropertyBeanPostProcessor
and
BeanLevelPropertyPlaceholderConfigurer
based on this
bean level properties.
- Specified by:
setBeanLevelProperties
in interface BeanLevelPropertiesAware
setClusterInfo
public void setClusterInfo(ClusterInfo clusterInfo)
- Sets the
ClusterInfo
that will be used to configure this
processing unit. When constructing the container this provider will automatically add to the
application context the ClusterInfoBeanPostProcessor
in
order to allow injection of cluster info into beans that implement
ClusterInfoAware
.
- Specified by:
setClusterInfo
in interface ClusterInfoAware
- Parameters:
clusterInfo
- The cluster information to be injected
setClassLoader
public void setClassLoader(ClassLoader classLoader)
- Sets the class loader this processing unit container will load the application context with.
addConfigLocation
public void addConfigLocation(Resource resource)
- Adds a config location using Springs
Resource
abstraction. This config location represents a Spring xml context.
Note, once a config location is added that default location used when no config location is
defined won't be used (the default location is classpath*:/META-INF/spring/pu.xml
).
- Specified by:
addConfigLocation
in interface ApplicationContextProcessingUnitContainerProvider
addConfigLocation
public void addConfigLocation(String path)
throws IOException
- Adds a config location based on a String description using Springs
PathMatchingResourcePatternResolver
.
- Specified by:
addConfigLocation
in interface ApplicationContextProcessingUnitContainerProvider
- Throws:
IOException
- See Also:
PathMatchingResourcePatternResolver
setDeployPath
public void setDeployPath(File warPath)
- Sets the deploy path where the exploded war jetty will work with is located.
- Specified by:
setDeployPath
in interface DeployableProcessingUnitContainerProvider
createContainer
public ProcessingUnitContainer createContainer()
throws CannotCreateContainerException
- See the header javadoc.
- Specified by:
createContainer
in interface ProcessingUnitContainerProvider
- Returns:
- A newly created processing unit container.
- Throws:
CannotCreateContainerException
Copyright © GigaSpaces.