|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.osgi.web.extender.deployer.support.AbstractWarDeployer
public abstract class AbstractWarDeployer
Convenient base class offering common functionality for war deployers such as logging. Additionally, subclasses can associate a context with each bundle deployed which will used at undeployment time.
Field Summary | |
---|---|
protected Log |
log
logger |
Constructor Summary | |
---|---|
AbstractWarDeployer()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
protected abstract Object |
createDeployment(Bundle bundle,
String contextPath)
Creates and configures (but does not start) the web deployment for the given bundle. |
void |
deploy(Bundle bundle,
String contextPath)
Deploys the given bundle as a WAR using the given context path. Logs bundle deployment and associates it with a context object. |
protected BundleContext |
getBundleContext()
Returns the bundle context used by this deployer. |
protected abstract String |
getServerInfo()
Returns a nice String representation of the underlying server for logging messages. |
void |
setBundleContext(BundleContext bundleContext)
Set the BundleContext that this bean runs in. |
protected abstract void |
startDeployment(Object deployment)
Starts the deployment artifact. |
protected abstract void |
stopDeployment(Bundle bundle,
Object deployment)
Stops the deployment artifact. |
void |
undeploy(Bundle bundle,
String contextPath)
Un-deploys the given bundle from the given context path. Logs bundle undeployment and clears the context object associated with the bundle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log log
Constructor Detail |
---|
public AbstractWarDeployer()
Method Detail |
---|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public void setBundleContext(BundleContext bundleContext)
BundleContextAware
BundleContext
that this bean runs in. Normally this can
be used to initialize an object.
setBundleContext
in interface BundleContextAware
bundleContext
- the BundleContext
object to be used
by this objectprotected BundleContext getBundleContext()
public void deploy(Bundle bundle, String contextPath) throws Exception
WEB-INF/web.xml
file in its bundle space. However,
implementations can chose to create a synthetic WAR or use
other configuration files instead.
Logs bundle deployment and associates it with a context
object. It's up to the subclass to define this object as it usually
contains container specific information.
deploy
in interface WarDeployer
bundle
- war bundlecontextPath
- the war context path
Exception
- if something went wrong during deploymentpublic void undeploy(Bundle bundle, String contextPath) throws Exception
undeploy
in interface WarDeployer
bundle
- war bundlecontextPath
- the war context path
Exception
- if something went wrong during undeploymentprotected abstract Object createDeployment(Bundle bundle, String contextPath) throws Exception
startDeployment(Object)
and
stopDeployment(Bundle, Object)
.
bundle
- OSGi bundle deployed as warcontextPath
- WAR context path
Exception
- if something goes wrongprotected abstract void startDeployment(Object deployment) throws Exception
deployment
- web deployment artifact
Exception
- if something goes wrongprotected abstract void stopDeployment(Bundle bundle, Object deployment) throws Exception
bundle
- OSGi bundle backing the OSGi deploymentdeployment
- web deployment artifact
Exception
- if something goes wrongprotected abstract String getServerInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |