Examples of RequestManager


Examples of dk.brics.jwig.server.RequestManager

    @HEAD
    @OPTIONS
    public Object augment() {
        Object o = next();
        ThreadContext c = ThreadContext.get();
        RequestManager manager = c.getRequestManager();
        Response r = getResponse();
        if (o instanceof XML) {
            // log.debug("Augmenting: " + r.getETag());
            XML xml = (XML) o;
            String home = manager.getWebSiteURL(c.getServletRequest()
                    .isSecure());
            xml = xml
                    .prependContent(
                            "//xhtml:head",
                            XML.parseTemplate(
                                    "<script type=\"text/javascript\" src=[JWIG]></script>")
                                    .plug("JWIG", manager.makeURL("jwigJS")));
            xml = xml
                    .prependContent(
                            "//xhtml:body", //It is safe to set a constant id given that only one body may exist
                            XML.parseTemplate("<div id=\"noscript\" style=\"color:red\">" +
                                    "[ This web application uses JavaScript, which is not enabled in your browser - "
                                    + "for full functionality, use a browser that supports JavaScript ]</div>" +
                                    "<script type=\"text/javascript\"> " +
                                    "document.getElementById(\"noscript\").style.display = \"none\";" +
                                    "</script>"));
            xml = xml.appendContent("//xhtml:body",
                    XML.parseTemplate(
                            "<script type=\"text/javascript\">"
                                    + "jwig.run('<[HOME]>');" + "</script>")
                            .plug("HOME", home));
            xml = xml.appendContent("//xhtml:body",
                                    XML.parseTemplate("<script type=\"text/javascript\">"
                                    + "jwig.submitHandlerData = <[SUB]> ;" + "</script>").plug("SUB",
                                                                                               generateSubmitHandlerData(r)));
            if (auto_refresh_sessions) {
                Set<Session> sessions = r.getSessions();
                if (sessions != null && sessions.size() > 0) {
                    int minutes = 0;
                    for (Session s : sessions) {
                        int min = s.getMinutes();
                        if (minutes < min || minutes == 0) {
                            minutes = min;
                        }
                    }
                    Object[] ss = { sessions.toArray() };
                    xml = xml
                            .appendContent(
                                    "//xhtml:head",
                                    XML.parseTemplate(
                                            "<script type=\"text/javascript\">"
                                                    + "jwig.startRefreshSessions('<[REFRESH_URL]>',<[MINUTES]>);"
                                                    + "</script>")
                                            .plug("REFRESH_URL",
                                                    manager.makeURL(
                                                            "touchSessions", ss)
                                                            .toString())
                                            .plug("MINUTES", minutes - 1));
                }
            }
View Full Code Here

Examples of dk.brics.jwig.server.RequestManager

        Map<SootClass, RequestManager> managers = new HashMap<SootClass, RequestManager>();
        for (SootClass webApp : webapps) {
            try {
                Class<? extends WebApp> webAppClass = Class.forName(
                        webApp.getName()).asSubclass(WebApp.class);
                RequestManager man = new RequestManager();
                man.introspectWebAppClass(webAppClass);
                managers.put(webApp, man);
            } catch (ClassNotFoundException e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

Examples of dk.brics.jwig.server.RequestManager

     * @return the WebMethods of the {@link WebApp} whose names are matched by
     *         the {@link Automaton}
     */
    public Set<Method> getWebMethodsByName(Class<? extends WebApp> webAppClass,
            Automaton automaton) {
        final RequestManager manager = managers.get(webAppClass);
        if (manager == null)
            throw new IllegalArgumentException("WebApp: "
                    + webAppClass.getName() + " has not been registered");

        HashSet<Method> methodNameMatches = new HashSet<Method>();
        final List<RegisteredMethod> localWebMethods = manager.getWebMethods();
        for (RegisteredMethod methodNameMatch : localWebMethods) {
            final Method method = methodNameMatch.getMethod();
            if (automaton.run(method.getName())) {
                methodNameMatches.add(method);
            }
View Full Code Here

Examples of dk.brics.jwig.server.RequestManager

     *            {@link RequestManager} from
     * @return the {@link RequestManager} for the {@link WebApp}.
     */
    private RequestManager makeRequestManager(
            Class<? extends WebApp> webAppClass) {
        RequestManager man = new RequestManager();
        man.introspectWebAppClass(webAppClass);
        return man;
    }
View Full Code Here

Examples of fr.dyade.aaa.jndi2.server.RequestManager

      3,
      getDefault());
    tcpServer.start();

    if (firstTime) {
      RequestManager manager = new RequestManager();
     
      HARequestManager haManager = new HARequestManager();
      haManager.setRequestManager(manager);

      AgentEntryPoint agentEP = new AgentEntryPoint();   
      agentEP.setRequestManager(manager);
     
      HAEntryPoint haEP = new HAEntryPoint();
      haEP.setHARequestManager(haManager);

      Container container = new Container();   
      container.addEntryPoint(agentEP);
      container.addEntryPoint(haEP);
      container.setLifeCycleListener(haManager);
      container.setBagSerializer(haManager);
      manager.setContainer(container);
      container.deploy();
    }
  }
View Full Code Here

Examples of org.codinjutsu.tools.jenkins.logic.RequestManager

        final BrowserPanel browserPanel = BrowserPanel.getInstance(project);
        try {
            Job job = browserPanel.getSelectedJob();

            RequestManager requestManager = browserPanel.getJenkinsManager();
            if (job.hasParameters()) {
                BuildParamDialog.showDialog(job, JenkinsAppSettings.getSafeInstance(project), requestManager, new BuildParamDialog.RunBuildCallback() {

                    public void notifyOnOk(Job job) {
                        notifyOnGoingMessage(job);
                    }

                    public void notifyOnError(Job job, Exception ex) {
                        browserPanel.notifyErrorJenkinsToolWindow("Build '" + job.getName() + "' cannot be run: " + ex.getMessage());
                    }
                });
            } else {
                requestManager.runBuild(job, JenkinsAppSettings.getSafeInstance(project));
                notifyOnGoingMessage(job);
                browserPanel.loadSelectedJob();
            }

        } catch (Exception ex) {
View Full Code Here

Examples of org.codinjutsu.tools.jenkins.logic.RequestManager

        final BrowserPanel browserPanel = BrowserPanel.getInstance(project);

        try {
            Job job = browserPanel.getSelectedJob();

            RequestManager requestManager = browserPanel.getJenkinsManager();

            if (job.hasParameters()) {
                if (job.hasParameter(PARAMETER_NAME)) {

                    JenkinsAppSettings settings = JenkinsAppSettings.getSafeInstance(project);

                    final VirtualFile virtualFile =
                        prepareFile(browserPanel, FileChooser.chooseFile(
                                browserPanel,
                                new FileChooserDescriptor(true, false, false, false, false, false))
                        , settings, job);

                    if ((null != virtualFile)) {
                        if (virtualFile.exists()) {
                            Map<String, VirtualFile> files = new HashMap<String, VirtualFile>();
                            files.put(PARAMETER_NAME, virtualFile);
                            requestManager.runBuild(job, settings, files);
                            notifyOnGoingMessage(job);
                            browserPanel.loadSelectedJob();
                        } else {
                            message = String.format("File \"%s\" not exists", virtualFile.getPath());
                        }
View Full Code Here

Examples of org.codinjutsu.tools.jenkins.logic.RequestManager

    private void onOK() {
        BrowserPanel browserPanel = BrowserPanel.getInstance(project);
        try {
            if (createPatch()) {
                RequestManager requestManager = browserPanel.getJenkinsManager();
                String selectedJobName = (String) jobsList.getSelectedItem();
                if (selectedJobName != null && !selectedJobName.isEmpty()) {
                    Job selectedJob = browserPanel.getJob(selectedJobName);
                    if (selectedJob != null) {
                        if (selectedJob.hasParameters()) {
                            if (selectedJob.hasParameter(UploadPatchToJob.PARAMETER_NAME)) {
                                JenkinsAppSettings settings = JenkinsAppSettings.getSafeInstance(project);
                                Map<String, VirtualFile> files = new HashMap<String, VirtualFile>();
                                VirtualFile virtualFile = UploadPatchToJob.prepareFile(browserPanel, LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(FILENAME)), settings, selectedJob);
                                if (virtualFile != null && virtualFile.exists()) {
                                    files.put(UploadPatchToJob.PARAMETER_NAME, virtualFile);
                                    requestManager.runBuild(selectedJob, settings, files);
                                    //browserPanel.loadSelectedJob();
                                    browserPanel.notifyInfoJenkinsToolWindow(HtmlUtil.createHtmlLinkMessage(
                                        selectedJob.getName() + " build is on going",
                                        selectedJob.getUrl())
                                    );
View Full Code Here

Examples of org.ofbiz.webapp.control.RequestManager

     * @see org.ofbiz.webapp.event.EventHandler#init(javax.servlet.ServletContext)
     */
    public void init(ServletContext context) throws EventHandlerException {

        // Provide a means to check the controller for event tag attributes at execution time
        this.requestManager = new RequestManager(context);
    }
View Full Code Here

Examples of org.ofbiz.webapp.control.RequestManager

    public static String runRequestEvent(HttpServletRequest request, HttpServletResponse response, String requestUri)
            throws EventHandlerException {
        ServletContext application = ((ServletContext) request.getAttribute("servletContext"));
        RequestHandler handler = (RequestHandler) application.getAttribute("_REQUEST_HANDLER_");
        RequestManager rm = handler.getRequestManager();
        String eventType = rm.getEventType(requestUri);
        String eventPath = rm.getEventPath(requestUri);
        String eventMethod = rm.getEventMethod(requestUri);
        return handler.runEvent(request, response, eventType, eventPath, eventMethod);       
    }
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.