Java Doc for RepositoryFactory.java in  » 6.0-JDK-Modules » jsr-283 » javax » jcr » 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 » 6.0 JDK Modules » jsr 283 » javax.jcr 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.jcr.RepositoryFactory

RepositoryFactory
abstract public class RepositoryFactory (Code)
RepositoryFactory is a factory class for Repository implementations.

A concrete implementation of this class must have a zero-argument constructor. Repository factories may be installed in an instance of the Java platform as extensions, that is, jar files placed into any of the usual extension directories. Factories may also be made available by adding them to the applet or application class path or by some other platform-specific means. Repository factories are looked up via the current thread's context class loader.

A repository factory should identify itself with a factory-configuration file named javax.jcr.RepositoryFactory in the resource directory META-INF/services. The file should contain a list of fully-qualified concrete repository-factory class names, one per line. A line is terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a line feed. Space and tab characters surrounding each name, as well as blank lines, are ignored. The comment character is '#' ('\u0023'); on each line all characters following the first comment character are ignored. The file must be encoded in UTF-8.

If a particular concrete repository factory class is named in more than one configuration file, or is named in the same configuration file more than once, then the duplicates will be ignored. The configuration file naming a particular factory need not be in the same jar file or other distribution unit as the factory itself. The factory must be accessible from the same class loader that was initially queried to locate the configuration file; this is not necessarily the class loader that loaded the file.

Examples how to obtain repository instances

Use repository factory based on parameters:

 Map parameters = new HashMap();
 parameters.put("address", "vendor://localhost:9999/myrepo");
 Repository repo = RepositoryFactory.getRepository(parameters);
 
Get a default repository available in this environment:
 Repository repo = RepositoryFactory.getRepository();
 
Manually instanciate a specific repository factory and connect to the repository:
 Map parameters = new HashMap();
 parameters.put("address", "vendor://localhost:9999/myrepo");
 RepositoryFactory factory = new com.vendor.RepositoryFactory();
 Repository repo = factory.connect(parameters);
 




Method Summary
abstract public  Repositoryconnect(Map parameters)
     Attempts to establish a connection to a repository described by the given parameters.
public static  RepositorygetRepository(Map parameters)
     Attempts to establish a connection to a repository using the given parameters.
public static  RepositorygetRepository()
     Returns the first default Repository returned by a RepositoryFactory.



Method Detail
connect
abstract public Repository connect(Map parameters) throws RepositoryException(Code)
Attempts to establish a connection to a repository described by the given parameters. The implementation should return null if it does not understand the given parameters. The implementation may also return null if a default repository instance is requested (indicated by null parameters) and this factory is not able to identify a default repository.

An implementation should throw an RepositoryException if it is the right factory but has trouble connecting to the repository.

An implementation of this method must be thread-safe.
Parameters:
  parameters - map of arbitrary string key/value pairs as repositoryarguments or null if none are provided anda client whishes to connect to a default repository. a repository instance or null if this implementationdoes not understand the passed properties.
throws:
  RepositoryException - if an error occurs while connecting to therepository.
See Also:   RepositoryFactory.getRepository(java.util.Map)




getRepository
public static Repository getRepository(Map parameters) throws RepositoryException(Code)
Attempts to establish a connection to a repository using the given parameters. The keys and values of the parameters are implementation specific.
Parameters:
  parameters - map of arbitrary string key/value pairs as repositoryarguments or null if none are provided anda client whishes to connect to a default repository. a repository instance.
throws:
  RepositoryException - if getRepository fails or if no suitablerepository is found.



getRepository
public static Repository getRepository() throws RepositoryException(Code)
Returns the first default Repository returned by a RepositoryFactory. a default repository instance.
throws:
  RepositoryException - if no factory returned a default repositoryor if an error occurs.



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.