Just saw the second post on the topic today.
Wondering why there are none in the framework...
should we perhaps have an
public interface SingletonService extends Service
{
public SingletonService getInstance();
}
public abstract class AbstractSingletonService implements SingletonService
{
static SingletonService m_instance = null;
private AbstractSingletonService()
{
}
public static SingletonService getInstance()
{
if( m_instance == null )
m_instance = createInstance();
return m_instance;
}
protected abstract static SingletonService createInstance();
}
public class SomeSingletonService extends AbstractSingletonService
{
protected static SomeSingletonService createInstance()
{
return new SomeSingletonService();
}
}
...it is easy to modify phoenix so you can
have per-application singleton services like
this.
thoughts? votes? bad idea?
- Leo
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]