Java Doc for BlockingRepository.java in  » Web-Framework » rife-1.6.1 » com » uwyn » rife » rep » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » rife 1.6.1 » com.uwyn.rife.rep 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.ThreadGroup
      com.uwyn.rife.rep.BlockingRepository

BlockingRepository
public class BlockingRepository extends ThreadGroup implements Repository(Code)
The BlockingRepository class provides a Repository implementation that loads the participants from an XML file.

This file defaults to rep/participants.xml, but it can be overridden by providing another filename to the BlockingRepository.initialize(String,ResourceFinder) initialize method. The participants are initialized according to their listed order.

Following is an example of such an XML file :

<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE rep SYSTEM "/dtd/rep.dtd">
 <rep>
 <participant blocking="true" parameter="rep/config.xml">ParticipantConfig</participant>
 <participant blocking="false" parameter="graphics/buttons/">ParticipantImages</participant>
 <participant name="my cursors" blocking="false" parameter="graphics/cursors/">ParticipantCursors</participant>
 </rep>

Each participant has a blocking attribute that determines whether the repository should wait for the end of the participant's initialization before progressing to the next participant or not. Using this intelligently, it's possible to dramatically increase the perceived startup time of an application.

Optionally a participant can have a name attribute which makes it possible to declare multiple participants of the same class. If no name is provided, the participant's class name will be used to identify the declared participant.

Optionally a participant can also have a parameter attribute which is merely a String that is provided to the participant object for configuration purposes.

Listeners can be added to the repository to receive notifications about the initialization advancement of the participants and to know when the initialization has completely finished. These notifications can, for example, be used to display a progress bar in a splash window and to switch to the real application window when the initialization has finished.

The JDK's logging facility is used to output informative text during the advancement of the initialization. Each participant has to provide an initialization message that will be output.
author:
   Geert Bevin (gbevin[remove] at uwyn dot com)
version:
   $Revision: 3634 $
See Also:   RepositoryListener
See Also:   BlockingParticipant
since:
   1.0




Constructor Summary
public  BlockingRepository()
     Default constructor without a repository context.
public  BlockingRepository(Object context)
     Constructor which sets up a the context in which the repository is initialized.

Method Summary
public  booleanaddParticipant(String className)
     Adds a BlockingParticipant to the repository, using the class name for the name of the participant.

The participant will not be blocking and have no parameter.
Parameters:
  className - The fully resolved name of the participant's class, oronly the class name if the participant resides in thecom.uwyn.rife.rep.participants package.

public  booleanaddParticipant(String className, boolean blocking)
     Adds a BlockingParticipant to the repository, using the class name for the name of the participant.

The participant will have no parameter.
Parameters:
  className - The fully resolved name of the participant's class, oronly the class name if the participant resides in thecom.uwyn.rife.rep.participants package.
Parameters:
  blocking - Indicates if this a blocking participant or not.

public  booleanaddParticipant(String className, String parameter)
     Adds a BlockingParticipant to the repository, using the class name for the name of the participant.

The participant will not be blocking.
Parameters:
  className - The fully resolved name of the participant's class, oronly the class name if the participant resides in thecom.uwyn.rife.rep.participants package.
Parameters:
  parameter - An optional string that contains the parameter forthis participant.

public  booleanaddParticipant(String className, boolean blocking, String parameter)
     Adds a BlockingParticipant to the repository, using the class name for the name of the participant.
Parameters:
  className - The fully resolved name of the participant's class, oronly the class name if the participant resides in thecom.uwyn.rife.rep.participants package.
Parameters:
  blocking - Indicates if this a blocking participant or not.
Parameters:
  parameter - An optional string that contains the parameter forthis participant.
public  booleanaddParticipant(String className, String name, boolean blocking, String parameter)
     Adds a BlockingParticipant to the repository.
Parameters:
  className - The fully resolved name of the participant's class, oronly the class name if the participant resides in thecom.uwyn.rife.rep.participants package.
Parameters:
  name - The name under which the participant will be registered, ifthe name is null the class name will be used
Parameters:
  blocking - Indicates if this a blocking participant or not.
