private void log(String message, int severity, Throwable exception) {
   if (exception != null) {
     if (component instanceof Task) {
       component.getProject().log((Task) component, message, exception, severity);
     } else {
       component.getProject().log(message, exception, severity);
     }
   } else {
     component.log(message, severity);
   }
 }
 /**
  * Bind the runner to a project component. Properties, targets and references are all added as
  * beans; project is bound to project, and self to the component.
  *
  * @param component to become <code>self</code>
  */
 public void bindToComponent(ProjectComponent component) {
   project = component.getProject();
   addBeans(project.getProperties());
   addBeans(project.getUserProperties());
   addBeans(project.getCopyOfTargets());
   addBeans(project.getCopyOfReferences());
   addBean("project", project);
   addBean("self", component);
 }
 /**
  * Bind the runner to a project component. The project and self are the only beans set.
  *
  * @param component to become <code>self</code>
  */
 public void bindToComponentMinimum(ProjectComponent component) {
   project = component.getProject();
   addBean("project", project);
   addBean("self", component);
 }