Using Singleton with Interfaces Java
<p>I want to know, how to use the singleton pattern with interfaces? I have created an interface:</p>
<pre><code>public interface BusinessService {

   BusinessService getInstance();

}
</code></pre>
<p>I make this implementation:</p>
<pre><code>public class BusinessServiceImpl implements BusinessService {

  private static BusinessServiceImpl instance = null;

  private BusinessServiceImpl(){ }

  @Override
  public BusinessServiceImpl getInstance() {
    if (instance == null) {
        BusinessServiceImpl.instance = new BusinessServiceImpl();
    }
    return BusinessServiceImpl.instance;
  }
}
</code></pre>
<p>How can I get access to getInstance from my main-class?
I tried something like</p>
<pre><code>private BusinessService service = new BusinessServiceImpl();
</code></pre>
<p>(does not work - Constructor from BusinessServiceImpl() is private)</p>
<p>But what else? Can you help me out?</p>
<p><strong>Edit</strong>: I'm using Java Spring! I don't want to use Java Springs - Dependency Injection!</p>
<p>Greets, Mira</p>