From 89e2fa9b385c37d2aefdccb01c777f87d3e096a2 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Fri, 24 Oct 2014 14:21:05 +0200 Subject: reformat sys info --- .../at/gv/egiz/pdfas/lib/api/PdfAsFactory.java | 61 +++++++++++++--------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java index ae5d7aca..c1861928 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java @@ -109,40 +109,51 @@ public class PdfAsFactory implements IConfigurationConstants { // TODO: register ECCelerate in second position when TLS issue is // fixed registerProvider(new ECCelerate(), -1); - - teeInformation("+ IAIK-JCE Version: " + IAIK.getVersionInfo()); - teeInformation("+ ECCelerate Version: " + ECCelerate.getInstance().getVersion()); } else { logger.info("Skipping Security Provider registration!"); } } private static void teeInformation(String str) { - System.out.println(str); + // System.out.println(str); logger.info(str); } private static void showRuntimeInformation() { try { - RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean(); - OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean(); - teeInformation("+ OS Name: " + osBean.getName()); - teeInformation("+ OS Version: " + osBean.getVersion()); - teeInformation("+ OS Arch: " + osBean.getArch()); - teeInformation("+ JAVA Version: " + runtimeBean.getSystemProperties().get("java.runtime.version")); - teeInformation("+ JAVA Spec ----------------------------------------------------------"); - teeInformation("+ JAVA Spec Name: " + runtimeBean.getSpecName()); - teeInformation("+ JAVA Spec Version: " + runtimeBean.getSpecVersion()); - teeInformation("+ JAVA Spec Vendor: " + runtimeBean.getSpecVendor()); - teeInformation("+ JAVA VM ----------------------------------------------------------"); - teeInformation("+ JAVA VM Name: " + runtimeBean.getVmName()); - teeInformation("+ JAVA VM Version: " + runtimeBean.getVmVersion()); - teeInformation("+ JAVA VM Vendor: " + runtimeBean.getVmVendor()); - } catch(Throwable e) { + RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean(); + OperatingSystemMXBean osBean = ManagementFactory + .getOperatingSystemMXBean(); + teeInformation("+ OS Name: " + osBean.getName()); + teeInformation("+ OS Version: " + osBean.getVersion()); + teeInformation("+ OS Arch: " + osBean.getArch()); + teeInformation("+ JAVA Version: " + + runtimeBean.getSystemProperties().get( + "java.runtime.version")); + teeInformation("+ JAVA Spec ----------------------------------------------------------"); + teeInformation("+ JAVA Spec Name: " + runtimeBean.getSpecName()); + teeInformation("+ JAVA Spec Version: " + + runtimeBean.getSpecVersion()); + teeInformation("+ JAVA Spec Vendor: " + runtimeBean.getSpecVendor()); + teeInformation("+ JAVA VM ----------------------------------------------------------"); + teeInformation("+ JAVA VM Name: " + runtimeBean.getVmName()); + teeInformation("+ JAVA VM Version: " + runtimeBean.getVmVersion()); + teeInformation("+ JAVA VM Vendor: " + runtimeBean.getVmVendor()); + } catch (Throwable e) { teeInformation("+ Failed to show runtime informations"); } } - + + private static void showSecProviderInfo() { + try { + teeInformation("+ IAIK-JCE Version: " + IAIK.getVersionInfo()); + teeInformation("+ ECCelerate Version: " + + ECCelerate.getInstance().getVersion()); + } catch (Throwable e) { + teeInformation("+ Failed to show security provider informations"); + } + } + /** * Configure log. * @@ -154,12 +165,12 @@ public class PdfAsFactory implements IConfigurationConstants { synchronized (init_mutex) { if (!initialized) { initialized = true; - + registerSecurityProvider(configuration); teeInformation("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); teeInformation("+ PDF-AS: " + getVersion()); teeInformation("+ PDF-AS SCM Revision: " + getSCMRevision()); showRuntimeInformation(); - registerSecurityProvider(configuration); + showSecProviderInfo(); teeInformation("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); listRegisteredSecurityProviders(); @@ -214,8 +225,10 @@ public class PdfAsFactory implements IConfigurationConstants { * @return */ public static SignParameter createSignParameter( - Configuration configuration, DataSource dataSource, OutputStream output) { - SignParameter param = new SignParameterImpl(configuration, dataSource, output); + Configuration configuration, DataSource dataSource, + OutputStream output) { + SignParameter param = new SignParameterImpl(configuration, dataSource, + output); return param; } -- cgit v1.2.3