Package org.apache.catalina.util

Examples of org.apache.catalina.util.ContextName


        } else if (container instanceof Host) {
            name = new ObjectName(domain + ":type=Manager,host=" +
                              container.getName());
        } else if (container instanceof Context) {
            Context context = ((Context)container);
            ContextName cn = new ContextName(context.getName());
            Container host = context.getParent();
            name = new ObjectName(domain + ":type=Manager,context=" +
                    cn.getDisplayName() + ",host=" + host.getName());
        }

        return (name);

    }
View Full Code Here


        if (container instanceof Server) {       
            name = new ObjectName(domain + ":type=NamingResources" +
                        ",resourcetype=Global");
        } else if (container instanceof Context) {       
            Context context = ((Context)container);
            ContextName cn = new ContextName(context.getName());
            Container host = context.getParent();
            name = new ObjectName(domain + ":type=NamingResources" +
                        ",resourcetype=Context,context=" + cn.getDisplayName() +
                        ",host=" + host.getName());
        }
       
        return (name);
View Full Code Here

        } else if (container instanceof Host) {
            name = new ObjectName(domain + ":type=Realm,host=" +
                              container.getName());
        } else if (container instanceof Context) {
            Context context = ((Context)container);
            ContextName cn = new ContextName(context.getName());
            Container host = context.getParent();
            name = new ObjectName(domain + ":type=Realm,context=" +
                    cn.getDisplayName() + ",host=" + host.getName());
        }

        return (name);

    }
View Full Code Here

            }
            name = new ObjectName(domain + ":type=Valve,name=" + className +
                                    ext + local );
        } else if (container instanceof Context) {
            Context context = ((Context)container);
            ContextName cn = new ContextName(context.getName());
            Container host = context.getParent();
            String local=",context=" + cn.getDisplayName() + ",host=" +
                    host.getName();
            int seq = getSeq(local);
            String ext="";
            if( seq > 0 ) {
                ext=",seq=" + seq;
View Full Code Here

            if (c instanceof Wrapper) {
                keyProperties.append(",servlet=");
                keyProperties.append(c.getName());
            } else if (c instanceof Context) {
                keyProperties.append(",context=");
                ContextName cn = new ContextName(c.getName());
                keyProperties.append(cn.getDisplayName());
            } else if (c instanceof Host) {
                keyProperties.append(",host=");
                keyProperties.append(c.getName());
            } else if (c == null) {
                // May happen in unit testing and/or some embedding scenarios
View Full Code Here

            // Trying to guess the docBase according to the path
            String path = context.getPath();
            if (path == null) {
                return;
            }
            ContextName cn = new ContextName(path, context.getWebappVersion());
            docBase = cn.getBaseName();
        }

        File file = new File(docBase);
        if (!file.isAbsolute()) {
            docBase = (new File(canonicalAppBase, docBase)).getPath();
        } else {
            docBase = file.getCanonicalPath();
        }
        file = new File(docBase);
        String origDocBase = docBase;
       
        ContextName cn = new ContextName(context.getPath(),
                context.getWebappVersion());
        String pathName = cn.getBaseName();

        if (docBase.toLowerCase(Locale.ENGLISH).endsWith(".war") && !file.isDirectory() && unpackWARs) {
            URL war = new URL("jar:" + (new File(docBase)).toURI().toURL() + "!/");
            docBase = ExpandWar.expand(host, war, pathName);
            file = new File(docBase);
View Full Code Here

           
            String path = context.getPath();
            if (path == null) {
                return;
            }
            ContextName cn = new ContextName(path, context.getWebappVersion());
            docBase = cn.getBaseName();

            File file = null;
            if (docBase.toLowerCase(Locale.ENGLISH).endsWith(".war")) {
                // TODO - This is never executed. Bug or code to delete?
                file = new File(System.getProperty("java.io.tmpdir"),
View Full Code Here

      removeServiced(contextName);
   }

   private String getContextName(final String warFileName)
   {
      final ContextName contextName = new ContextName(warFileName);
      return contextName.getName();
   }
View Full Code Here

         final File archiveFile = new File(appBase, archive.getName());
         archive.as(ZipExporter.class).exportTo(archiveFile, true);

         embeddedHostConfig.deployWAR(archive.getName());

         final ContextName contextName = getContextName(archive);
         final StandardContext standardContext = (StandardContext) host.findChild(contextName.getName());
         standardContextProducer.set(standardContext);

         final HTTPContext httpContext = new HTTPContext(configuration.getBindAddress(),
               configuration.getBindHttpPort());

         for (String mapping : standardContext.findServletMappings())
         {
            httpContext.add(new Servlet(standardContext.findServletMapping(mapping), contextName.getPath()));
         }

         return new ProtocolMetaData().addContext(httpContext);
      }
      catch (Exception e)
View Full Code Here

    * @param archive the Arquillian archive.
    * @return the Tomcat context name helper.
    */
   private ContextName getContextName(final Archive<?> archive)
   {
      return new ContextName(archive.getName());
   }
View Full Code Here

TOP

Related Classes of org.apache.catalina.util.ContextName

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.