title: Java ee interface conditional inject
body: <p>I have the following interface:</p>
  
  <pre><code>public interface ResultEvaluationInterface {
      public void evaluateResults(Event e);
  }
  </code></pre>
  
  <p>and I want to inject in my class depending on my <code>Event.type</code> different classes with the same implementation. Something like that:</p>
  
  <pre><code>@Stateless
  @LocalBean    
  public class ResultEvaluation implements ResultEvaluationInterface {
  
      @Override
      public void evaluateResults(Event e) {
          switch (e.getType()) {
              case Type.Running:
                 // inject and call ResultEvaluationRunningEJB.evaluateResults(e)
              case Type.Swimming:
                 // inject and call ResultEvaluationSwimmingEJB.evaluateResults(e)
              default:
                 throw new UnsupportedOperationException("Not supported yet.");
          }
      }
  
  }
  </code></pre>
  
  <p><code>ResultEvaluationRunningEJB</code> and <code>ResultEvaluationSwimmingEJB</code> both implement the interface. Anybody has got a good idea how to do that in a good way?</p>