task.setTaskName(taskType);
private void configureTask(Task helper) { helper.setProject(getProject()); helper.setTaskName(getTaskName()); helper.setOwningTarget(getOwningTarget()); helper.init(); }
/** * Factory method to create the components. * * This should be called by UnknownElement. * * @param ue The Unknown Element creating this component. * @param ns Namespace URI. Also available as ue.getNamespace(). * @param componentType The component type, * Also available as ue.getComponentName(). * @return the created component. * @throws BuildException if an error occurs. */ public Object createComponent(UnknownElement ue, String ns, String componentType) throws BuildException { Object component = createComponent(componentType); if (component instanceof Task) { Task task = (Task) component; task.setLocation(ue.getLocation()); task.setTaskType(componentType); task.setTaskName(ue.getTaskName()); task.setOwningTarget(ue.getOwningTarget()); task.init(); } return component; }
/** * Bind a task to another; use this when configuring a newly created * task to do work on behalf of another. * Project, OwningTarget, TaskName, Location and Description are all copied * * Important: this method does not call {@link Task#init()}. * If you are creating a task to delegate work to, call {@link Task#init()} * to initialize it. * * @param owner owning target * @since Ant1.7 */ public final void bindToOwner(Task owner) { setProject(owner.getProject()); setOwningTarget(owner.getOwningTarget()); setTaskName(owner.getTaskName()); setDescription(owner.getDescription()); setLocation(owner.getLocation()); setTaskType(owner.getTaskType()); } }
task.setProject(helperImpl.project); task.setTaskName(tag);
Task task = (Task) o; task.setTaskType(ue.getTaskType()); task.setTaskName(ue.getTaskName()); task.init();
Task childTask = (Task) realChild; childTask.setRuntimeConfigurableWrapper(childWrapper); childTask.setTaskName(childName); childTask.setTaskType(childName);
Task task = new Task(); task.setId(cursor.getInt(0)); task.setTaskName(cursor.getString(1)); task.setStatus(cursor.getInt(2));
/** * Configure the given task by setting name, project root, etc. * @param srcTask source task * @param dstTask destination task */ public static void configure(final Task srcTask, final Task dstTask) { dstTask.setTaskName(srcTask.getTaskName()); dstTask.setProject(srcTask.getProject()); }
public void execute() throws BuildException { //Leave XJC2 in the publicly visible place // and then isolate XJC1 in a child class loader, // then use a MaskingClassLoader // so that the XJC2 classes in the parent class loader // won't interfere with loading XJC1 classes in a child class loader ClassLoader ccl = Thread.currentThread().getContextClassLoader(); try { ClassLoader cl = createClassLoader(); Class driver = cl.loadClass(getCoreClassName()); Task t = (Task)driver.newInstance(); t.setProject(getProject()); t.setTaskName(getTaskName()); root.configure(t); Thread.currentThread().setContextClassLoader(cl); t.execute(); } catch (UnsupportedClassVersionError e) { throw new BuildException("Requires JDK 5.0 or later. Please download it from http://java.sun.com/j2se/1.5/"); } catch (ClassNotFoundException e) { throw new BuildException(e); } catch (InstantiationException e) { throw new BuildException(e); } catch (IllegalAccessException e) { throw new BuildException(e); } catch (IOException e) { throw new BuildException(e); } finally { Thread.currentThread().setContextClassLoader(ccl); } }
/** * {@inheritDoc} * @see AntTaskFactory#createTask(String) */ public Task createTask(String theName) { Task retVal = this.currentProject.createTask(theName); if (retVal != null) { retVal.setTaskName(this.currentTaskName); retVal.setLocation(this.currentLocation); retVal.setOwningTarget(this.currentOwningTarget); } return retVal; } }
/** * {@inheritDoc} * @see AntTaskFactory#createTask(String) */ public Task createTask(String theName) { Task retVal = this.currentProject.createTask(theName); if (retVal != null) { retVal.setTaskName(this.currentTaskName); retVal.setLocation(this.currentLocation); retVal.setOwningTarget(this.currentOwningTarget); } return retVal; } }
t.setTaskName(getTaskName()); root.configure(t); t.setTaskName(null); t.setProject(null); t = null;
t.setTaskName(getTaskName()); root.configure(t); t.setTaskName(null); t.setProject(null); t = null;
/** * {@inheritDoc} */ @Override public Task createTask(String theName) { ifSshLoadTaskDef(theName); Task retVal = this.currentProject.createTask(theName); if (retVal != null) { retVal.setTaskName(this.currentTaskName); retVal.setLocation(this.currentLocation); retVal.setOwningTarget(this.currentOwningTarget); } return retVal; }
/** * {@inheritDoc} */ @Override public Task createTask(String theName) { ifSshLoadTaskDef(theName); Task retVal = this.currentProject.createTask(theName); if (retVal != null) { retVal.setTaskName(this.currentTaskName); retVal.setLocation(this.currentLocation); retVal.setOwningTarget(this.currentOwningTarget); } return retVal; }
@Override public Object handleCall(Object ctx, Object... args) { try { // see ComponentHelper.createComponent(UnknownElement, String, String) IntrospectionHelper helper = IntrospectionHelper.getHelper(_taskClass); Task taskInstance = (Task) _taskClass.newInstance(); taskInstance.setProject(Aardvark.getProject()); taskInstance.setTaskName(_taskName); taskInstance.init(); for (int i = 0; i < args.length; i++) { if (args[i] != null) { _taskMethods[i].invoke(taskInstance, args[i], helper); } } taskInstance.execute(); return taskInstance; } catch (IllegalAccessException e) { // should never happen throw GosuExceptionUtil.forceThrow(e); } catch (InstantiationException e) { // should not happen - we know we can instantiate the task throw GosuExceptionUtil.forceThrow(e); } } }