PersistentComponent

public abstract class PersistentComponent extends Component

PersistentComponent represents a component that is persistent. Subclasses should override the loading(URL) and storing(URL) methods to provide their specific implementations.

Author:Hugo Y. K. Lam

Constructors

PersistentComponent

public PersistentComponent()

Creates a new instance of PersistentComponent.

PersistentComponent

public PersistentComponent(URL url)

Creates a new instance of PersistentComponent.

Parameters:
  • url – the url representing this component.
Throws:
  • Exception – when there is any error in loading the source.

Methods

getURL

public URL getURL()

Gets the url representing this component.

Returns:the url representing this component.

init

protected void init()

Initializes this component from the URL specified in the parameter ‘config’. The load() method will then be invoked to handle the loading of this component.

See also: .load(URL), Component.init(), Component.getParameters()

load

public void load(URL url)

Loads this component from the specified url.

Parameters:
  • url – the url representing this component.
Throws:
  • Exception – when there is any error in loading.

See also: .loading(URL)

load

public void load()

Loads this component from the URL representing it.

Throws:

See also: .load(URL)

loading

protected void loading(URL url)

Invoked by the load() method and should be overridden by subclasses to provide implementation.

See also: .load(URL)

store

public void store(URL url)

Stores this component to the specified url.

Parameters:
  • url – the url representing this component.
Throws:
  • Exception – when there is any error in storing.

See also: .storing(URL)

store

public void store()

Stores this component to the URL representing it.

Throws:

See also: .store(URL)

storing

protected void storing(URL url)

Invoked by the store() method and should be overridden by subclasses to provide implementation.

See also: .store(URL)