static byte[] exportJsonData(JsonDataProvider jsonDataProvider) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(bytes)); addEntry(out, "deployment", jsonDataProvider.receiveDeployment()); addEntry(out, "observers", jsonDataProvider.receiveObservers(0, 0, null, Representation.FULL.toString())); addEntry(out, "beans", jsonDataProvider.receiveBeans(0, 0, null, Representation.FULL.toString())); addEntry(out, "fired-events", jsonDataProvider.receiveEvents(0, 0, null)); addEntry(out, "invocation-trees", jsonDataProvider.receiveInvocations(0, 0, null, Representation.FULL.toString())); addEntry(out, "contexts", jsonDataProvider.receiveContexts()); for (String contextKey : Components.INSPECTABLE_SCOPES.keySet()) { addEntry(out, "context-" + contextKey, jsonDataProvider.receiveContext(contextKey)); } // Intentionally do not export contextual instances out.close(); return bytes.toByteArray(); }
@Override protected void handle(HttpMethod method, JsonDataProvider jsonDataProvider, String[] resourcePathParts, HttpServletRequest req, HttpServletResponse resp) throws IOException { if (!HttpMethod.GET.equals(method)) { resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); return; } setHeaders(resp, "application/zip"); resp.setHeader("Content-disposition", "attachment; filename=\"weld-probe-export.zip\""); ServletOutputStream out = resp.getOutputStream(); out.write(Exports.exportJsonData(jsonDataProvider)); out.flush(); } }),
@Override protected void handle(HttpMethod method, JsonDataProvider jsonDataProvider, String[] resourcePathParts, HttpServletRequest req, HttpServletResponse resp) throws IOException { if (!HttpMethod.GET.equals(method)) { resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); return; } setHeaders(resp, "application/zip"); resp.setHeader("Content-disposition", "attachment; filename=\"weld-probe-export.zip\""); ServletOutputStream out = resp.getOutputStream(); out.write(Exports.exportJsonData(jsonDataProvider)); out.flush(); } }),
static byte[] exportJsonData(JsonDataProvider jsonDataProvider) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(bytes)); addEntry(out, "deployment", jsonDataProvider.receiveDeployment()); addEntry(out, "observers", jsonDataProvider.receiveObservers(0, 0, null, Representation.FULL.toString())); addEntry(out, "beans", jsonDataProvider.receiveBeans(0, 0, null, Representation.FULL.toString())); addEntry(out, "fired-events", jsonDataProvider.receiveEvents(0, 0, null)); addEntry(out, "invocation-trees", jsonDataProvider.receiveInvocations(0, 0, null, Representation.FULL.toString())); addEntry(out, "contexts", jsonDataProvider.receiveContexts()); for (String contextKey : Components.INSPECTABLE_SCOPES.keySet()) { addEntry(out, "context-" + contextKey, jsonDataProvider.receiveContext(contextKey)); } // Intentionally do not export contextual instances out.close(); return bytes.toByteArray(); }
@Override protected void handle(HttpMethod method, JsonDataProvider jsonDataProvider, String[] resourcePathParts, HttpServletRequest req, HttpServletResponse resp) throws IOException { if (!HttpMethod.GET.equals(method)) { resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); return; } setHeaders(resp, "application/zip"); resp.setHeader("Content-disposition", "attachment; filename=\"weld-probe-export.zip\""); ServletOutputStream out = resp.getOutputStream(); out.write(Exports.exportJsonData(jsonDataProvider)); out.flush(); } }),
static byte[] exportJsonData(JsonDataProvider jsonDataProvider) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(bytes)); addEntry(out, "deployment", jsonDataProvider.receiveDeployment()); addEntry(out, "observers", jsonDataProvider.receiveObservers(0, 0, null, Representation.FULL.toString())); addEntry(out, "beans", jsonDataProvider.receiveBeans(0, 0, null, Representation.FULL.toString())); addEntry(out, "fired-events", jsonDataProvider.receiveEvents(0, 0, null)); addEntry(out, "invocation-trees", jsonDataProvider.receiveInvocations(0, 0, null, Representation.FULL.toString())); addEntry(out, "contexts", jsonDataProvider.receiveContexts()); for (String contextKey : Components.INSPECTABLE_SCOPES.keySet()) { addEntry(out, "context-" + contextKey, jsonDataProvider.receiveContext(contextKey)); } // Intentionally do not export contextual instances out.close(); return bytes.toByteArray(); }
@Override protected void handle(HttpMethod method, JsonDataProvider jsonDataProvider, String[] resourcePathParts, HttpServletRequest req, HttpServletResponse resp) throws IOException { if (!HttpMethod.GET.equals(method)) { resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); return; } setHeaders(resp, "application/zip"); resp.setHeader("Content-disposition", "attachment; filename=\"weld-probe-export.zip\""); ServletOutputStream out = resp.getOutputStream(); out.write(Exports.exportJsonData(jsonDataProvider)); out.flush(); } }),
static byte[] exportJsonData(JsonDataProvider jsonDataProvider) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(bytes)); addEntry(out, "deployment", jsonDataProvider.receiveDeployment()); addEntry(out, "observers", jsonDataProvider.receiveObservers(0, 0, null, Representation.FULL.toString())); addEntry(out, "beans", jsonDataProvider.receiveBeans(0, 0, null, Representation.FULL.toString())); addEntry(out, "fired-events", jsonDataProvider.receiveEvents(0, 0, null)); addEntry(out, "invocation-trees", jsonDataProvider.receiveInvocations(0, 0, null, Representation.FULL.toString())); addEntry(out, "contexts", jsonDataProvider.receiveContexts()); for (String contextKey : Components.INSPECTABLE_SCOPES.keySet()) { addEntry(out, "context-" + contextKey, jsonDataProvider.receiveContext(contextKey)); } // Intentionally do not export contextual instances out.close(); return bytes.toByteArray(); }
@Override protected void handle(HttpMethod method, JsonDataProvider jsonDataProvider, String[] resourcePathParts, HttpServletRequest req, HttpServletResponse resp) throws IOException { if (!HttpMethod.GET.equals(method)) { resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); return; } setHeaders(resp, "application/zip"); resp.setHeader("Content-disposition", "attachment; filename=\"weld-probe-export.zip\""); ServletOutputStream out = resp.getOutputStream(); out.write(Exports.exportJsonData(jsonDataProvider)); out.flush(); } }),
static byte[] exportJsonData(JsonDataProvider jsonDataProvider) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(bytes)); addEntry(out, "deployment", jsonDataProvider.receiveDeployment()); addEntry(out, "observers", jsonDataProvider.receiveObservers(0, 0, null, Representation.FULL.toString())); addEntry(out, "beans", jsonDataProvider.receiveBeans(0, 0, null, Representation.FULL.toString())); addEntry(out, "fired-events", jsonDataProvider.receiveEvents(0, 0, null)); addEntry(out, "invocation-trees", jsonDataProvider.receiveInvocations(0, 0, null, Representation.FULL.toString())); addEntry(out, "contexts", jsonDataProvider.receiveContexts()); for (String contextKey : Components.INSPECTABLE_SCOPES.keySet()) { addEntry(out, "context-" + contextKey, jsonDataProvider.receiveContext(contextKey)); } // Intentionally do not export contextual instances out.close(); return bytes.toByteArray(); }
@Override protected void handle(HttpMethod method, JsonDataProvider jsonDataProvider, String[] resourcePathParts, HttpServletRequest req, HttpServletResponse resp) throws IOException { if (!HttpMethod.GET.equals(method)) { resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); return; } setHeaders(resp, "application/zip"); resp.setHeader("Content-disposition", "attachment; filename=\"weld-probe-export.zip\""); ServletOutputStream out = resp.getOutputStream(); out.write(Exports.exportJsonData(jsonDataProvider)); out.flush(); } }),
static byte[] exportJsonData(JsonDataProvider jsonDataProvider) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(bytes)); addEntry(out, "deployment", jsonDataProvider.receiveDeployment()); addEntry(out, "observers", jsonDataProvider.receiveObservers(0, 0, null, Representation.FULL.toString())); addEntry(out, "beans", jsonDataProvider.receiveBeans(0, 0, null, Representation.FULL.toString())); addEntry(out, "fired-events", jsonDataProvider.receiveEvents(0, 0, null)); addEntry(out, "invocation-trees", jsonDataProvider.receiveInvocations(0, 0, null, Representation.FULL.toString())); addEntry(out, "contexts", jsonDataProvider.receiveContexts()); for (String contextKey : Components.INSPECTABLE_SCOPES.keySet()) { addEntry(out, "context-" + contextKey, jsonDataProvider.receiveContext(contextKey)); } // Intentionally do not export contextual instances out.close(); return bytes.toByteArray(); }
@Override protected void handle(HttpMethod method, JsonDataProvider jsonDataProvider, String[] resourcePathParts, HttpServletRequest req, HttpServletResponse resp) throws IOException { if (!HttpMethod.GET.equals(method)) { resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); return; } setHeaders(resp, "application/zip"); resp.setHeader("Content-disposition", "attachment; filename=\"weld-probe-export.zip\""); ServletOutputStream out = resp.getOutputStream(); out.write(Exports.exportJsonData(jsonDataProvider)); out.flush(); } }),
static byte[] exportJsonData(JsonDataProvider jsonDataProvider) throws IOException { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(bytes)); addEntry(out, "deployment", jsonDataProvider.receiveDeployment()); addEntry(out, "observers", jsonDataProvider.receiveObservers(0, 0, null, Representation.FULL.toString())); addEntry(out, "beans", jsonDataProvider.receiveBeans(0, 0, null, Representation.FULL.toString())); addEntry(out, "fired-events", jsonDataProvider.receiveEvents(0, 0, null)); addEntry(out, "invocation-trees", jsonDataProvider.receiveInvocations(0, 0, null, Representation.FULL.toString())); addEntry(out, "contexts", jsonDataProvider.receiveContexts()); for (String contextKey : Components.INSPECTABLE_SCOPES.keySet()) { addEntry(out, "context-" + contextKey, jsonDataProvider.receiveContext(contextKey)); } // Intentionally do not export contextual instances out.close(); return bytes.toByteArray(); }
private void exportDataIfNeeded(BeanManagerImpl manager) { String export = manager.getServices().get(WeldConfiguration.class).getStringProperty(ConfigurationKey.PROBE_EXPORT_DATA_AFTER_DEPLOYMENT); if (!export.isEmpty()) { File exportPath = new File(export); if (!exportPath.canWrite()) { ProbeLogger.LOG.invalidExportPath(exportPath); return; } try { Files.write(new File(exportPath, "weld-probe-export.zip").toPath(), Exports.exportJsonData(jsonDataProvider)); } catch (IOException e) { ProbeLogger.LOG.unableToExportData(exportPath, e.getCause() != null ? e.getCause() : e); ProbeLogger.LOG.catchingTrace(e); } } }
private void exportDataIfNeeded(BeanManagerImpl manager) { String export = manager.getServices().get(WeldConfiguration.class).getStringProperty(ConfigurationKey.PROBE_EXPORT_DATA_AFTER_DEPLOYMENT); if (!export.isEmpty()) { File exportPath = new File(export); if (!exportPath.canWrite()) { ProbeLogger.LOG.invalidExportPath(exportPath); return; } try { Files.write(new File(exportPath, "weld-probe-export.zip").toPath(), Exports.exportJsonData(jsonDataProvider)); } catch (IOException e) { ProbeLogger.LOG.unableToExportData(exportPath, e.getCause() != null ? e.getCause() : e); ProbeLogger.LOG.catchingTrace(e); } } }
private void exportDataIfNeeded(BeanManagerImpl manager) { String export = manager.getServices().get(WeldConfiguration.class).getStringProperty(ConfigurationKey.PROBE_EXPORT_DATA_AFTER_DEPLOYMENT); if (!export.isEmpty()) { File exportPath = new File(export); if (!exportPath.canWrite()) { ProbeLogger.LOG.invalidExportPath(exportPath); return; } try { Files.write(new File(exportPath, "weld-probe-export.zip").toPath(), Exports.exportJsonData(jsonDataProvider)); } catch (IOException e) { ProbeLogger.LOG.unableToExportData(exportPath, e.getCause() != null ? e.getCause() : e); ProbeLogger.LOG.catchingTrace(e); } } }
private void exportDataIfNeeded(BeanManagerImpl manager) { String export = manager.getServices().get(WeldConfiguration.class).getStringProperty(ConfigurationKey.PROBE_EXPORT_DATA_AFTER_DEPLOYMENT); if (!export.isEmpty()) { File exportPath = new File(export); if (!exportPath.canWrite()) { ProbeLogger.LOG.invalidExportPath(exportPath); return; } try { Files.write(new File(exportPath, "weld-probe-export.zip").toPath(), Exports.exportJsonData(jsonDataProvider)); } catch (IOException e) { ProbeLogger.LOG.unableToExportData(exportPath, e.getCause() != null ? e.getCause() : e); ProbeLogger.LOG.catchingTrace(e); } } }
private void exportDataIfNeeded(BeanManagerImpl manager) { String export = manager.getServices().get(WeldConfiguration.class).getStringProperty(ConfigurationKey.PROBE_EXPORT_DATA_AFTER_DEPLOYMENT); if (!export.isEmpty()) { File exportPath = new File(export); if (!exportPath.canWrite()) { ProbeLogger.LOG.invalidExportPath(exportPath); return; } try { Files.write(new File(exportPath, "weld-probe-export.zip").toPath(), Exports.exportJsonData(jsonDataProvider)); } catch (IOException e) { ProbeLogger.LOG.unableToExportData(exportPath, e.getCause() != null ? e.getCause() : e); ProbeLogger.LOG.catchingTrace(e); } } }
private void exportDataIfNeeded(BeanManagerImpl manager) { String export = manager.getServices().get(WeldConfiguration.class).getStringProperty(ConfigurationKey.PROBE_EXPORT_DATA_AFTER_DEPLOYMENT); if (!export.isEmpty()) { File exportPath = new File(export); if (!exportPath.canWrite()) { ProbeLogger.LOG.invalidExportPath(exportPath); return; } try { Files.write(new File(exportPath, "weld-probe-export.zip").toPath(), Exports.exportJsonData(jsonDataProvider)); } catch (IOException e) { ProbeLogger.LOG.unableToExportData(exportPath, e.getCause() != null ? e.getCause() : e); ProbeLogger.LOG.catchingTrace(e); } } }