Package org.jboss.web

Examples of org.jboss.web.WebApplication


   {
      if (this.unit == null || this.container == null || this.deployment == null)
         throw new IllegalStateException("WebModules cannot be restarted, and must be redeployed");
      // Get the war URL
      JBossWebMetaData metaData = unit.getAttachment(JBossWebMetaData.class);
      WebApplication webApp = deployment.start(unit, metaData);
      String warURL = unit.getName();
      container.addDeployedApp(warURL, webApp);
   }
View Full Code Here


   public synchronized void stopModule() throws DeploymentException
   {
      String warURL = unit.getName();
      try
      {
         WebApplication webApp = container.removeDeployedApp(warURL);
         if (deployment != null && webApp != null)
         {
            deployment.stop(unit, webApp);
         }
         else
View Full Code Here

    */
   public synchronized WebApplication start(DeploymentUnit unit, JBossWebMetaData metaData) throws Exception
   {
      Thread thread = Thread.currentThread();
      ClassLoader appClassLoader = thread.getContextClassLoader();
      WebApplication webApp = null;
      try
      {
         // Create a classloader for the war to ensure a unique ENC
         ClassLoader warLoader = unit.getClassLoader();
         thread.setContextClassLoader(warLoader);
         String webContext = metaData.getContextRoot();

         // Get the war URL
         URL warUrl = unit.getAttachment("org.jboss.web.expandedWarURL", URL.class);
         if (warUrl == null && unit instanceof VFSDeploymentUnit)
         {
            VFSDeploymentUnit vdu = VFSDeploymentUnit.class.cast(unit);
            warUrl = VFSUtils.getPhysicalURL(vdu.getRoot());
         }

         // Dynamic WebMetaData deployments might not provide an URL
         // We use the DEploymentUnit name as identifier instead.
         // The JAXWS Endpoint API for example does this.
         String warURLString = (warUrl != null ? warUrl.toExternalForm() : unit.getName());

         // Strip any jar: url syntax. This should be be handled by the vfs
         if (warURLString.startsWith("jar:"))
            warURLString = warURLString.substring(4, warURLString.length() - 2);

         log.debug("webContext: " + webContext);
         log.debug("warURL: " + warURLString);

         // Register the permissions with the JACC layer
         String contextID = metaData.getJaccContextID();
         if (contextID == null)
            contextID = unit.getSimpleName();
         metaData.setJaccContextID(contextID);

         webApp = new WebApplication(metaData);
         webApp.setClassLoader(warLoader);
         webApp.setDeploymentUnit(unit);
         performDeploy(webApp, warURLString);
      }
      finally
      {
         thread.setContextClassLoader(appClassLoader);
View Full Code Here

    */
   public synchronized void startModule() throws Exception
   {
      // Get the war URL
      JBossWebMetaData metaData = unit.getAttachment(JBossWebMetaData.class);
      WebApplication webApp = deployment.start(unit, metaData);
      String warURL = unit.getName();
      container.addDeployedApp(warURL, webApp);
   }
View Full Code Here

   public synchronized void stopModule() throws DeploymentException
   {
      String warURL = unit.getName();
      try
      {
         WebApplication webApp = container.removeDeployedApp(warURL);
         if (deployment != null && webApp != null)
         {
            deployment.stop(unit, webApp);
         }
         else
View Full Code Here

    */
   public synchronized WebApplication start(DeploymentUnit unit, JBossWebMetaData metaData) throws Exception
   {
      Thread thread = Thread.currentThread();
      ClassLoader appClassLoader = thread.getContextClassLoader();
      WebApplication webApp = null;
      try
      {
         // Create a classloader for the war to ensure a unique ENC
         ClassLoader warLoader = unit.getClassLoader();
         thread.setContextClassLoader(warLoader);
         String webContext = metaData.getContextRoot();

         // Get the war URL
         URL warUrl = unit.getAttachment("org.jboss.web.expandedWarURL", URL.class);
         if (warUrl == null && unit instanceof VFSDeploymentUnit)
         {
            VFSDeploymentUnit vdu = VFSDeploymentUnit.class.cast(unit);
            warUrl = VFSUtils.getRealURL(vdu.getRoot());
         }

         // Dynamic WebMetaData deployments might not provide an URL
         // We use the DEploymentUnit name as identifier instead.
         // The JAXWS Endpoint API for example does this.
         String warURLString = (warUrl != null ? warUrl.toExternalForm() : unit.getName());

         // Strip any jar: url syntax. This should be be handled by the vfs
         if (warURLString.startsWith("jar:"))
            warURLString = warURLString.substring(4, warURLString.length() - 2);

         log.debug("webContext: " + webContext);
         log.debug("warURL: " + warURLString);

         // Register the permissions with the JACC layer
         String contextID = metaData.getJaccContextID();
         if (contextID == null)
            contextID = unit.getSimpleName();
         metaData.setJaccContextID(contextID);

         webApp = new WebApplication(metaData);
         webApp.setClassLoader(warLoader);
         webApp.setDeploymentUnit(unit);
         performDeploy(webApp, warURLString);
      }
      finally
      {
         thread.setContextClassLoader(appClassLoader);
View Full Code Here

            buffer.append("<h1>Web Applications</h1>\n");
         }

         while (it.hasNext() == true)
         {
            WebApplication webApplication = (WebApplication) it.next();

            Thread.currentThread().setContextClassLoader(webApplication.getMetaData().getENCLoader());

            buffer.append("<h2>java:comp namespace of the " + webApplication.getCanonicalName()
                    + " application:</h2>\n");

            try
            {
               context = new InitialContext();
View Full Code Here

         // java: namespaces which are ClassLoader local
         Iterator it = (Iterator) server.getAttribute(AbstractWebDeployerMBean.OBJECT_NAME, "DeployedApplications");

         while (it.hasNext() == true)
         {
            WebApplication webApplication = (WebApplication) it.next();
            openWebModuleTag(buffer, webApplication.getCanonicalName());

            Thread.currentThread().setContextClassLoader(webApplication.getMetaData().getENCLoader());

            try
            {
               context = new InitialContext();
               context = (Context) context.lookup("java:comp");
View Full Code Here

/*     */
/*     */   public synchronized void startModule()
/*     */     throws Exception
/*     */   {
/*  88 */     JBossWebMetaData metaData = (JBossWebMetaData)this.di.getAttachment(JBossWebMetaData.class);
/*  89 */     WebApplication webApp = this.deployment.start(this.di, metaData);
/*  90 */     String warURL = this.di.getName();
/*  91 */     this.container.addDeployedApp(warURL, webApp);
/*     */   }
View Full Code Here

/*     */     throws DeploymentException
/*     */   {
/*  99 */     String warURL = this.di.getName();
/*     */     try
/*     */     {
/* 102 */       WebApplication webApp = this.container.removeDeployedApp(warURL);
/* 103 */       if ((this.deployment != null) && (webApp != null))
/*     */       {
/* 105 */         this.deployment.stop(this.di, webApp);
/*     */       }
/*     */       else
View Full Code Here

TOP

Related Classes of org.jboss.web.WebApplication

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.