/** * * This method can be overridden to provide an alternate implementation * of the ResourceManager component to the router. * * @return An instance of SimpleResourceManager. * */ protected ResourceManager createResourceManager() { return new SimpleResourceManager(); }
/** * adds resource definitions to the manager. If the collection is * empty or null, no action is taken * @param definitions the collection of resource definitions to be added to the manager */ public void addResourceDefinitions(Collection definitions) { if(definitions == null || definitions.isEmpty()) return; super.addResourceDefinitions(definitions); }
public String getResourceContextPath(Class capabilityClass) { Collection matches = getResourceContextPaths(capabilityClass); return matches.isEmpty() ? null : (String)matches.iterator().next(); }
/** * * This implementation loops through all existing resource instances * and tells them to shutdown(). * */ public void shutdown() throws SoapFault { Iterator i = getResourceEPRs(); while (i.hasNext()) { Resource next = getResource((EndpointReference)i.next()); next.shutdown(); } _hasBeenShutdown = true; } }
public Resource createResource(String contextPath) throws SoapFault { ResourceDefinition definition = getResourceDefinition(contextPath); if (definition == null) { Object[] filler = { contextPath, _definitionsByPath.keySet() }; throw new SoapFault(_MESSAGES.get("ContextPathNotFound", filler)); } Resource resource = definition.newInstance(); resource.setResourceManager(this); fixContextPath(resource); // HACK: see javadoc for fixContextPath() return resource; }
throw new NullPointerException(_MESSAGES.get("NullClass")); Iterator i = getResourceContextPaths().iterator(); ResourceDefinition resource = getResourceDefinition(path); Iterator j = resource.getCapabilityDefinitions().iterator();
public void addResource(EndpointReference epr, Resource resource) throws SoapFault { if (resource == null) throw new NullPointerException(_MESSAGES.get("NullResource")); synchronized (this) { // // the key already exists - not allowed! // if (_resources.containsKey(epr)) throw new SoapFault(_MESSAGES.get("ResourceEPRExists", new Object[]{ epr })); _resources.put(epr, resource); } // // tell all listeners that a new resource is now available // Iterator i = getListeners().iterator(); while (i.hasNext()) { ResourceManagerListener next = (ResourceManagerListener)i.next(); next.resourceAdded(epr, resource); } }
public boolean isUsingPersistence(String contextPath) { return getResourceDefinition(contextPath).isUsingPersistence(); }
Iterator i = getListeners().iterator();