PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/jboss-as-7.1.1.Final/domain-management/src/main/java/org/jboss/as/domain/management/security/JavaConsole.java

#
Java | 66 lines | 28 code | 10 blank | 28 comment | 0 complexity | 01919b6a5549faf207af8d5e626be6bb MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. /*
  2. *
  3. * * JBoss, Home of Professional Open Source.
  4. * * Copyright 2011, Red Hat, Inc., and individual contributors
  5. * * as indicated by the @author tags. See the copyright.txt file in the
  6. * * distribution for a full listing of individual contributors.
  7. * *
  8. * * This is free software; you can redistribute it and/or modify it
  9. * * under the terms of the GNU Lesser General Public License as
  10. * * published by the Free Software Foundation; either version 2.1 of
  11. * * the License, or (at your option) any later version.
  12. * *
  13. * * This software is distributed in the hope that it will be useful,
  14. * * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * * Lesser General Public License for more details.
  17. * *
  18. * * You should have received a copy of the GNU Lesser General Public
  19. * * License along with this software; if not, write to the Free
  20. * * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. * * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  22. *
  23. */
  24. package org.jboss.as.domain.management.security;
  25. import java.io.Console;
  26. import java.io.IOError;
  27. import java.util.IllegalFormatException;
  28. /**
  29. * Describe the purpose
  30. *
  31. * @author <a href="mailto:flemming.harms@gmail.com">Flemming Harms</a>
  32. */
  33. public class JavaConsole implements ConsoleWrapper<Console> {
  34. private Console theConsole = System.console();
  35. public void JavaConsole() {}
  36. @Override
  37. public Console format(String fmt, Object... args) throws IllegalFormatException {
  38. return theConsole.format(fmt,args);
  39. }
  40. @Override
  41. public void printf(String format, Object... args) throws IllegalFormatException {
  42. theConsole.printf(format,args);
  43. }
  44. @Override
  45. public String readLine(String fmt, Object... args) throws IOError {
  46. return theConsole.readLine(fmt,args);
  47. }
  48. @Override
  49. public char[] readPassword(String fmt, Object... args) throws IllegalFormatException, IOError {
  50. return theConsole.readPassword(fmt,args);
  51. }
  52. @Override
  53. public Console getConsole() {
  54. return theConsole;
  55. }
  56. }