public class EventAgent
{
// private constructor ensures no other instances
private EventAgent() { }
// static member variable and method enables callers
// to get to the one-and-only object instance
private static final EventAgent SINGLE_INSTANCE = new EventAgent();
public static EventAgent getInstance()
{
return SINGLE_INSTANCE;
}
...
}