Parameters:
  parameter - An optional string that contains the parameter forthis participant.
public  booleanaddParticipant(Class klass, boolean blocking, String parameter)
     Adds a BlockingParticipant to the repository, using the class name as the name of the participant.
Parameters:
  klass - The class of the participant.
Parameters:
  blocking - Indicates if this a blocking participant or not.
Parameters:
  parameter - An optional string that contains the parameter forthis participant.
public  booleanaddParticipant(Class klass)
     Adds a BlockingParticipant to the repository, using the class name as the name of the participant.

The participant will not be blocking and have no parameter.
Parameters:
  klass - The class of the participant.this participant.

public  booleanaddParticipant(Class klass, boolean blocking)
     Adds a BlockingParticipant to the repository, using the class name as the name of the participant.

The participant will have no parameter.
Parameters:
  klass - The class of the participant.
Parameters:
  blocking - Indicates if this a blocking participant or not.

public  booleanaddParticipant(Class klass, String parameter)
     Adds a BlockingParticipant to the repository, using the class name as the name of the participant.

The participant will not be blocking.
Parameters:
  klass - The class of the participant.
Parameters:
  parameter - An optional string that contains the parameter forthis participant.

public  booleanaddParticipant(Class klass, String name, boolean blocking, String parameter)
     Adds a BlockingParticipant to the repository.
Parameters:
  klass - The class of the participant.
Parameters:
  name - The name under which the participant will be registered, ifthe name is null the class name will be used
Parameters:
  blocking - Indicates if this a blocking participant or not.
Parameters:
  parameter - An optional string that contains the parameter forthis participant.
public  voidaddRepListener(RepositoryListener repListener)
     Adds the specified repository listener to receive repository initialization events.
public  voidcleanup()
     Cleans up the participants in the order in which they have been declared.
public  voidfireInitActionPerformed(BlockingParticipant participant)
     Notifies the registered listeners that a new initialization action has been performed.

This is always triggered when a participant's initialization has finished.

public  voidfireInitFinished()
     Notifies the registered listeners that the repository initialization has finished.
public  ObjectgetContext()
    
public  BlockingParticipantgetParticipant(String name)
     Looks for the participant that corresponds to a given name and returns it when found.
Parameters:
  name - The name of the participant instance that you wish toretrieve from the repository.

If no name was provided during the XML specification, theparticipant will have been registered with its class name.

public  Collection<BlockingParticipant>getParticipants(String className)
     Returns all the participants with a given class name
Parameters:
  className - The class name of the participants that you wish toretrieve from the repository.

If the participant's class is not part of thecom.uwyn.rife.rep.participants package, its full classname has to be provided, otherwise just the name of the class itself issufficient.

public  HierarchicalPropertiesgetProperties()
    
public  booleanhasParticipant(String name)
     Verifies if a participant that corresponds to a given name is present.
Parameters:
  name - The name of the participant object that you wish toretrieve from the repository.
public  voidinitialize(String repXmlPath, ResourceFinder resourcefinder)
     Parses the XML file to determine what the participants are.
public  booleanisFinished()
     Obtains the finished status of the initialization.
public  voidremoveRepListener(RepositoryListener repListener)
     Removes the repository listener so that it no longer receives repository initialization events.
public  voidrunParticipants()
     Sequentially execute the participants according to their registration order.
public  voidrunParticipants(ResourceFinder resourceFinder)
     Sequentially execute the participants according to their registration order.
public  voiduncaughtException(Thread thread, Throwable e)
     If participants call an exception, clean up correctly and rethrow the exception afterwards.


Constructor Detail
BlockingRepository
public BlockingRepository()(Code)
Default constructor without a repository context.



BlockingRepository
public BlockingRepository(Object context)(Code)
Constructor which sets up a the context in which the repository is initialized.




Method Detail
addParticipant
public boolean addParticipant(String className) throws RepException(Code)
Adds a BlockingParticipant to the repository, using the class name for the name of the participant.

The participant will not be blocking and have no parameter.
Parameters:
  className - The fully resolved name of the participant's class, oronly the class name if the participant resides in thecom.uwyn.rife.rep.participants package. true if the participants was added successfully;or

