The service implementation is a cover for the singleton.  Imagine:

/**
* A simple HiveMind service
*/
public interface ISomeService {

 void doSomething();

}

/**
* The implementation of the hivemind service, delegates to the singleton.
*/
public class SomeServiceImpl implements ISomeService {

 public void doSomething() {
   SomeServiceSingleton.Instance().doSomething();
 }

}

/**
* The implementation of the hivemind service as a singleton
*/
public class SomeServiceSingleton implements ISomeService {

 private static SomeServiceSingleton instance;

 private SomeServiceSingleton(){}

 public static synchronized SomeServiceSingleton Instance() {
   if (instance == null) {
     instance = new SomeServiceSingleton();
   }
   return instance;
 }

 public void doSomething() {
   // do it.
 }

}

-Mike

On 5/4/06, Oscar Picasso <[EMAIL PROTECTED]> wrote:
I guess you get your singleton using a static method. But how do you write your 
hivemodule.xml to do that ?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to