com.uwyn.rife.rep
Interface Repository

All Known Implementing Classes:
BlockingRepository

public interface Repository

The Repository provides a collection of application-wide data structures and services that typically setup the whole application structure in a modular fashion.

These modules are called Participants and they are registered through a name so make it possible to retrieve them. The name is not necessarily a unique identifier, but can also identify a specific Participant type.

Since:
1.0
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)
See Also:
Participant

Method Summary
 void cleanup()
          Cleans up the repository, typically done at application shutdown.
 Object getContext()
          Retrieves the context in which the repository was initialized.
 Participant getParticipant(String name)
          Looks for the participant that corresponds to a given name and returns it when found.
 Collection<? extends Participant> getParticipants(String name)
          Returns all the participants that correspond to a given name.
 HierarchicalProperties getProperties()
          Retrieves the repository's properties.
 boolean hasParticipant(String name)
          Verifies if a participant with a certain name is present in the repository.
 boolean isFinished()
          Obtains the finished status of the initialization.
 

Method Detail

hasParticipant

boolean hasParticipant(String name)
Verifies if a participant with a certain name is present in the repository.

Parameters:
name - The name of the participant that you wish to look up in the repository.
Returns:
true if the participant could be found, or

false otherwise

Since:
1.0

getParticipant

Participant getParticipant(String name)
Looks for the participant that corresponds to a given name and returns it when found.

Returns:
A Participant instance if the provided name could be found; or

null if the participant couldn't be found

Since:
1.0
See Also:
Participant

getParticipants

Collection<? extends Participant> getParticipants(String name)
Returns all the participants that correspond to a given name.

Parameters:
name - The name of the participants that you wish to retrieve from the repository.
Returns:
A Collection of Participants that correspond to the name; or

null if no participants with the provided name could be found

Since:
1.0
See Also:
Participant

getProperties

HierarchicalProperties getProperties()
Retrieves the repository's properties. This is meant to be similar System.getProperties, but then not for the whole system, but just for this application.

Also, instead of just have a map of String keys and values, the property values are of the PropertyValue type and are looked up at run-time in a hierachical manner. This provides them with IoC capabilities.

Since Java allows the configuration of an application through the use of properties, many other sub-system have adopted a similar approach (for example servlet init parameters). Most of the time an application runs through several barriers of configuration that often function independently. These properties make it possible for each sub-system to add their properties to the same pool. This makes it much more convenient to retrieve a property value.

Returns:
the repository's properties
Since:
1.0

getContext

Object getContext()
Retrieves the context in which the repository was initialized.

Returns:
a reference to the context in which the repository was initialized; or

null if the context isn't accessible

Since:
1.0

isFinished

boolean isFinished()
Obtains the finished status of the initialization.

Returns:
false if the initialization is still busy; or

true if the initialization is finished

Since:
1.0

cleanup

void cleanup()
Cleans up the repository, typically done at application shutdown.

Since:
1.0


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.