false if errors occurred
See Also:   BlockingParticipant
See Also:   Participant
See Also:   BlockingRepository.addParticipant(Class,String,boolean,String)
since:
   1.5




addParticipant
public boolean addParticipant(String className, boolean blocking) throws RepException(Code)
Adds a BlockingParticipant to the repository, using the class name for the name of the participant.

The participant will have no parameter.
Parameters:
  className - The fully resolved name of the participant's class, oronly the class name if the participant resides in thecom.uwyn.rife.rep.participants package.
Parameters:
  blocking - Indicates if this a blocking participant or not. true if the participants was added successfully;or

false if errors occurred
See Also:   BlockingParticipant
See Also:   Participant
See Also:   BlockingRepository.addParticipant(Class,String,boolean,String)
since:
   1.5




addParticipant
public boolean addParticipant(String className, String parameter) throws RepException(Code)
Adds a BlockingParticipant to the repository, using the class name for the name of the participant.

The participant will not be blocking.
Parameters:
  className - The fully resolved name of the participant's class, oronly the class name if the participant resides in thecom.uwyn.rife.rep.participants package.
Parameters:
  parameter - An optional string that contains the parameter forthis participant. true if the participants was added successfully;or

false if errors occurred
See Also:   BlockingParticipant
See Also:   Participant
See Also:   BlockingRepository.addParticipant(Class,String,boolean,String)
since:
   1.5




addParticipant
public boolean addParticipant(String className, boolean blocking, String parameter) throws RepException(Code)
Adds a BlockingParticipant to the repository, using the class name for the name of the participant.
Parameters:
  className - The fully resolved name of the participant's class, oronly the class name if the participant resides in thecom.uwyn.rife.rep.participants package.
Parameters:
  blocking - Indicates if this a blocking participant or not.
Parameters:
  parameter - An optional string that contains the parameter forthis participant. true if the participants was added successfully;or

false if errors occurred
See Also:   BlockingParticipant
See Also:   Participant
See Also:   BlockingRepository.addParticipant(Class,String,boolean,String)
since:
   1.5




addParticipant
public boolean addParticipant(String className, String name, boolean blocking, String parameter) throws RepException(Code)
Adds a BlockingParticipant to the repository.
Parameters:
  className - The fully resolved name of the participant's class, oronly the class name if the participant resides in thecom.uwyn.rife.rep.participants package.
Parameters:
  name - The name under which the participant will be registered, ifthe name is null the class name will be used
Parameters:
  blocking - Indicates if this a blocking participant or not.
Parameters:
  parameter - An optional string that contains the parameter forthis participant. true if the participants was added successfully;or

false if errors occurred
See Also:   BlockingParticipant
See Also:   Participant
See Also:   BlockingRepository.addParticipant(Class,String,boolean,String)
since:
   1.0




addParticipant
public boolean addParticipant(Class klass, boolean blocking, String parameter) throws RepException(Code)
Adds a BlockingParticipant to the repository, using the class name as the name of the participant.
Parameters:
  klass - The class of the participant.
Parameters:
  blocking - Indicates if this a blocking participant or not.
Parameters:
  parameter - An optional string that contains the parameter forthis participant. true if the participants was added successfully;or

false if errors occurred
See Also:   BlockingParticipant
See Also:   Participant
See Also:   BlockingRepository.addParticipant(Class,String,boolean,String)
since:
   1.5




addParticipant
public boolean addParticipant(Class klass) throws RepException(Code)
Adds a BlockingParticipant to the repository, using the class name as the name of the participant.

The participant will not be blocking and have no parameter.
Parameters:
  klass - The class of the participant.this participant. true if the participants was added successfully;or

false if errors occurred
See Also:   BlockingParticipant
See Also:   Participant
See Also:   BlockingRepository.addParticipant(Class,String,boolean,String)
since:
   1.5




addParticipant
public boolean addParticipant(Class klass, boolean blocking) throws RepException(Code)
Adds a BlockingParticipant to the repository, using the class name as the name of the participant.

