Java Doc for CompassConfiguration.java in  » Search-Engine » compass-2.0 » org » compass » core » config » 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 » Search Engine » compass 2.0 » org.compass.core.config 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.compass.core.config.CompassConfiguration

All known Subclasses:   org.compass.annotations.config.CompassAnnotationsConfiguration,
CompassConfiguration
public class CompassConfiguration (Code)
Used to configure Compass instances.

An instance of it allows the application to specify settings and mapping files to be used when creating Compass.

There are several options to configure a Compass instance, programmatically using the CompassConfiguration class, using the xml configuration file (compass.cfg.xml), or a combination of both.

Usually the application will create a single CompassConfiguration, use it to configure and than build a Compass instance, and than instantiate CompassSessions in threads servicing client requests.

The CompassConfiguration is meant only as an initialization-time object. Compass is immutable and do not affect the CompassConfiguration that created it.


author:
   kimchy
See Also:   org.compass.core.Compass


Field Summary
protected  ConfigurationBuilderconfigurationBuilder
    
final protected static  Loglog
    
protected  CompassMappingBindingmappingBinding
    

Constructor Summary
public  CompassConfiguration()
    

Method Summary
public  CompassConfigurationaddClass(Class searchableClass)
     Read a mapping from an application resource, using a convention.
public  CompassConfigurationaddDirectory(File dir)
     Read all mapping and meta-data documents from a directory tree.
public  CompassConfigurationaddFile(String filePath)
     Read mappings from a particular file.
public  CompassConfigurationaddFile(File file)
     Read mappings from a particular file.
public  CompassConfigurationaddInputStream(InputStream inputStream, String resourceName)
     Read mappings from an InputStream.
public  CompassConfigurationaddJar(File jar)
     Read all mappings and meta-data from a jar file.
protected  voidaddMappingBindings(CompassMappingBinding mappingBinding)
    
public  CompassConfigurationaddMappingResover(InputStreamMappingResolver mappingResolver)
     Uses a class that implements the InputStreamMappingResolver for auto generation of mapping definitions.
public  CompassConfigurationaddPackage(String packageName)
     Read annotated package definitions.
public  CompassConfigurationaddResource(String path, ClassLoader classLoader)
    
public  CompassConfigurationaddResource(String path)
     Read mappings from an application resource trying different classloaders.
public  CompassConfigurationaddResourceMapping(ResourceMapping resourceMapping)
     Advance: Add mappings based on org.compass.core.mapping.ResourceMapping implementation which allows for adding pre built mapping constructs.
public  CompassConfigurationaddURL(URL url)
     Read mappings from a URL.
public  CompassbuildCompass()
     Build compass with the configurations set.
public  CompassConfigurationconfigure()
     Use the mappings and properties specified in an application resource with the path /compass.cfg.xml.
public  CompassConfigurationconfigure(String resource)
     Use the mappings and properties specified in the given application resource.
public  CompassConfigurationconfigure(URL url)
     Use the mappings and properties specified in the given document.
public  CompassConfigurationconfigure(File configFile)
     Use the mappings and properties specified in the given application file.
public  ClassLoadergetClassLoader()
     Returns the class loader that will be used to load classes and resources.
public  CompassSettingsgetSettings()
     Returns the current set of settings associated with the configuration.
public  CompassConfigurationregisterConverter(String converterName, Converter converter)
     Registers a Converter under the given name.
protected  voidregisterExtraConverters(ConverterLookup converterLookup)
    
public  CompassConfigurationsetClassLoader(ClassLoader classLoader)
     Sets the class loader that will be used to load classes and resources.
public  CompassConfigurationsetConnection(String connection)
     Sets the connection for the compass instance.
public  CompassConfigurationsetSetting(String setting, String value)
     Sets a specific setting in the compass configuration settings.
public  booleantryAddClass(Class searchableClass)
     Tries to add a class and returns a boolean indicator if it was added or not.

Field Detail
configurationBuilder
protected ConfigurationBuilder configurationBuilder(Code)



log
final protected static Log log(Code)



mappingBinding
protected CompassMappingBinding mappingBinding(Code)




Constructor Detail
CompassConfiguration
public CompassConfiguration()(Code)




Method Detail
addClass
public CompassConfiguration addClass(Class searchableClass) throws ConfigurationException(Code)
Read a mapping from an application resource, using a convention. The class foo.bar.Foo is mapped by the file foo/bar/Foo.cpm.xml (in the case of Xml binding).
Parameters:
  searchableClass - the mapped class



addDirectory
public CompassConfiguration addDirectory(File dir) throws ConfigurationException(Code)
Read all mapping and meta-data documents from a directory tree. Assume that any file named *.cpm.xml or *.cmd.xml is a mapping document.
Parameters:
  dir - a directory



