[ 
https://issues.apache.org/jira/browse/NIFI-7301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17073079#comment-17073079
 ] 

Andy LoPresto commented on NIFI-7301:
-------------------------------------

We have access to the running Java process and code... 

{code}
final long startTime = System.nanoTime();
        nifiServer = (NiFiServer) jettyConstructor.newInstance(properties, 
narBundles);
        nifiServer.setExtensionMapping(extensionMapping);
        nifiServer.setBundles(systemBundle, narBundles);

        if (shutdown) {
            LOGGER.info("NiFi has been shutdown via NiFi Bootstrap. Will not 
start Controller");
        } else {
            nifiServer.start();

            if (bootstrapListener != null) {
                bootstrapListener.sendStartedStatus(true);
            }

            final long duration = System.nanoTime() - startTime;
            LOGGER.info("Controller initialization took " + duration + " 
nanoseconds "
                    + "(" + (int) TimeUnit.SECONDS.convert(duration, 
TimeUnit.NANOSECONDS) + " seconds).");

            // TODO: Start browser here
            String nifiUrl = nifiServer.getUrls()[0];
            ProcessBuilder builder = new ProcessBuilder();
            builder.command("$BROWSER", nifiUrl);
            builder.directory(new File(System.getProperty("user.home")));
            Process process = builder.start();
            StreamGobbler streamGobbler = 
              new StreamGobbler(process.getInputStream(), System.out::println);
            Executors.newSingleThreadExecutor().submit(streamGobbler);
            int exitCode = process.waitFor();
            assert exitCode == 0;
        }
{code}


> Open Web Browser After Successful Startup
> -----------------------------------------
>
>                 Key: NIFI-7301
>                 URL: https://issues.apache.org/jira/browse/NIFI-7301
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Troy Melhase
>            Priority: Trivial
>
> 1.  Select or develop method of determining OS
> 2.  Select or develop method of determining NiFi URL
> 3.  When URL is localhost and OS supports GUI browsers, open browser with 
> NiFi URL after startup
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to