|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.management.NotificationBroadcasterSupport
|
+--org.jboss.util.ServiceMBeanSupport
|
+--org.jboss.deployment.J2eeDeployer
J2eeDeployer allows to deploy single EJB.jars as well as Web.wars
(if a Servlet Container is present) or even Application.ears.
The deployment is done by determining the file type of the given url.
The file must be a valid zip file or a directory and must contain either a META-INF/ejb-jar.xml
or META-INF/application.xml or a WEB-INF/web.xml file.
Depending on the file type, the whole file (EJBs, WARs)
or only the relevant packages (EAR) becoming downloaded.
replacing alternative DDs and validation is not yet implementet!
The uploaded files are getting passed through to the responsible deployer
(ContainerFactory for JBoss and EmbededTomcatService for Tomcat).
| Field Summary | |
static java.lang.String |
CONFIG
|
java.io.File |
DEPLOYMENT_DIR
|
static int |
EASY
|
protected InstallerFactory |
installer
The InstallerFactory which installs J2EE module deployments |
protected javax.management.ObjectName |
jarDeployer
The name of the EJB jar deployer |
protected java.lang.String |
name
|
static int |
RESTRICTIVE
|
protected javax.management.MBeanServer |
server
|
protected javax.management.ObjectName |
warDeployer
The name of the Web war deployer |
| Fields inherited from class org.jboss.util.ServiceMBeanSupport |
log |
| Fields inherited from interface org.jboss.deployment.J2eeDeployerMBean |
OBJECT_NAME |
| Fields inherited from interface org.jboss.util.ServiceMBean |
STARTED, STARTING, states, STOPPED, STOPPING |
| Constructor Summary | |
J2eeDeployer()
|
|
J2eeDeployer(java.lang.String _name,
java.lang.String jarDeployerName,
java.lang.String warDeployerName)
|
|
| Method Summary | |
protected javax.management.ObjectName |
createCollectorName()
creation of collector name factored out. |
protected void |
createContextClassLoader(Deployment deployment)
creates an application class loader for this deployment this class loader will be shared between jboss and tomcat via the contextclassloader. |
void |
deploy(java.lang.String _url)
Deploys the given URL independent if it is a EJB.jar, Web.war or Application.ear. |
java.io.FilenameFilter |
getDeployableFilter()
Provides a filter that decides whether a file can be deployed by this deployer based on the filename. |
java.lang.String |
getDeployerName()
|
java.lang.String |
getJarDeployerName()
|
java.lang.String |
getName()
|
protected javax.management.ObjectName |
getObjectName(javax.management.MBeanServer server,
javax.management.ObjectName name)
|
java.lang.String |
getWarDeployerName()
|
protected void |
initService()
|
protected Deployment |
installApplication(java.net.URL _downloadUrl)
determines deployment type and installs (downloads) all packages needed by the given deployment of the given deployment. |
boolean |
isDeployed(java.lang.String _url)
Checks if the given URL is currently deployed or not. |
static void |
main(java.lang.String[] _args)
only for testing... |
protected void |
removeFromCollector(java.lang.String _url,
javax.management.ObjectName lCollector)
report of removal to data collector factored out for subclass access a try/catch for dealing with an uninstalled collector has been added. |
void |
setDeployerName(java.lang.String name)
|
void |
setJarDeployerName(java.lang.String jarDeployerName)
|
void |
setWarDeployerName(java.lang.String warDeployerName)
|
protected void |
startApplication(Deployment _d)
Starts the successful downloaded deployment. |
protected void |
startModules(Deployment _d,
java.lang.ClassLoader appCl,
java.lang.ClassLoader oldCl)
factored out method to start individual modules and reinstall context classloader afterwards |
protected void |
startService()
|
protected void |
stopApplication(Deployment _d)
Stops a running deployment. |
protected void |
stopService()
undeploys all deployments |
void |
undeploy(java.lang.String _app)
Undeploys the given URL (if it is deployed). |
protected void |
uninstallApplication(Deployment _d)
|
protected void |
uninstallApplication(java.lang.String _pattern)
Deletes the file tree of the specified application. |
protected boolean |
warDeployerAvailable()
tests if the web container deployer is available |
| Methods inherited from class org.jboss.util.ServiceMBeanSupport |
destroy, destroyService, getServer, getState, getStateString, init, nextSequenceNumber, postDeregister, postRegister, preDeregister, preRegister, start, stop |
| Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, removeNotificationListener, sendNotification |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jboss.util.ServiceMBean |
getState, getStateString |
| Methods inherited from interface org.jboss.util.Service |
destroy, init, start, stop |
| Field Detail |
public java.io.File DEPLOYMENT_DIR
public static java.lang.String CONFIG
public static final int EASY
public static final int RESTRICTIVE
protected javax.management.MBeanServer server
protected java.lang.String name
protected javax.management.ObjectName jarDeployer
protected javax.management.ObjectName warDeployer
protected InstallerFactory installer
| Constructor Detail |
public J2eeDeployer()
public J2eeDeployer(java.lang.String _name,
java.lang.String jarDeployerName,
java.lang.String warDeployerName)
| Method Detail |
public static void main(java.lang.String[] _args)
throws java.lang.Exception
public void setDeployerName(java.lang.String name)
setDeployerName in interface J2eeDeployerMBeanpublic java.lang.String getDeployerName()
getDeployerName in interface J2eeDeployerMBeanpublic void setJarDeployerName(java.lang.String jarDeployerName)
setJarDeployerName in interface J2eeDeployerMBeanpublic java.lang.String getJarDeployerName()
getJarDeployerName in interface J2eeDeployerMBeanpublic void setWarDeployerName(java.lang.String warDeployerName)
setWarDeployerName in interface J2eeDeployerMBeanpublic java.lang.String getWarDeployerName()
getWarDeployerName in interface J2eeDeployerMBeanpublic java.io.FilenameFilter getDeployableFilter()
DeployerMBeanAutoDeployer service.getDeployableFilter in interface DeployerMBeanorg.jboss.deployment.DeployerMBeanFilenameFilter that only
accepts files with names that can be
deployed by this deployer
public void deploy(java.lang.String _url)
throws java.net.MalformedURLException,
java.io.IOException,
J2eeDeploymentException
deploy in interface DeployerMBean_url - the url (file or http) to the archiv to deployjava.net.MalformedURLException - in case of a malformed urlJ2eeDeploymentException - if something went wrong...java.io.IOException - if trouble while file download occursprotected javax.management.ObjectName createCollectorName()
protected void removeFromCollector(java.lang.String _url,
javax.management.ObjectName lCollector)
public void undeploy(java.lang.String _app)
throws java.io.IOException,
J2eeDeploymentException
undeploy in interface DeployerMBean_url - the url to to undeployjava.net.MalformedURLException - in case of a malformed urlJ2eeDeploymentException - if something went wrong (but should have removed all files)java.io.IOException - if file removement fails
public boolean isDeployed(java.lang.String _url)
throws java.net.MalformedURLException,
J2eeDeploymentException
isDeployed in interface DeployerMBean_url - the url to to checkjava.net.MalformedURLException - in case of a malformed urlJ2eeDeploymentException - if the app seems to be deployed, but some of its modules
are not.public java.lang.String getName()
getName in interface ServiceMBeangetName in class ServiceMBeanSupport
protected javax.management.ObjectName getObjectName(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws javax.management.MalformedObjectNameException
getObjectName in class ServiceMBeanSupport
protected void initService()
throws java.lang.Exception
initService in class ServiceMBeanSupport
protected void startService()
throws java.lang.Exception
startService in class ServiceMBeanSupportprotected void stopService()
stopService in class ServiceMBeanSupport
protected Deployment installApplication(java.net.URL _downloadUrl)
throws java.io.IOException,
J2eeDeploymentException
_downloadUrl - the url that points to the app to installjava.io.IOException - if the download failsJ2eeDeploymentException - if the given package is somehow inconsistent
protected void uninstallApplication(java.lang.String _pattern)
throws java.io.IOException
_name - the directory (DEPLOYMENT_DIR/<_name> to remove recursivlyjava.io.IOException - if something goes wrong
protected void uninstallApplication(Deployment _d)
throws java.io.IOException
protected void startApplication(Deployment _d)
throws J2eeDeploymentException
_d - the deployment to startJ2eeDeploymentException - if an error occures for one of these
modules
protected void startModules(Deployment _d,
java.lang.ClassLoader appCl,
java.lang.ClassLoader oldCl)
throws J2eeDeploymentException
protected void stopApplication(Deployment _d)
throws J2eeDeploymentException
_d - the deployment to stopJ2eeDeploymentException - if an error occures for one of these
modulesprotected boolean warDeployerAvailable()
protected void createContextClassLoader(Deployment deployment)
throws J2eeDeploymentException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||