Package org.jvnet.glassfish.comms.deployment.backend

Examples of org.jvnet.glassfish.comms.deployment.backend.Servlet


import java.util.Comparator;


public class ServletStartupOrderComparator implements Comparator<Servlet> {
    public int compare(Servlet lhs, Servlet rhs) {
        Servlet lhsServlet = lhs;
        Servlet rhsServlet = rhs;

        // Compare two servlets for the load on startup value. If both instances
        // are the same,
        // we return 0. However, if both instances are different but both have the
        // same
        // load on stratup value, we cannot return 0 because compare(x,y) must
        // return 0
        // if and only if x.equals(y). So in this case, we will return -1.
        if ((lhsServlet.getLoadOnStartup() <= rhsServlet.getLoadOnStartup()) &&
                (!lhsServlet.equals(rhsServlet))) {
            return -1;
        } else if (lhsServlet.getLoadOnStartup() > rhsServlet.getLoadOnStartup()) {
            return 1;
        }

        return 0;
    }
View Full Code Here


            String packageName = ((Class)annotatedElement).getPackage().getName();

            String servletName = ((Class)annotatedElement).getSimpleName();


            Servlet servlet = new Servlet();
            servlet.setServletClass(servletClassName);
           
            // ---- Set load on startup ---
            SipServlet sipServlet = (SipServlet) ainfo.getAnnotation();
           
            int loadOnStartUp = sipServlet.loadOnStartup();
            servlet.setLoadOnStartup(loadOnStartUp);
           
            // --- Set Servlet Name ---
            // if the annotated Servlet Name is omitted, the the Class Name of the
            // SipServlet is used as Servlet Name.
            String annotatedServletName = sipServlet.name();
            if ( "".equals(annotatedServletName) )
            {
              // Servlet Name not annotated
              annotatedServletName = servletName;
            }
           
            servlet.setServletName(annotatedServletName);
            servlet.setPackageName(packageName);
           
            // --- Set Application Name ---
            String annotatedAppliationName = sipServlet.applicationName();
            servlet.setApplicationName(annotatedAppliationName);
           
            // Since we are not guaranteed that SipApplication annotation is processed 
            // before SipServlet, we add the SipServlet to a temporary Map in the
            // SipApplication structure.
           
View Full Code Here

            Map<String, Servlet> servlets = sipConfig.getServlets();
            Iterator<Servlet> servletItr = servlets.values().iterator();

            while (servletItr.hasNext()) {
                Servlet servlet = servletItr.next();
                String servletName = servlet.getServletName();
                Enumeration<RoleReference> srRef = servlet.getSecurityRoleReferences();

                if (srRef != null) {
                    // Iterator<SecurityRoleReference> srItr = srRef.iterator();

                    while (srRef.hasMoreElements()) {
View Full Code Here

TOP

Related Classes of org.jvnet.glassfish.comms.deployment.backend.Servlet

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.