|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.web.deployers.AbstractWarDeployment
public abstract class AbstractWarDeployment
An abstract web app deployment bean. Subclasses implement:
- init(Object) to initialize from the deployment configuration java bean passed
in from the AbstractWarDeployer instance.
- performDeploy(WebApplication webApp, String warUrl) to translate the
WebApplication data into a running web application. This is called when the
AbstractWarDeployment is started.
- performUndeploy(WebApplication webApp, String warUrl) to remove the application
corresponding to the WebApplication data. This is called when the
AbstractWarDeployment is stopped.
The one thing to be aware of is the relationship between the thread context
class loader and the JNDI ENC context. Any method that attempts to access
the JNDI ENC context must have the ClassLoader in the WebApplication returned
from the performDeploy
as its thread
context ClassLoader or else the lookup for java:comp/env will fail with a
name not found exception, or worse, it will receive some other web application
ENC context.
TODO: the enc should be managed outside of the container without relying
on the TCL behavior.
Field Summary | |
---|---|
protected String |
defaultSecurityDomain
The default security-domain name to use |
static String |
ERROR
|
protected boolean |
java2ClassLoadingCompliance
The parent class loader first model flag |
protected org.jboss.kernel.Kernel |
kernel
|
protected boolean |
lenientEjbLink
If true, ejb-links that don't resolve don't cause an error (fallback to jndi-name) |
protected org.jboss.logging.Logger |
log
|
protected org.jboss.deployers.structure.spi.main.MainDeployerStructure |
mainDeployer
|
protected org.jboss.security.authorization.PolicyRegistration |
policyRegistration
The Security PolicyRegistration |
protected String |
policyRegistrationName
The Security PolicyRegistration Name |
protected ISecurityManagement |
securityManagement
The security management |
protected String |
securityManagementName
The security management name |
protected MBeanServer |
server
|
protected org.jboss.deployers.structure.spi.DeploymentUnit |
unit
|
protected boolean |
unpackWars
A flag indicating if war archives should be unpacked |
Constructor Summary | |
---|---|
AbstractWarDeployment()
|
Method Summary | |
---|---|
protected void |
addEnvEntries(org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData envEntries,
Context envCtx)
|
static void |
bindEnvEntry(Context ctx,
org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData entry)
|
String[] |
getCompileClasspath(ClassLoader loader)
A utility method that walks up the ClassLoader chain starting at the given loader and queries each ClassLoader for a 'URL[] getURLs()' method from which a complete classpath of URL strings is built. |
String |
getDefaultSecurityDomain()
Get the default security domain implementation to use if a war does not declare a security-domain. |
boolean |
getJava2ClassLoadingCompliance()
Get the flag indicating if the normal Java2 parent first class loading model should be used over the servlet 2.3 web container first model. |
boolean |
getLenientEjbLink()
Get the flag indicating if ejb-link errors should be ignored in favour of trying the jndi-name in jboss-web.xml |
org.jboss.deployers.structure.spi.main.MainDeployerStructure |
getMainDeployer()
|
protected org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver |
getPersistenceUnitDependencyResolver()
|
org.jboss.security.authorization.PolicyRegistration |
getPolicyRegistration()
Get the PolicyRegistration Bean |
String |
getPolicyRegistrationName()
Get the Policy Registration Name |
ISecurityManagement |
getSecurityManagement()
Get the securityManagement. |
String |
getSecurityManagementName()
Get the securityManagement. |
MBeanServer |
getServer()
|
String[] |
getStandardCompileClasspath(ClassLoader loader)
A utility method that searches the given loader for the resources: "javax/servlet/resources/web-app_2_3.dtd", "org/apache/jasper/resources/jsp12.dtd", and "javax/ejb/EJBHome.class" and returns an array of URL strings. |
boolean |
getUnpackWars()
Get the flag indicating if war archives should be unpacked. |
abstract void |
init(Object containerConfig)
Initialize the deployment using an instance specific configuration object. |
protected void |
linkEjbLocalRefs(org.jboss.deployers.structure.spi.DeploymentUnit unit,
org.jboss.metadata.javaee.spec.EJBLocalReferencesMetaData ejbLocalRefs,
Context envCtx)
|
protected void |
linkEjbRefs(org.jboss.deployers.structure.spi.DeploymentUnit unit,
org.jboss.metadata.javaee.spec.EJBReferencesMetaData ejbRefs,
Context envCtx)
|
protected void |
linkMessageDestinationRefs(org.jboss.deployers.structure.spi.DeploymentUnit unit,
org.jboss.metadata.javaee.spec.MessageDestinationReferencesMetaData msgRefs,
Context envCtx)
|
protected void |
linkResourceEnvRefs(org.jboss.metadata.javaee.spec.ResourceEnvironmentReferencesMetaData resourceEnvRefs,
Context envCtx)
|
protected void |
linkResourceRefs(org.jboss.metadata.javaee.spec.ResourceReferencesMetaData resourceRefs,
Context envCtx)
|
protected void |
linkSecurityDomain(String securityDomain,
Context envCtx)
This creates a java:comp/env/security context that contains a securityMgr binding pointing to an AuthenticationManager implementation and a realmMapping binding pointing to a RealmMapping implementation. |
protected abstract void |
performDeploy(WebApplication webApp,
String warUrlStr)
This method is called by the start() method template and must be overriden by subclasses to perform the web container specific deployment steps. |
protected abstract void |
performUndeploy(WebApplication webApp,
String warUrlStr)
Called as part of the stop() method template to ask the subclass for perform the web container specific undeployment steps. |
protected void |
processEnc(ClassLoader loader,
WebApplication webApp)
This method is invoked from within subclass performDeploy() method implementations when they invoke WebDescriptorParser.parseWebAppDescriptors(). |
protected void |
processEncReferences(WebApplication webApp,
Context envCtx)
|
void |
setDefaultSecurityDomain(String defaultSecurityDomain)
Set the default security domain implementation to use if a war does not declare a security-domain. |
void |
setDeploymentUnit(org.jboss.deployers.structure.spi.DeploymentUnit unit)
|
void |
setJava2ClassLoadingCompliance(boolean flag)
Set the flag indicating if the normal Java2 parent first class loading model should be used over the servlet 2.3 web container first model. |
void |
setKernel(org.jboss.kernel.Kernel kernel)
|
void |
setLenientEjbLink(boolean flag)
Set the flag indicating if ejb-link errors should be ignored in favour of trying the jndi-name in jboss-web.xml |
void |
setMainDeployer(org.jboss.deployers.structure.spi.main.MainDeployerStructure mainDeployer)
|
void |
setPersistenceUnitDependencyResolver(org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver resolver)
|
void |
setPolicyRegistration(org.jboss.security.authorization.PolicyRegistration policyRegistration)
Set the PolicyRegistration Bean |
void |
setPolicyRegistrationName(String policyRegistrationName)
Set the Policy Registration Name |
void |
setSecurityManagement(ISecurityManagement securityManagement)
Set the securityManagement. |
void |
setSecurityManagementName(String securityManagement)
Set the securityManagement. |
void |
setServer(MBeanServer server)
|
void |
setUnpackWars(boolean flag)
Get the flag indicating if war archives should be unpacked. |
static String |
shortWarUrlFromServerHome(String warUrl)
Utility method that builds a string url based on the ServerConfig.SERVER_HOME_URL system property and the input url. |
WebApplication |
start(org.jboss.deployers.structure.spi.DeploymentUnit unit,
org.jboss.metadata.web.jboss.JBossWebMetaData metaData)
A template pattern implementation of the deploy() method. |
void |
stop(org.jboss.deployers.structure.spi.DeploymentUnit di,
WebApplication webApp)
A template pattern implementation of the undeploy() method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ERROR
protected org.jboss.logging.Logger log
protected MBeanServer server
protected org.jboss.deployers.structure.spi.main.MainDeployerStructure mainDeployer
protected org.jboss.kernel.Kernel kernel
protected org.jboss.deployers.structure.spi.DeploymentUnit unit
protected boolean java2ClassLoadingCompliance
protected boolean unpackWars
protected boolean lenientEjbLink
protected String defaultSecurityDomain
protected String policyRegistrationName
protected org.jboss.security.authorization.PolicyRegistration policyRegistration
protected String securityManagementName
protected ISecurityManagement securityManagement
Constructor Detail |
---|
public AbstractWarDeployment()
Method Detail |
---|
public void setKernel(org.jboss.kernel.Kernel kernel)
public void setDeploymentUnit(org.jboss.deployers.structure.spi.DeploymentUnit unit)
public static String shortWarUrlFromServerHome(String warUrl)
warUrl
-
public abstract void init(Object containerConfig) throws Exception
containerConfig
-
Exception
public MBeanServer getServer()
public void setServer(MBeanServer server)
public org.jboss.deployers.structure.spi.main.MainDeployerStructure getMainDeployer()
public void setMainDeployer(org.jboss.deployers.structure.spi.main.MainDeployerStructure mainDeployer)
public boolean getJava2ClassLoadingCompliance()
public void setJava2ClassLoadingCompliance(boolean flag)
flag
- true for parent first, false for the servlet 2.3 modelpublic boolean getUnpackWars()
public void setUnpackWars(boolean flag)
flag
- , true is war archives should be unpackedpublic boolean getLenientEjbLink()
boolean
valuepublic void setLenientEjbLink(boolean flag)
public String getDefaultSecurityDomain()
public void setDefaultSecurityDomain(String defaultSecurityDomain)
defaultSecurityDomain
- - jndi name of the security domain binding to
use.protected org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver getPersistenceUnitDependencyResolver()
public void setPersistenceUnitDependencyResolver(org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver resolver)
public String getPolicyRegistrationName()
public void setPolicyRegistrationName(String policyRegistrationName)
policyRegistrationName
- public org.jboss.security.authorization.PolicyRegistration getPolicyRegistration()
public void setPolicyRegistration(org.jboss.security.authorization.PolicyRegistration policyRegistration)
policyRegistration
- public String getSecurityManagementName()
public void setSecurityManagementName(String securityManagement)
securityManagement
- the securityManagement.public ISecurityManagement getSecurityManagement()
public void setSecurityManagement(ISecurityManagement securityManagement)
securityManagement
- the securityManagement.public WebApplication start(org.jboss.deployers.structure.spi.DeploymentUnit unit, org.jboss.metadata.web.jboss.JBossWebMetaData metaData) throws Exception
performDeploy()
method to perform the container
specific deployment steps and registers the returned WebApplication in the
deployment map. The steps performed are:
ClassLoader appClassLoader = thread.getContextClassLoader();
URLClassLoader warLoader = URLClassLoader.newInstance(empty,
appClassLoader); thread.setContextClassLoader(warLoader);
WebDescriptorParser webAppParser = ...; WebMetaData metaData =
di.metaData; // Create JACC permissions, contextID, etc. ...
WebApplication warInfo = new WebApplication(metaData);
performDeploy(warInfo, warUrl, webAppParser); deploymentMap.put(warUrl,
warInfo); thread.setContextClassLoader(appClassLoader);
The subclass performDeploy() implementation needs to invoke
processEnc(loader, warInfo) to have the JNDI
java:comp/env namespace setup before any web app component can access this
namespace.
Also, an MBean for each servlet deployed should be created and its JMX
ObjectName placed into the DeploymentInfo.mbeans list so that the JSR77
layer can create the approriate model view. The servlet MBean needs to
provide access to the min, max and total time in milliseconds. Expose this
information via MinServiceTime, MaxServiceTime and TotalServiceTime
attributes to integrate seemlessly with the JSR77 factory layer.
unit
- The deployment info that contains the context-root element value
from the J2EE application/module/web application.xml descriptor. This may
be null if war was is not being deployed as part of an enterprise
application. It also contains the URL of the web application war.
Exception
public void stop(org.jboss.deployers.structure.spi.DeploymentUnit di, WebApplication webApp) throws Exception
performUndeploy()
method to perform the container specific undeployment
steps and unregisters the the warUrl from the deployment map.
Exception
protected abstract void performDeploy(WebApplication webApp, String warUrlStr) throws Exception
webApp
- The web application information context. This contains the
metadata such as the context-root element value from the J2EE
application/module/web application.xml descriptor and virtual-host.warUrlStr
- The string for the URL of the web application war.
Exception
protected abstract void performUndeploy(WebApplication webApp, String warUrlStr) throws Exception
webApp
- The web application information context. This contains the
metadata such as the context-root element value from the J2EE
application/module/web application.xml descriptor and virtual-host.warUrlStr
- The string for the URL of the web application war.
Exception
protected void processEnc(ClassLoader loader, WebApplication webApp) throws Exception
loader
- the ClassLoader for the web application. May not be null.metaData
- the WebMetaData from the WebApplication object passed to
the performDeploy method.
Exception
protected void processEncReferences(WebApplication webApp, Context envCtx) throws ClassNotFoundException, NamingException
ClassNotFoundException
NamingException
protected void addEnvEntries(org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData envEntries, Context envCtx) throws ClassNotFoundException, NamingException
ClassNotFoundException
NamingException
protected void linkResourceEnvRefs(org.jboss.metadata.javaee.spec.ResourceEnvironmentReferencesMetaData resourceEnvRefs, Context envCtx) throws NamingException
NamingException
protected void linkResourceRefs(org.jboss.metadata.javaee.spec.ResourceReferencesMetaData resourceRefs, Context envCtx) throws NamingException
NamingException
protected void linkMessageDestinationRefs(org.jboss.deployers.structure.spi.DeploymentUnit unit, org.jboss.metadata.javaee.spec.MessageDestinationReferencesMetaData msgRefs, Context envCtx) throws NamingException
NamingException
protected void linkEjbRefs(org.jboss.deployers.structure.spi.DeploymentUnit unit, org.jboss.metadata.javaee.spec.EJBReferencesMetaData ejbRefs, Context envCtx) throws NamingException
NamingException
protected void linkEjbLocalRefs(org.jboss.deployers.structure.spi.DeploymentUnit unit, org.jboss.metadata.javaee.spec.EJBLocalReferencesMetaData ejbLocalRefs, Context envCtx) throws NamingException
NamingException
protected void linkSecurityDomain(String securityDomain, Context envCtx) throws NamingException
NamingException
public String[] getStandardCompileClasspath(ClassLoader loader)
public String[] getCompileClasspath(ClassLoader loader)
public static void bindEnvEntry(Context ctx, org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData entry) throws ClassNotFoundException, NamingException
ClassNotFoundException
NamingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |