Examples of ServletType


Examples of com.sun.jersey.test.framework.web.jaxb.types.ServletType

        if(listeners.size() > 0) {
            webAppType.setListeners(listeners);
        }

        // add the servlet information to the deployment descriptor
        ServletType servlet = new ServletType();
        servlet.setServletName("Jersey Web Application");
        servlet.setServletClass(applicationDescriptor.getServletClass().getName());

        //any init params
        Map<String, String> initParams = applicationDescriptor.getInitParams();
        if(initParams != null) {
            List<ServletInitParamType> servletInitParams = new ArrayList<ServletInitParamType>();
            Iterator<String> initParamIterator = initParams.keySet().iterator();
            ServletInitParamType servletInitParam;
            String paramName;
            while (initParamIterator.hasNext()) {
                paramName = initParamIterator.next();
                servletInitParam = new ServletInitParamType(paramName, initParams.get(paramName));
                servletInitParams.add(servletInitParam);
            }
            servlet.setInitParam(servletInitParams);
           
        }

        // load-on-startup
        servlet.setLoadOnStartup("1");
        webAppType.setServletType(servlet);

        // add the servlet mapping info
        ServletMappingType servletMapping = new ServletMappingType();
        servletMapping.setServletName("Jersey Web Application");
View Full Code Here

Examples of noNamespace.ServletType

   }

   private ServletType getServlet( ServletType[] servletArray,
                                   String        servletName )
   {
      ServletType servlet = null;
      for ( int j = 0; j < servletArray.length; j++ )
      {
         if ( servletArray[j].getServletName(  ).getStringValue(  ).equals( servletName ) )
         {
            servlet = servletArray[j];
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.ServletType

public class StartupOrderComparatorTest extends TestCase {

    private final JettyModuleBuilder.StartupOrderComparator c = new JettyModuleBuilder.StartupOrderComparator();

    public void testNoOrders() throws Exception {
        ServletType s1 = makeServletType("a", -1);
        ServletType s2 = makeServletType("b", -1);
        ServletType s3 = makeServletType("c", -1);
        checkOrdering(s1, s2, s3);
    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.ServletType

        ServletType s3 = makeServletType("c", -1);
        checkOrdering(s1, s2, s3);
    }

    public void testIdenticalOrders() throws Exception {
        ServletType s1 = makeServletType("a", 1);
        ServletType s2 = makeServletType("b", 1);
        ServletType s3 = makeServletType("c", 1);
        checkOrdering(s1, s2, s3);
    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.ServletType

        ServletType s3 = makeServletType("c", 1);
        checkOrdering(s1, s2, s3);
    }

    public void testDistinctOrders() throws Exception {
        ServletType s1 = makeServletType("c", 1);
        ServletType s2 = makeServletType("b", 2);
        ServletType s3 = makeServletType("a", 3);
        checkOrdering(s1, s2, s3);
    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.ServletType

        ServletType s3 = makeServletType("a", 3);
        checkOrdering(s1, s2, s3);
    }

    public void testMixedOrders1() throws Exception {
        ServletType s1 = makeServletType("c", 1);
        ServletType s2 = makeServletType("b", 2);
        ServletType s3 = makeServletType("a", -1);
        checkOrdering(s1, s2, s3);
    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.ServletType

        ServletType s3 = makeServletType("a", -1);
        checkOrdering(s1, s2, s3);
    }

    public void testMixedOrders2() throws Exception {
        ServletType s1 = makeServletType("c", 1);
        ServletType s2 = makeServletType("a", -1);
        ServletType s3 = makeServletType("b", -1);
        checkOrdering(s1, s2, s3);
    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.ServletType

        assertTrue(c.compare(s2, s3) < 0);
        assertTrue(c.compare(s1, s3) < 0);
    }

    private ServletType makeServletType(String servletName, int order) {
        ServletType s1 = ServletType.Factory.newInstance();
        s1.addNewServletName().setStringValue(servletName);
        if (order > -1) {
            s1.addNewLoadOnStartup().setBigIntegerValue(BigInteger.valueOf(order));
        }
        return s1;
    }
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.ServletType

            //Handle the role permissions and webservices on the servlets.
            ServletType[] servletTypes = webApp.getServletArray();
            Map webServices = new HashMap();
            for (int i = 0; i < servletTypes.length; i++) {
                ServletType servletType = servletTypes[i];

                //Handle the Role Ref Permissions
                processRoleRefPermissions(servletType, securityRoles, rolePermissions);

                //Do we have webservices configured?
                if (portMap != null) {
                    //Check if the Servlet is a Webservice
                    String servletName = servletType.getServletName().getStringValue().trim();
                    if (portMap.containsKey(servletName)) {
                        //Yes, this servlet is a web service so let the web service builder
                        // deal with configuring the web service stack
                        String servletClassName = servletType.getServletClass().getStringValue().trim();
                        Object portInfo = portMap.get(servletName);
                        if (portInfo == null) {
                            throw new DeploymentException("No web service deployment info for servlet name " + servletName);
                        }
View Full Code Here

Examples of org.apache.geronimo.xbeans.j2ee.ServletType

         * @param o1 first ServletType object
         * @param o2 second ServletType object
         * @return an int < 0 if o1 precedes o2, 0 if they are equal, and > 0 if o2 preceeds o1.
         */
        public int compare(Object o1, Object o2) {
            ServletType s1 = (ServletType) o1;
            ServletType s2 = (ServletType) o2;

            // load-on-startup is set for neither.  the
            // ordering at this point doesn't matter, but we
            // should return "0" only if the two objects say
            // they are equal
            if (!s1.isSetLoadOnStartup() && !s2.isSetLoadOnStartup()) {
                return s1.equals(s2) ? 0 : s1.getServletName().getStringValue().trim().compareTo(s2.getServletName().getStringValue().trim());
            }

            // load-on-startup is set for one but not the
            // other.  whichever one is set will be "less
            // than", i.e. it will be loaded first
            if (s1.isSetLoadOnStartup() && !s2.isSetLoadOnStartup()) {
                return -1;
            }
            if (!s1.isSetLoadOnStartup() && s2.isSetLoadOnStartup()) {
                return 1;
            }

            // load-on-startup is set for both.  whichever one
            // has a smaller value is "less than"
            int comp = s1.getLoadOnStartup().getBigIntegerValue().compareTo(s2.getLoadOnStartup().getBigIntegerValue());
            if (comp == 0) {
                return s1.getServletName().getStringValue().trim().compareTo(s2.getServletName().getStringValue().trim());
            }
            return comp;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.