The participant will have no parameter.
Parameters:
  klass - The class of the participant.
Parameters:
  blocking - Indicates if this a blocking participant or not. true if the participants was added successfully;or

false if errors occurred
See Also:   BlockingParticipant
See Also:   Participant
See Also:   BlockingRepository.addParticipant(Class,String,boolean,String)
since:
   1.5




addParticipant
public boolean addParticipant(Class klass, String parameter) throws RepException(Code)
Adds a BlockingParticipant to the repository, using the class name as the name of the participant.

The participant will not be blocking.
Parameters:
  klass - The class of the participant.
Parameters:
  parameter - An optional string that contains the parameter forthis participant. true if the participants was added successfully;or

false if errors occurred
See Also:   BlockingParticipant
See Also:   Participant
See Also:   BlockingRepository.addParticipant(Class,String,boolean,String)
since:
   1.5




addParticipant
public boolean addParticipant(Class klass, String name, boolean blocking, String parameter) throws RepException(Code)
Adds a BlockingParticipant to the repository.
Parameters:
  klass - The class of the participant.
Parameters:
  name - The name under which the participant will be registered, ifthe name is null the class name will be used
Parameters:
  blocking - Indicates if this a blocking participant or not.
Parameters:
  parameter - An optional string that contains the parameter forthis participant. true if the participants was added successfully;or

false if errors occurred
See Also:   BlockingParticipant
See Also:   Participant
since:
   1.0




addRepListener
public void addRepListener(RepositoryListener repListener)(Code)
Adds the specified repository listener to receive repository initialization events. If repListener is null, no exception is thrown and no action is performed.
Parameters:
  repListener - The repository listener that will be added.
See Also:   RepositoryListener
See Also:   BlockingRepository.removeRepListener(RepositoryListener)
since:
   1.0



cleanup
public void cleanup() throws RepException(Code)
Cleans up the participants in the order in which they have been declared. Every participant's cleanup() method is successively called.
exception:
  RepException - when an error occurs during the cleanup.
since:
   1.0



fireInitActionPerformed
public void fireInitActionPerformed(BlockingParticipant participant)(Code)
Notifies the registered listeners that a new initialization action has been performed.

This is always triggered when a participant's initialization has finished. Each participant however has the possibility to call this method directly, allowed for finer-grained notification of the advancement of the initialization.
Parameters:
  participant - The participant that triggered the action.
See Also:   RepositoryListener
since:
   1.0




fireInitFinished
public void fireInitFinished()(Code)
Notifies the registered listeners that the repository initialization has finished.
See Also:   RepositoryListener
since:
   1.0



getContext
public Object getContext()(Code)



getParticipant
public BlockingParticipant getParticipant(String name)(Code)
Looks for the participant that corresponds to a given name and returns it when found.
Parameters:
  name - The name of the participant instance that you wish toretrieve from the repository.

If no name was provided during the XML specification, theparticipant will have been registered with its class name. If theparticipant's class is not part of thecom.uwyn.rife.rep.participants package, its full classname has to be provided, otherwise just the name of the class itself issufficient.

Also, even though a participant has been registered with a name,it'll still be known under its class name. When a class name isprovided as the argument, the first known participant of that classwill be returned. This can be seen as the default participant for thespecified type. A BlockingParticipant instance if the providedname could be found amongst the registered participants in therepository; or

null if the participant couldn't be found
See Also:   BlockingParticipant
See Also:   BlockingRepository.hasParticipant(String)
since:
   1.0




getParticipants
public Collection<BlockingParticipant> getParticipants(String className)(Code)
Returns all the participants with a given class name
Parameters:
  className - The class name of the participants that you wish toretrieve from the repository.

If the participant's class is not part of thecom.uwyn.rife.rep.participants package, its full classname has to be provided, otherwise just the name of the class itself issufficient. A Collection of BlockingParticipantinstances of the provided class name; or

null if no participants with the provided class namecould be found
See Also:   BlockingParticipant
See Also:   BlockingRepository.getParticipant(String)
since:
   1.0




getProperties
public HierarchicalProperties getProperties()(Code)



