From kato-commits-return-1000-apmail-incubator-kato-commits-archive=incubator.apache.org@incubator.apache.org Tue Dec 22 22:58:18 2009 Return-Path: Delivered-To: apmail-incubator-kato-commits-archive@minotaur.apache.org Received: (qmail 52628 invoked from network); 22 Dec 2009 22:58:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Dec 2009 22:58:18 -0000 Received: (qmail 4604 invoked by uid 500); 22 Dec 2009 22:58:18 -0000 Delivered-To: apmail-incubator-kato-commits-archive@incubator.apache.org Received: (qmail 4590 invoked by uid 500); 22 Dec 2009 22:58:18 -0000 Mailing-List: contact kato-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: kato-dev@incubator.apache.org Delivered-To: mailing list kato-commits@incubator.apache.org Received: (qmail 4580 invoked by uid 99); 22 Dec 2009 22:58:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Dec 2009 22:58:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Dec 2009 22:58:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B6AB223889F7; Tue, 22 Dec 2009 22:57:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r893336 - /incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/spi/delegates/JavaDumpDelegate.java Date: Tue, 22 Dec 2009 22:57:55 -0000 To: kato-commits@incubator.apache.org From: spoole@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091222225755.B6AB223889F7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: spoole Date: Tue Dec 22 22:57:55 2009 New Revision: 893336 URL: http://svn.apache.org/viewvc?rev=893336&view=rev Log: added missing licence files to new Java code Added: incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/spi/delegates/JavaDumpDelegate.java Added: incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/spi/delegates/JavaDumpDelegate.java URL: http://svn.apache.org/viewvc/incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/spi/delegates/JavaDumpDelegate.java?rev=893336&view=auto ============================================================================== --- incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/spi/delegates/JavaDumpDelegate.java (added) +++ incubator/kato/trunk/org.apache.kato/kato.api.vm/src/main/java/javax/tools/diagnostics/vm/spi/delegates/JavaDumpDelegate.java Tue Dec 22 22:57:55 2009 @@ -0,0 +1,76 @@ +/******************************************************************************* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ +package javax.tools.diagnostics.vm.spi.delegates; + +import java.io.File; +import java.io.IOException; + +import javax.tools.diagnostics.vm.DumpDescriptor; +import javax.tools.diagnostics.vm.DumpHandle; +import javax.tools.diagnostics.vm.DumpInitiatorDelegate; +import javax.tools.diagnostics.vm.spi.DumpInitiatorCapabilities; + +public class JavaDumpDelegate implements DumpInitiatorDelegate { + + /* + * (non-Javadoc) + * + * @see javax.tools.diagnostics.vm.DumpInitiatorDelegate#dump() + */ + + private boolean createDump() throws IOException { + + File dumpFile=new File("dump.kato"); + return dumpFile.createNewFile(); + + + } + + public boolean available() { + return true; + } + + @Override + public DumpHandle createDumpHandle() { + return new DumpHandle() { + + @Override + public boolean dump() throws IOException { + return createDump(); + } + }; + } + + @Override + public DumpHandle createDumpHandle(DumpDescriptor descriptor) { + return new DumpHandle() { + + @Override + public boolean dump() throws IOException { + return createDump(); + } + }; + } + + @Override + public DumpInitiatorCapabilities getCapabilities() { + return new DumpInitiatorCapabilities() { + }; + } + + @Override + public String getDumpType() { + return "dump.kato"; + } +} \ No newline at end of file