com.uwyn.rife.rep
Class Rep

java.lang.Object
  extended by com.uwyn.rife.rep.Rep

public abstract class Rep
extends Object

This static abstract class provides easy application-wide access to the default Repository.

It's main purpose is to be able to quickle retrieve its Participants.

It's possible to retrieve and replace the default Repository with the setDefaultRepository and getDefaultRepository methods.

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

Constructor Summary
Rep()
           
 
Method Summary
static void cleanup()
          Cleans up the default repository if it exists.
static Repository getDefaultRepository()
          Retrieves the current default repository.
static Participant getParticipant(String name)
          Convenience method to quickly retrieve the first participant with a certain name from the default repository.
static Collection<? extends Participant> getParticipants(String name)
          Convenience method to quickly retrieve all the participants with a certain name from the default repository.
static HierarchicalProperties getProperties()
          Convenience method to quickly retrieve the properties from the default repository.
static boolean hasParticipant(String name)
          Convenience method to quickly check if a participant with a certain name is available in the default repository.
static void initialize(String repXmlPath)
          Initializes the default repository by creating an instance of BlockingRepository and initializing it with the provided XML path, a default resource finder and no context.
static void initialize(String repXmlPath, ResourceFinder resourcefinder, Object context)
          Initializes the default repository by creating an instance of BlockingRepository and initializing it with the provided properties and context.
static void setDefaultRepository(Repository repository)
          Replaces the default repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rep

public Rep()
Method Detail

initialize

public static void initialize(String repXmlPath)
Initializes the default repository by creating an instance of BlockingRepository and initializing it with the provided XML path, a default resource finder and no context.

Since:
1.0
See Also:
initialize(String, ResourceFinder, Object)

initialize

public static void initialize(String repXmlPath,
                              ResourceFinder resourcefinder,
                              Object context)
Initializes the default repository by creating an instance of BlockingRepository and initializing it with the provided properties and context.

Since:
1.0
See Also:
BlockingRepository, BlockingRepository.initialize(String, ResourceFinder)

setDefaultRepository

public static void setDefaultRepository(Repository repository)
Replaces the default repository.

Parameters:
repository - An instance of Repository that will afterwards become the application-wide default repository.
Since:
1.0
See Also:
Repository

getDefaultRepository

public static Repository getDefaultRepository()
Retrieves the current default repository.

Returns:
An instance of Repository that is currently the application-wide default repository.
Since:
1.0
See Also:
Repository

hasParticipant

public static boolean hasParticipant(String name)
Convenience method to quickly check if a participant with a certain name is available in the default repository.

Since:
1.0
See Also:
Repository.hasParticipant(String)

getParticipant

public static Participant getParticipant(String name)
Convenience method to quickly retrieve the first participant with a certain name from the default repository.

Since:
1.0
See Also:
Repository.getParticipant(String)

getParticipants

public static Collection<? extends Participant> getParticipants(String name)
Convenience method to quickly retrieve all the participants with a certain name from the default repository.

Since:
1.0
See Also:
Repository.getParticipants(String)

getProperties

public static HierarchicalProperties getProperties()
Convenience method to quickly retrieve the properties from the default repository. If no default repository has been configured, an empty instance of HierarchicalProperties is returned.

Since:
1.1
See Also:
Repository.getProperties()

cleanup

public static void cleanup()
Cleans up the default repository if it exists. This is typically done at application shutdown.

Since:
1.0


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