public Resource getInstance(ResourceContext resourceContext)
throws ResourceException,
ResourceContextException,
ResourceUnknownException
{
ResourceKey key = resourceContext.getResourceKey();
Resource resource = null;
try
{
synchronized (m_lock)
{
resource = find(key); //attempt to find from the underlying cache
}
}
catch (ResourceException re)
{
Object id = key.getValue();
//create as many clients as requested...
try
{
WeatherClientConfigResource myresource = (WeatherClientConfigResource) createInstance(key); //this will create the resource IF it is has default constructor. It also calls init() on the resource.
//the next line will create an EPR