String contextPath = resource.getContextPath();
/** * * This implementation checks to see if the resource type is one that * is being persisted, and if so, creates a file for the instance. * */ public void resourceAdded(EndpointReference epr, Resource resource) throws SoapFault { String contextPath = resource.getContextPath(); if (getResourceManager().isUsingPersistence(contextPath)) createResourceFile(epr, resource); }
/** * * Creates the proper file name for the given resource instance and then * delegates creation of the file's contents to the abstract method of * the same name. * * @param epr * @param resource * * @see #getNextFileNumber(String) * @see #createResourceFile(EndpointReference, Resource, File) * */ protected void createResourceFile(EndpointReference epr, Resource resource) throws SoapFault { String contextPath = resource.getContextPath(); int nextNumber = getNextFileNumber(contextPath); String nextFileName = getNextFileName(nextNumber); File resourceTypeDir = getResourceTypeDirectory(contextPath); File resourceFile = new File(resourceTypeDir, nextFileName); createResourceFile(epr, resource, resourceFile); Map fileNumbersByEPR = (Map)getFileNumberTables().get(contextPath); fileNumbersByEPR.put(epr, new Integer(nextNumber)); }
public void initialize() throws SoapFault { super.initialize(); // // make sure the owner resource type IS a service group // Resource resource = getResource(); if (!resource.hasCapability(WssgConstants.SERVICE_GROUP_URI)) { Object[] filler = { resource.getContextPath(), resource.getCapabilityURIs() }; throw new RuntimeException(_MESSAGES.get("NoServiceGroupCapability", filler)); } }