You are welcomed Anthony. Here you have some 'general' singleton
coding that works 'everywhere' in Java:

public class MySingleton {

  private static class MySingletonHolder {
    private static final MySingleton INSTANCE = new MySingleton();
  }

  private MySingleton() {
    // You'll do all initialization stuff, for example DB pools, here
  }

  public static MySingleton getInstance() {
    return MySingletonHolder.INSTANCE;
  }

  // Rest of the needed methods here (for example, to access the DB pools)

}

This coding uses William Pugh's "initialization on demand holder
idiom" (no need for volatile/synchronized)

Good luck.

On Sun, Jan 2, 2011 at 8:06 AM, Anthony <[email protected]> wrote:
> Fabian,
>
> Being determined to accomplish the task via one of the methods I outlined in 
> original post I completely neglected to consider this approach.
>
> I'll give the Singleton a go as time is slipping through my fingers.
>
> Thanks Fabian!!!
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2695430
>



-- 
Fabián Mandelbaum
IS Engineer

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2695561

Reply via email to