View Javadoc
1 /* 2 * PROJECT : DAR Runtime and Tools 3 * COPYRIGHT : Copyright (C) 1999-2004 tim.stephenson@enableit.org 4 * LICENSE : GNU LESSER GENERAL PUBLIC LICENSE 5 * Version 2.1, February 1999 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 */ 21 22 package org.enableit.db.darrt.ant; 23 24 import org.apache.log4j.Logger; 25 import org.apache.tools.ant.BuildException; 26 import org.enableit.db.darrt.SchemaHandler; 27 28 29 /*** 30 * Changes the values defining the target database in the provider element 31 * of the schema definition XML. 32 * 33 * @deprecated Functionality rolled into DarTask. 34 */ 35 public class ChangeTargetTask extends AbstractSchemaTask { 36 37 /*** 38 * The Log4J <code>Logger</code> doing the logging. 39 */ 40 protected static Logger logger = Logger.getLogger(ChangeTargetTask.class); 41 42 /*** 43 * CVS info ABOUT this class and its current version 44 */ 45 public static final String ABOUT = "$Revision: 1.7 $"; 46 47 /*** 48 * Default constructor. 49 */ 50 public ChangeTargetTask() { 51 super(); 52 } 53 54 /*** 55 * Creates the schema. 56 */ 57 public void execute() 58 throws BuildException { 59 checkRefInputs(); 60 61 try { 62 log("Modifying schema definition's target... "); 63 64 SchemaHandler schemaHandler = getSchemaHandler(); 65 66 schemaHandler.changeTarget(); 67 } catch (org.enableit.db.darrt.SchemaHandlingException e) { 68 logger.error(e.getClass().getName() + ":" + e.getMessage()); 69 throw new BuildException(e.getMessage()); 70 } catch (BuildException e) { 71 throw e; 72 } catch (Exception e) { 73 logger.error(e.getClass().getName() + ":" + e.getMessage()); 74 throw new BuildException(e.getMessage()); 75 } 76 } 77 }

This page was automatically generated by Maven