What does this mean?
static { cache = new Cache(); }
The whole class is as:
public class ServiceLocator { private static Cache cache; static { cache = new Cache(); } public static Service getService(String jndiName){ Service service = cache.getService(jndiName); if(service != null){ return service; } InitialContext context = new InitialContext(); Service service1 = (Service)context.lookup(jndiName); cache.addService(service1); return service1; } }
So what is the role of this code in the application? (Is it a nameless static method? What is it called?)