Examples of DumpDestination


Examples of org.apache.karaf.diagnostic.core.DumpDestination

     * {@inheritDoc}
     */
    public void createDump(boolean directory, String name) throws Exception {
        File target = new File(name);

        DumpDestination destination;
        if (directory) {
            destination = new DirectoryDumpDestination(target);
        } else {
            destination = new ZipDumpDestination(target);
        }

        for (DumpProvider provider : providers) {
            provider.createDump(destination);
        }

        destination.save();
    }
View Full Code Here

Examples of org.apache.karaf.diagnostic.core.DumpDestination

    @Argument(name = "name", description = "Name of created zip or directory", required = false)
    String fileName;

    @Override
    protected Object doExecute() throws Exception {
        DumpDestination destination;

        if (providers.isEmpty()) {
            session.getConsole().println("Unable to create dump. No providers were found");
            return null;
        }

        // create default file name if none provided
        if (fileName == null || fileName.trim().length() == 0) {
            fileName = SimpleDateFormat.getDateTimeInstance().format(new Date());
            if (!directory) {
                fileName += ".zip";
            }
        }
        File target = new File(fileName);

        // if directory switch is on, create dump in directory
        if (directory) {
            destination = new DirectoryDumpDestination(target);
        } else {
            destination = new ZipDumpDestination(target);
        }

        for (DumpProvider provider : providers) {
            provider.createDump(destination);
        }
        destination.save();
        session.getConsole().println("Diagnostic dump created.");

        return null;
    }
View Full Code Here

Examples of org.apache.karaf.diagnostic.core.DumpDestination

    @Argument(name = "name", description = "Name of created zip or directory", required = false)
    String fileName;

    @Override
    protected Object doExecute() throws Exception {
        DumpDestination destination;

        if (providers.isEmpty()) {
            session.getConsole().println("Unable to create dump. No providers were found");
            return null;
        }

        // create default file name if none provided
        if (fileName == null || fileName.trim().length() == 0) {
            fileName = dumpFormat.format(new Date());
            if (!directory) {
                fileName += ".zip";
            }
        }
        File target = new File(fileName);

        // if directory switch is on, create dump in directory
        if (directory) {
            destination = new DirectoryDumpDestination(target);
        } else {
            destination = new ZipDumpDestination(target);
        }

        for (DumpProvider provider : providers) {
            provider.createDump(destination);
        }
        destination.save();
        session.getConsole().println("Diagnostic dump created.");

        return null;
    }
View Full Code Here

Examples of org.apache.karaf.diagnostic.core.DumpDestination

     */
    public void createDump(boolean directory, String name) throws MBeanException {
        try {
            File target = new File(name);

            DumpDestination destination;
            if (directory) {
                destination = new DirectoryDumpDestination(target);
            } else {
                destination = new ZipDumpDestination(target);
            }

            for (DumpProvider provider : providers) {
                provider.createDump(destination);
            }

            destination.save();
        } catch (Exception e) {
            throw new MBeanException(null, e.getMessage());
        }
    }
View Full Code Here

Examples of org.apache.karaf.diagnostic.core.DumpDestination

     * {@inheritDoc}
     */
    public void createDump(boolean directory, String name) throws Exception {
        File target = new File(name);

        DumpDestination destination;
        if (directory) {
            destination = Dump.directory(target);
        } else {
            destination = Dump.zip(target);
        }
View Full Code Here

Examples of org.apache.karaf.diagnostic.core.DumpDestination

    }

    public void handle(Signal signal) {
        SimpleDateFormat dumpFormat = new SimpleDateFormat("yyyy-MM-dd_HHmmss-SSS");
        String fileName = "dump-" + dumpFormat.format(new Date()) + ".zip";
        DumpDestination destination = new ZipDumpDestination(new File(fileName));
        Dump.dump(bundleContext, destination);
    }
View Full Code Here

Examples of org.apache.karaf.diagnostic.core.DumpDestination

    @Argument(name = "name", description = "Name of created zip or directory", required = false)
    String fileName;

    @Override
    protected Object doExecute() throws Exception {
        DumpDestination destination;

        // create default file name if none provided
        if (fileName == null || fileName.trim().length() == 0) {
            fileName = dumpFormat.format(new Date());
            if (!directory) {
View Full Code Here

Examples of org.apache.karaf.diagnostic.core.DumpDestination

    @Argument(name = "name", description = "Name of created zip or directory", required = false)
    String fileName;

    @Override
    protected Object doExecute() throws Exception {
        DumpDestination destination;

        if (providers.isEmpty()) {
            session.getConsole().println("Unable to create dump. No providers were found");
            return null;
        }

        // create default file name if none provided
        if (fileName == null || fileName.trim().length() == 0) {
            fileName = dumpFormat.format(new Date());
            if (!directory) {
                fileName += ".zip";
            }
        }
        File target = new File(fileName);

        // if directory switch is on, create dump in directory
        if (directory) {
            destination = new DirectoryDumpDestination(target);
        } else {
            destination = new ZipDumpDestination(target);
        }

        for (DumpProvider provider : providers) {
            provider.createDump(destination);
        }
        destination.save();
        session.getConsole().println("Diagnostic dump created.");

        return null;
    }
View Full Code Here

Examples of org.apache.karaf.diagnostic.core.DumpDestination

    @Argument(name = "name", description = "Name of created zip or directory", required = false)
    String fileName;

    @Override
    protected Object doExecute() throws Exception {
        DumpDestination destination;

        if (providers.isEmpty()) {
            session.getConsole().println("Unable to create dump. No providers were found");
            return null;
        }

        // create default file name if none provided
        if (fileName == null || fileName.trim().length() == 0) {
            fileName = dumpFormat.format(new Date());
            if (!directory) {
                fileName += ".zip";
            }
        }
        File target = new File(fileName);

        // if directory switch is on, create dump in directory
        if (directory) {
            destination = new DirectoryDumpDestination(target);
        } else {
            destination = new ZipDumpDestination(target);
        }

        for (DumpProvider provider : providers) {
            provider.createDump(destination);
        }
        destination.save();
        session.getConsole().println("Diagnostic dump created.");

        return null;
    }
View Full Code Here

Examples of org.apache.karaf.diagnostic.core.DumpDestination

     * {@inheritDoc}
     */
    public void createDump(boolean directory, String name) throws Exception {
        File target = new File(name);

        DumpDestination destination;
        if (directory) {
            destination = new DirectoryDumpDestination(target);
        } else {
            destination = new ZipDumpDestination(target);
        }

        for (DumpProvider provider : providers) {
            provider.createDump(destination);
        }

        destination.save();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.