|
GigaSpaces XAP 7.0 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openspaces.pu.container.jee.glassfish.GlassfishJeeProcessingUnitContainerProvider
public class GlassfishJeeProcessingUnitContainerProvider
A container allowing to support Glassfish V3 prelude embedded as a web container.
The glassfish server is a shared one between all applications. The first application deployed will start the glassfish server. The last one undeployed will stop it (though currently it is not closed properly).
Since there is no way to cleanly stop glassfish (currently), a port is assigned to glassfish on creation
and is used throughout the lifecycle of the JVM. The port starts from 9008 (can be set using com.gs.glassfish.port
system property) and tries for 20 times until it manages to find a usuable port. Finding usuable ports is done through
locks on files, so it only works for used ports between different JVMs that use this container. Files are used since
it is not possible to start stop glassfish cleanly now.
The glassfish work directory is created under GSHOME/work/glassfish/[portNumber].
A glassfish domain.xml file is used in order to configure the glassfish instance. By default, it is
located under GSHOME/lib/glassfish/domain.xml and can be changed using com.gs.glassfish.domainXml
system property. The domain xml uses a single main GigaSpaces property called com.gs.glassfish.port and is
changed dynamically and created under the glassfish work directory (generated-domain.xml).
Note, this overrides the built in Glassfish Server code so it won't generate dynamically
the http listener and virtual server. This allows for greater control over how the Glassfish is conifugred by exposing
the full domain xml to the user.
Any other ${...} notation will be replaced (if possible) in the domain.xml file using context propertes as well.
| Field Summary | |
|---|---|
static String |
DEFAULT_GLASSFISH_PU
|
static String |
GLASSFISH_LOCATION_PREFIX_SYSPROP
|
static String |
INSTANCE_SHARD
|
static String |
INTERNAL_GLASSFISH_PU_PREFIX
|
| Fields inherited from interface org.openspaces.pu.container.jee.JeeProcessingUnitContainerProvider |
|---|
APPLICATION_CONTEXT_CONTEXT, BEAN_LEVEL_PROPERTIES_CONTEXT, CLUSTER_INFO_CONTEXT |
| Fields inherited from interface org.openspaces.pu.container.spi.ApplicationContextProcessingUnitContainerProvider |
|---|
DEFAULT_FS_PU_CONTEXT_LOCATION, DEFAULT_PU_CONTEXT_LOCATION |
| Fields inherited from interface org.openspaces.pu.container.DeployableProcessingUnitContainerProvider |
|---|
CONTEXT_PROPERTY_DEPLOY_PATH |
| Constructor Summary | |
|---|---|
GlassfishJeeProcessingUnitContainerProvider()
|
|
| Method Summary | |
|---|---|
void |
addConfigLocation(Resource resource)
Adds a config location using Springs Resource
abstraction. |
void |
addConfigLocation(String path)
Adds a config location based on a String description using Springs PathMatchingResourcePatternResolver. |
ProcessingUnitContainer |
createContainer()
Creates a processing unit container. |
static com.sun.enterprise.deploy.shared.ArchiveFactory |
getArchiveFactory(org.glassfish.embed.Server server)
|
static com.sun.enterprise.v3.services.impl.GrizzlyService |
getGrizzlyService(org.glassfish.embed.Server server)
|
static com.sun.appserv.management.monitor.statistics.HTTPListenerStats |
getHTTPListenerStats(org.glassfish.embed.Server server)
|
void |
setBeanLevelProperties(BeanLevelProperties beanLevelProperties)
Sets the BeanLevelProperties that will be used to
configure this processing unit. |
void |
setClassLoader(ClassLoader classLoader)
Sets the class loader this processing unit container will load the application context with. |
void |
setClusterInfo(ClusterInfo clusterInfo)
Sets the ClusterInfo that will be used to configure this
processing unit. |
void |
setDeployPath(File warPath)
Sets the deploy path where the exploded war jetty will work with is located. |
void |
setParentContext(ApplicationContext parentContext)
Sets Spring parent ApplicationContext that will be used
when constructing this processing unit application context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_GLASSFISH_PU
public static final String INTERNAL_GLASSFISH_PU_PREFIX
public static final String INSTANCE_SHARD
public static final String GLASSFISH_LOCATION_PREFIX_SYSPROP
| Constructor Detail |
|---|
public GlassfishJeeProcessingUnitContainerProvider()
| Method Detail |
|---|
public void setParentContext(ApplicationContext parentContext)
ApplicationContext that will be used
when constructing this processing unit application context.
public void setBeanLevelProperties(BeanLevelProperties beanLevelProperties)
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.
setBeanLevelProperties in interface BeanLevelPropertiesAwarepublic void setClusterInfo(ClusterInfo clusterInfo)
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.
setClusterInfo in interface ClusterInfoAwareclusterInfo - The cluster information to be injectedpublic void setClassLoader(ClassLoader classLoader)
setClassLoader in interface ClassLoaderAwareProcessingUnitContainerProviderpublic void addConfigLocation(Resource resource)
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).
addConfigLocation in interface ApplicationContextProcessingUnitContainerProvider
public void addConfigLocation(String path)
throws IOException
PathMatchingResourcePatternResolver.
addConfigLocation in interface ApplicationContextProcessingUnitContainerProviderIOExceptionPathMatchingResourcePatternResolverpublic void setDeployPath(File warPath)
setDeployPath in interface DeployableProcessingUnitContainerProvider
public ProcessingUnitContainer createContainer()
throws CannotCreateContainerException
ProcessingUnitContainerProvider
createContainer in interface ProcessingUnitContainerProviderCannotCreateContainerException
public static com.sun.enterprise.deploy.shared.ArchiveFactory getArchiveFactory(org.glassfish.embed.Server server)
throws Exception
Exception
public static com.sun.appserv.management.monitor.statistics.HTTPListenerStats getHTTPListenerStats(org.glassfish.embed.Server server)
throws Exception
Exception
public static com.sun.enterprise.v3.services.impl.GrizzlyService getGrizzlyService(org.glassfish.embed.Server server)
throws Exception
Exception
|
GigaSpaces XAP 7.0 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||