|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.muse.core.AbstractFilePersistence
org.apache.muse.core.routing.RouterFilePersistence
public class RouterFilePersistence
RouterFilePersistence is a component that saves router entries (EPRs and their resource types) to XML files on disk.
Constructor Summary | |
---|---|
RouterFilePersistence()
|
Method Summary | |
---|---|
protected void |
createResourceFile(EndpointReference epr,
Resource resource,
File resourceFile)
This method should be overridden by concrete file-based persistence classes to create the given file and fill it with the appropriate XML content. |
protected String |
getFilePrefix()
|
protected Resource |
reloadResource(String contextPath,
Element resourceXML)
This method should be overridden by concrete file-based persistence classes to update a resource instance with the saved data from the XML fragment. |
void |
resourceAdded(EndpointReference epr,
Resource resource)
This implementation checks to see if the resource type is one that is being persisted, and if so, creates a file for the instance. |
void |
resourceRemoved(EndpointReference epr)
This implementation checks to see if the resource type is one that is being persisted, and if so, tries to delete the resource's file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.muse.core.Persistence |
---|
getPersistenceLocation, getResourceManager, reload, setPersistenceLocation, setResourceManager |
Methods inherited from interface org.apache.muse.core.InitializationParameters |
---|
getInitializationParameter, getInitializationParameters, setInitializationParameters |
Constructor Detail |
---|
public RouterFilePersistence()
Method Detail |
---|
protected void createResourceFile(EndpointReference epr, Resource resource, File resourceFile) throws SoapFault
createResourceFile
in class AbstractFilePersistence
epr
- The EPR that maps to the given Resource in the ResourceManager.resource
- The resource instance whose state is being persisted.resourceFile
- The File object that represents the yet-to-be-created XML file
that will contain the content generated by this method. The
implementation of this method must be sure to create the File
on disk somehow.
SoapFault
- protected String getFilePrefix()
getFilePrefix
in class AbstractFilePersistence
AbstractFilePersistence.getNextFileNumber(String)
protected Resource reloadResource(String contextPath, Element resourceXML) throws SoapFault
reloadResource
in class AbstractFilePersistence
contextPath
- The context path of the instance's resource type.resourceXML
- The persisted data that must be reloaded.
SoapFault
public void resourceAdded(EndpointReference epr, Resource resource) throws SoapFault
resourceAdded
in interface ResourceManagerListener
epr
- The unique EPR that is being associated with the new resource.
This value should always be used over Resource.getEndpointReference()
because some applications may choose to map multiple EPRs to the
same resource instance, and thus getEndpointReference() will not
provide an accurate value.resource
- The resource instance being associated with the given EPR.
SoapFault
public void resourceRemoved(EndpointReference epr) throws SoapFault
resourceRemoved
in interface ResourceManagerListener
epr
- The unique EPR of the resource that has been destroyed - the
Resource object is not provided because it would most likely
be in an inconsistent state. At this point, the resource has
already been 'destroyed'.
SoapFault
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |