Package org.jboss.fresh.shell

Examples of org.jboss.fresh.shell.SystemShell


        OutputStreamWriter osw = null;
        try {
            ctx = new RegistryContext();

            try {
                SystemShell sysshell = (SystemShell) ctx.lookup("java:/FRESH/SystemShell");
                log.log(TRACE, "Retrieved SystemShell from RegistryContext: 'SystemShell'.");
                shell = sysshell.startSession(null, false);
            } catch (javax.naming.NameNotFoundException nnfe) {
                throw nnfe;

            }
            log.debug("Using shell: " + shell);
View Full Code Here


  }

  private void reinitShell() throws NamingException, ShellException {
    if (shell == null) {
      InitialContext ctx = null;
      SystemShell sysshell;
      String sslookup = SYSTEM_SHELL_JNDI;
      try {
        ctx = new InitialContext();
        Context env = (Context) ctx.lookup("java:comp/env");
        sslookup = (String) env.lookup("SystemShellJNDI");
      } catch (NameNotFoundException ex) {
        log.info("SystemShellJNDI ENV not set. Using defaults.");
      } finally {
        if (ctx != null) {
          try {
            ctx.close();
          } catch (Exception e) {
            log.error("Could not close " + ctx + '!', e);
          }
        }
      }
      try {
        sysshell = (SystemShell) new RegistryContext().lookup(sslookup);
//      } catch(NameNotFoundException ex) {
//        ex.printStackTrace();
//        throw new RuntimeException(ex.getMessage());
      } catch (NamingException ex) {
        log.error("Error while reiniting shell!", ex);
        throw new RuntimeException(ex);
      }
      if (sessid == null) {
        shell = sysshell.startSession(uctx, interactive);
        sessid = shell.getSessionID();
      } else {
        shell = sysshell.continueSession(sessid);
      }
      if (shell == null) {
        throw new org.jboss.fresh.shell.SessionTimeoutException("Shell session has timed out.");
      }
    }
View Full Code Here

TOP

Related Classes of org.jboss.fresh.shell.SystemShell

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.