Class MultiResource

java.lang.Object
org.gvsig.fmap.dal.resource.spi.AbstractResource
org.gvsig.fmap.dal.resource.spi.MultiResource
All Implemented Interfaces:
org.gvsig.fmap.dal.resource.Resource, org.gvsig.fmap.dal.resource.spi.ResourceProvider, org.gvsig.tools.observer.Observable, org.gvsig.tools.observer.WeakReferencingObservable

public class MultiResource extends AbstractResource
Resource implementation which is able to show an unique interface to a group of Resources.
Author:
2009- César Ordiñana - gvSIG team
  • Field Details

  • Constructor Details

    • MultiResource

      public MultiResource(MultiResourceParameters parameters) throws org.gvsig.fmap.dal.exception.InitializeException
      Creates a new MultiResource from the given parameters.
      Parameters:
      parameters - to create the resource from
      Throws:
      org.gvsig.fmap.dal.exception.InitializeException - if there is an error creating the resource
  • Method Details

    • addResource

      public void addResource(org.gvsig.fmap.dal.resource.ResourceParameters parameters, boolean defaultResource) throws org.gvsig.fmap.dal.exception.InitializeException
      Adds a new ResourceProvider to the list of Resources managed by this group.
      Parameters:
      parameters - to create the resource from
      defaultResource - if the added resource is to be used as the multi resource default one
      Throws:
      org.gvsig.fmap.dal.exception.InitializeException - if there is an error adding the resource
    • addResource

      public void addResource(String name, Object[] params, boolean defaultResource) throws org.gvsig.fmap.dal.exception.InitializeException
      Adds a new ResourceProvider to the list of Resources managed by this group.
      Parameters:
      name - of the resource to add
      params - parameters to create the resource with
      defaultResource - if the added resource is to be used as the multi resource default one
      Throws:
      org.gvsig.fmap.dal.exception.InitializeException - if there is an error adding the resource
    • isThis

      public boolean isThis(org.gvsig.fmap.dal.resource.ResourceParameters parameters) throws org.gvsig.fmap.dal.resource.exception.ResourceException
      Throws:
      org.gvsig.fmap.dal.resource.exception.ResourceException
    • notifyChanges

      public void notifyChanges() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyChangesException
      Specified by:
      notifyChanges in interface org.gvsig.fmap.dal.resource.spi.ResourceProvider
      Overrides:
      notifyChanges in class AbstractResource
      Throws:
      org.gvsig.fmap.dal.resource.exception.ResourceNotifyChangesException
    • notifyClose

      public void notifyClose() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyCloseException
      Specified by:
      notifyClose in interface org.gvsig.fmap.dal.resource.spi.ResourceProvider
      Overrides:
      notifyClose in class AbstractResource
      Throws:
      org.gvsig.fmap.dal.resource.exception.ResourceNotifyCloseException
    • notifyDispose

      public void notifyDispose() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyDisposeException
      Specified by:
      notifyDispose in interface org.gvsig.fmap.dal.resource.spi.ResourceProvider
      Overrides:
      notifyDispose in class AbstractResource
      Throws:
      org.gvsig.fmap.dal.resource.exception.ResourceNotifyDisposeException
    • notifyOpen

      public void notifyOpen() throws org.gvsig.fmap.dal.resource.exception.ResourceNotifyOpenException
      Specified by:
      notifyOpen in interface org.gvsig.fmap.dal.resource.spi.ResourceProvider
      Overrides:
      notifyOpen in class AbstractResource
      Throws:
      org.gvsig.fmap.dal.resource.exception.ResourceNotifyOpenException
    • prepare

      public void prepare() throws org.gvsig.fmap.dal.resource.exception.PrepareResourceException
      Specified by:
      prepare in interface org.gvsig.fmap.dal.resource.spi.ResourceProvider
      Overrides:
      prepare in class AbstractResource
      Throws:
      org.gvsig.fmap.dal.resource.exception.PrepareResourceException
    • closeRequest

      public void closeRequest() throws org.gvsig.fmap.dal.resource.exception.ResourceException
      Specified by:
      closeRequest in interface org.gvsig.fmap.dal.resource.Resource
      Overrides:
      closeRequest in class AbstractResource
      Throws:
      org.gvsig.fmap.dal.resource.exception.ResourceException
    • get

      public Object get() throws org.gvsig.fmap.dal.resource.exception.AccessResourceException
      Description copied from class: AbstractResource
      Returns the real resource represented by this object.
      Specified by:
      get in interface org.gvsig.fmap.dal.resource.Resource
      Specified by:
      get in class AbstractResource
      Throws:
      org.gvsig.fmap.dal.resource.exception.AccessResourceException - if there is an error while accessing the resource
    • getData

      public Object getData()
      Specified by:
      getData in interface org.gvsig.fmap.dal.resource.Resource
      Overrides:
      getData in class AbstractResource
    • getName

      public String getName() throws org.gvsig.fmap.dal.resource.exception.AccessResourceException
      Description copied from class: AbstractResource
      Returns the name of the Resource.
      Specified by:
      getName in interface org.gvsig.fmap.dal.resource.Resource
      Specified by:
      getName in class AbstractResource
      Throws:
      org.gvsig.fmap.dal.resource.exception.AccessResourceException - if there is an error while accessing the resource
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setData

      public void setData(Object data)
      Specified by:
      setData in interface org.gvsig.fmap.dal.resource.Resource
      Overrides:
      setData in class AbstractResource
    • frozen

      public void frozen()
      Blocks the adding methods. It is called when all their resources components are added.
    • execute

      public Object execute(org.gvsig.fmap.dal.resource.ResourceAction action) throws org.gvsig.fmap.dal.resource.exception.ResourceExecuteException
      Locks the multiresource components to avoid another concurrent modification
      Specified by:
      execute in interface org.gvsig.fmap.dal.resource.Resource
      Overrides:
      execute in class AbstractResource
      Throws:
      org.gvsig.fmap.dal.resource.exception.ResourceExecuteException
    • addMultiResourceConsumer

      public void addMultiResourceConsumer(org.gvsig.fmap.dal.resource.spi.ResourceConsumer consumer)