addFile
public CompassConfiguration addFile(String filePath) throws ConfigurationException(Code)
Read mappings from a particular file.
Parameters:
  filePath - a path to a file



addFile
public CompassConfiguration addFile(File file) throws ConfigurationException(Code)
Read mappings from a particular file.
Parameters:
  file - a path to a file



addInputStream
public CompassConfiguration addInputStream(InputStream inputStream, String resourceName) throws ConfigurationException(Code)
Read mappings from an InputStream.
Parameters:
  inputStream - an InputStream containing



addJar
public CompassConfiguration addJar(File jar) throws ConfigurationException(Code)
Read all mappings and meta-data from a jar file. Assume that any file named *.cpm.xml or *.cmd.xml is a mapping document.
Parameters:
  jar - a jar file



addMappingBindings
protected void addMappingBindings(CompassMappingBinding mappingBinding)(Code)



addMappingResover
public CompassConfiguration addMappingResover(InputStreamMappingResolver mappingResolver) throws ConfigurationException(Code)
Uses a class that implements the InputStreamMappingResolver for auto generation of mapping definitions.
Parameters:
  mappingResolver - The mapping resolver



addPackage
public CompassConfiguration addPackage(String packageName) throws ConfigurationException(Code)
Read annotated package definitions.
Parameters:
  packageName - The package name to load



addResource
public CompassConfiguration addResource(String path, ClassLoader classLoader) throws ConfigurationException(Code)
Read mappings from an application resource
Parameters:
  path - a resource
Parameters:
  classLoader - a ClassLoader to use



addResource
public CompassConfiguration addResource(String path) throws ConfigurationException(Code)
Read mappings from an application resource trying different classloaders. This method will try to load the resource first from the thread context classloader and then from the classloader that loaded Compass.
Parameters:
  path - The path of the resource



addResourceMapping
public CompassConfiguration addResourceMapping(ResourceMapping resourceMapping)(Code)
Advance: Add mappings based on org.compass.core.mapping.ResourceMapping implementation which allows for adding pre built mapping constructs.



addURL
public CompassConfiguration addURL(URL url) throws ConfigurationException(Code)
Read mappings from a URL.
Parameters:
  url - the URL



buildCompass
public Compass buildCompass() throws CompassException(Code)
Build compass with the configurations set. Creates a copy of all the current settings and mappings, configures a Compass instance and starts it.

Note that the CompassConfiguration class can be used to create more Compass objects after the method has been called.

the Compass



configure
public CompassConfiguration configure() throws ConfigurationException(Code)
Use the mappings and properties specified in an application resource with the path /compass.cfg.xml. CompassConfiguration for method chaining



configure
public CompassConfiguration configure(String resource) throws ConfigurationException(Code)
Use the mappings and properties specified in the given application resource.
Parameters:
  resource - The compass configuration resource path CompassConfiguration for method chaining



configure
public CompassConfiguration configure(URL url) throws ConfigurationException(Code)
Use the mappings and properties specified in the given document.
Parameters:
  url - URL from which you wish to load the configuration A configuration configured via the file
throws:
  ConfigurationException -



configure
public CompassConfiguration configure(File configFile) throws ConfigurationException(Code)
Use the mappings and properties specified in the given application file.
Parameters:
  configFile - File from which you wish to load theconfiguration A configuration configured via the file
throws:
  ConfigurationException -



getClassLoader
public ClassLoader getClassLoader()(Code)
Returns the class loader that will be used to load classes and resources. If directly set, will return it. If not, will return the therad local context class loader.



getSettings
public CompassSettings getSettings()(Code)
Returns the current set of settings associated with the configuration. The settings used by the configuration



registerConverter
public CompassConfiguration registerConverter(String converterName, Converter converter)(Code)
Registers a Converter under the given name. The name can then be used in the mapping definitions as a logical name to the converter.
Parameters:
  converterName - the converter name the converter will be registered under
Parameters:
  converter - The converter to use The configuration



registerExtraConverters
protected void registerExtraConverters(ConverterLookup converterLookup)(Code)



setClassLoader
public CompassConfiguration setClassLoader(ClassLoader classLoader)(Code)
Sets the class loader that will be used to load classes and resources.



setConnection
public CompassConfiguration setConnection(String connection)(Code)
Sets the connection for the compass instance.
Parameters:
  connection - The connection for compass to use CompassConfiguration for method chaining



setSetting
public CompassConfiguration setSetting(String setting, String value)(Code)
Sets a specific setting in the compass configuration settings.
Parameters:
  setting - The setting name
Parameters:
  value - The setting value CompassConfiguration for method chaining



tryAddClass
public boolean tryAddClass(Class searchableClass) throws ConfigurationException(Code)
Tries to add a class and returns a boolean indicator if it was added or not.
Parameters:
  searchableClass - The searchable class to add true if the class was added, false otherwise
throws:
  ConfigurationException -



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.