hasParticipant
public boolean hasParticipant(String name)(Code)
Verifies if a participant that corresponds to a given name is present.
Parameters:
  name - The name of the participant object that you wish toretrieve from the repository. See the BlockingRepository.getParticipant(String)getParticipant method for detailed information about how theparticipant's name is resolved. true if the provided class name could be found, or

false otherwise
See Also:   BlockingParticipant
See Also:   BlockingRepository.getParticipant(String)
since:
   1.0




initialize
public void initialize(String repXmlPath, ResourceFinder resourcefinder) throws RepException(Code)
Parses the XML file to determine what the participants are. Then, one by one, initializes each participant with the BlockingRepository.runParticipants(ResourceFinder) runParticipants method, waiting for it to finish if its blocking attribute was set to true.
Parameters:
  repXmlPath - The path of the XML file.

If this is null, rep/participants.xml willbe used.
Parameters:
  resourcefinder - The resource finder that will be used to look upresources such as XML files and DTDs. It will also be used by otherclasses after initialization through thegetResourceFinder() method.

If this is null, an instance of ResourceFinderClasspath will be used.
exception:
  RepException - when an error occurs during the initialization.
since:
   1.0




isFinished
public boolean isFinished()(Code)
Obtains the finished status of the initialization. false if the initialization is still busy; or

true if the initialization is finished
since:
   1.0




removeRepListener
public void removeRepListener(RepositoryListener repListener)(Code)
Removes the repository listener so that it no longer receives repository initialization events. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this component. If repListener is null, no exception is thrown and no action is performed.
Parameters:
  repListener - The repository listener that will be removed.
See Also:   RepositoryListener
See Also:   BlockingRepository.addRepListener(RepositoryListener)
since:
   1.0



runParticipants
public void runParticipants()(Code)
Sequentially execute the participants according to their registration order. If the participant has already been run or is still running, it is not executed anymore. The repository waits for the participant's execution to finish if this has been indicated by registering with the blocking attribute.

The resource finder that will be used is an instance of ResourceFinderClasspath .
See Also:   ResourceFinderClasspath
See Also:   BlockingRepository.runParticipants(ResourceFinder)
since:
   1.5




runParticipants
public void runParticipants(ResourceFinder resourceFinder)(Code)
Sequentially execute the participants according to their registration order. If the participant has already been run or is still running, it is not executed anymore. The repository waits for the participant's execution to finish if this has been indicated by registering with the blocking attribute.
Parameters:
  resourceFinder - The resource finder that is used during theinitialization.
since:
   1.0



uncaughtException
public void uncaughtException(Thread thread, Throwable e)(Code)
If participants call an exception, clean up correctly and rethrow the exception afterwards.
since:
   1.0



Methods inherited from java.lang.ThreadGroup
public int activeCount()(Code)(Java Doc)
public int activeGroupCount()(Code)(Java Doc)
public boolean allowThreadSuspension(boolean b)(Code)(Java Doc)
final public void checkAccess()(Code)(Java Doc)
final public void destroy()(Code)(Java Doc)
public int enumerate(Thread list)(Code)(Java Doc)
public int enumerate(Thread list, boolean recurse)(Code)(Java Doc)
public int enumerate(ThreadGroup list)(Code)(Java Doc)
public int enumerate(ThreadGroup list, boolean recurse)(Code)(Java Doc)
final public int getMaxPriority()(Code)(Java Doc)
final public String getName()(Code)(Java Doc)
final public ThreadGroup getParent()(Code)(Java Doc)
final public void interrupt()(Code)(Java Doc)
final public boolean isDaemon()(Code)(Java Doc)
public synchronized boolean isDestroyed()(Code)(Java Doc)
public void list()(Code)(Java Doc)
final public boolean parentOf(ThreadGroup g)(Code)(Java Doc)
final public void resume()(Code)(Java Doc)
final public void setDaemon(boolean daemon)(Code)(Java Doc)
final public void setMaxPriority(int pri)(Code)(Java Doc)
final public void stop()(Code)(Java Doc)
final public void suspend()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public void uncaughtException(Thread t, Throwable e)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.