Java Doc for IndexManager.java in  » Search-Engine » Jofti » com » jofti » api » 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 » Jofti » com.jofti.api 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.jofti.api.IndexManager

All known Subclasses:   com.jofti.manager.IndexManagerImpl,
IndexManager
public interface IndexManager (Code)
The manager is responsible for providing access to indexes. This class is not a singleton and is not intended to be used in that manner.

The usage for the IndexCache manager is either to retrieve an indexed cache that has been configured via a configuration file: e.g.

IndexManager manager = new IndexManagerImpl();
manager.setConfigFile("configFile");
manager.init();
Index index = manager.getIndexCache("name");

or:

IndexManager manager = new IndexManagerImpl();
manager.init(inputStream);
IndexCache index = (IndexCache)manager.getIndexCache("name");

or by using one the addIndex methods:

IndexManager manager = new IndexManagerImpl();
manager.init();
IndexCache index = (IndexCache)manager.addIndexCache(indexConfig, "fileName");

or IndexManager manager = new IndexManagerImpl();
manager.init();
Index index = manager.addIndex(indexConfig, cacheImpl);

The recommended usage for pre-existing Caches is to use the addIndex method and use a Listener adapter so all Index updates are managed using the listener callback methods.

NameSpaced caches such as JBossCache are obtained using:

IndexManager manager = new IndexManagerImpl();
manager.init(configFile);
NameSpacedIndex index = manager.getNameSpacedIndex("name");

author:
   Steve Woodcock

version:
   1.10





Method Summary
abstract public  IndexaddIndex(IndexConfig config, Object cache, String classesFileName)
     This method allows cache instances to be added to the manager programatically rather than at start-up.
public  IndexaddIndex(IndexConfig config, Object cache, InputStream stream)
     This method allows cache instances to be added to the manager programatically rather than at start-up.

Any type of cache can be added in this manner, providing a CacheAdapter exists for it and the correct adapter has been configured in the IndexConfig class.

Note: The cache implementations must be started correctly before they arepassed into this method.

abstract public  IndexaddIndex(IndexConfig config, Object cache)
     This method allows cache instances to be added to the manager programatically rather than at start-up.
abstract public  IndexaddIndexCache(IndexConfig config, String classesFileName)
     This method allows cache instances to be added to the manager programatically rather than at start-up.
abstract public  IndexaddIndexCache(IndexConfig config)
     This method allows cache instances to be added to the manager programatically rather than at start-up.

Any type of cache can be added in this manner, providing a CacheAdapter exists for it and the correct adapter has been configured in the IndexConfig class.

abstract public  voiddestroy()
     Used to shutdown and remove all indexed caches from the manager.
abstract public  voiddestroyIndex(Object cache)
     Used to shutdown and remove an indexed cache from the manager.
abstract public  IndexgetIndexCache(String indexName)
     Retrieves an indexed cache from the manager.
abstract public  NameSpacedIndexgetNameSpacedIndex(String indexName)
     Retrieves a name spaced indexed cache from the manager.
abstract public  voidinit(String configFileName)
     Initialisation method that takes a config file name.
abstract public  voidinit()
     Initialisation method that takes no parameters.
abstract public  voidinit(InputStream configStream)
     Initialise method that takes an inputstream.
abstract public  ObjectremoveIndex(Object cache)
     Used to only remove an indexed cache from the manager and return the cache instance.
abstract public  voidsetConfigFile(String configFile)
     Sets a config file to use in the Manager.



Method Detail
addIndex
abstract public Index addIndex(IndexConfig config, Object cache, String classesFileName) throws JoftiException(Code)
This method allows cache instances to be added to the manager programatically rather than at start-up. The usage is for example:

DefaultIndexConfig config = new DefaultIndexConfig();
config.setName("test");
Index index = manager.addIndex(config, cacheImpl, xml-filename-with-classes-in-it);

any type of cache can be added in this manner, providing a CacheAdapter exists for it and the correct adapter has been configured in the IndexConfig class.

If you are using a nameSpaced cache like JBossCache then the usage wouldbe:

DefaultIndexConfig config = new DefaultIndexConfig();
config.setName("test");
NameSpacedIndex index = (NameSpacedIndex)manager.addIndex(config, cacheImpl, xml-filename-with-classes-in-it);
Note: The cache implementations must be started correctly before they arepassed into this method. Added caches are assumed to have been startedand the manager will NOT attempt to initialise the actual cacheimplementation.
Parameters:
  config - -the config class containing definitions of the adapter, indextype and parser to use.

Parameters:
  cache - -the cache implementation.

Parameters:
  classesFileName - -the xml file containing the classes definitions for the cache.This file must be available on the classpath.
The added cache.

throws:
  JoftiException - an exception detailing a failure to initialise the cache.




addIndex
public Index addIndex(IndexConfig config, Object cache, InputStream stream) throws JoftiException(Code)
This method allows cache instances to be added to the manager programatically rather than at start-up.

Any type of cache can be added in this manner, providing a CacheAdapter exists for it and the correct adapter has been configured in the IndexConfig class.

Note: The cache implementations must be started correctly before they arepassed into this method. Added caches are assumed to have been startedand the manager will NOT attempt to initialise the actual cacheimplementation.
Parameters:
  config - -the config class containing definitions of the adapter, indextype and parser to use.

Parameters:
  cache - -the cache implementation.

Parameters:
  stream - -the inputstream containing the classes definitions for thecache loaded from the config xml file.
The added Index.

throws:
  JoftiException - an exception detailing a failure to initialise the cache.




addIndex
abstract public Index addIndex(IndexConfig config, Object cache) throws JoftiException(Code)
This method allows cache instances to be added to the manager programatically rather than at start-up. The usage is for example:

DefaultIndexConfig config = new DefaultIndexConfig();
config.setName("test");
Index index = manager.addIndex(config, cacheImpl, xml-filename-with-classes-in-it);

any type of cache can be added in this manner, providing a CacheAdapter exists for it and the correct adapter has been configured in the IndexConfig class.

If you are using a nameSpaced cache like JBossCache then the usage wouldbe:

DefaultIndexConfig config = new DefaultIndexConfig();
config.setName("test");
NameSpacedIndex index = (NameSpacedIndex)manager.addIndexedCache(config, cacheImpl);

Note: The cache implementations must be started correctly before they arepassed into this method. Added caches are assumed to have been startedand the manager will NOT attempt to initialise the actual cacheimplementation.


Parameters:
  config - -the config class containing definitions of the adapter, indextype and parser to use.

Parameters:
  cache - -the cache implementation.
The added cache.

throws:
  JoftiException - an exception detailing a failure to initialise the cache.




addIndexCache
abstract public Index addIndexCache(IndexConfig config, String classesFileName) throws JoftiException(Code)
This method allows cache instances to be added to the manager programatically rather than at start-up.

Any type of cache can be added in this manner, providing a CacheAdapter exists for it and the correct adapter has been configured in the IndexConfig class.

Note: This method is the equivalent of an index entry in theconfiguration file. The manager will atttempt to construct and initialisea new indexed cache based on the attributes in the IndexConfig class andthe class definition file. This method cannot be used with Listener type adapters and an attempt to do so will thow an exception.


Parameters:
  config - -the config class containing definitions of the adapter, indextype and parser to use.

Parameters:
  classesFileName - -the xml file containing the classes definitions for thecache. This file must be available on the classpath. The added cache.

throws:
  JoftiException - an exception detailing a failure to initialise the cache.




addIndexCache
abstract public Index addIndexCache(IndexConfig config) throws JoftiException(Code)
This method allows cache instances to be added to the manager programatically rather than at start-up.

Any type of cache can be added in this manner, providing a CacheAdapter exists for it and the correct adapter has been configured in the IndexConfig class. This method will result in theadapter used creating a new instance of its cache type.

Note: This method is the equivalent of an index entry in theconfiguration file. The manager will atttempt to construct and initialisea new indexed cache based solely on the attributes in the IndexConfigclass.

This method cannot be used with Listener type adapters and an attempt to do so will thow an exception.

Class definitions can be added using attribute classMappings in theIndexConfig class. See this class for details on how to configure these.


Parameters:
  config - -the config class containing definitions of the adapter, indextype and parser to use.
The added Index.
throws:
  JoftiException - an exception detailing a failure to initialise the cache.




destroy
abstract public void destroy()(Code)
Used to shutdown and remove all indexed caches from the manager. You should always use this method to stop the manager - as some cache implementations explicitly require a shutdown phase to be run before they can be removed.




destroyIndex
abstract public void destroyIndex(Object cache)(Code)
Used to shutdown and remove an indexed cache from the manager. You should use this method to remove an indexed cache from the manager and shutdown the cache instance- as some cache implementations explicitly require a shutdown phase to be run before they can be removed.


Parameters:
  cache - - the cache to be destroyed.




getIndexCache
abstract public Index getIndexCache(String indexName) throws JoftiException(Code)
Retrieves an indexed cache from the manager. If the cache does not exist in the manager the method returns NULL, rather than throw an exception.

Attempting to retrieve a name spaced indexed cache using this method will result in an exception.

Use this method for Map, EHCache and OSCache types.


Parameters:
  indexName - - the key name to retrive the indexed cache. This set in the config as the Name.
- the cache or NULL if no cache can be found under that name.

throws:
  JoftiException - an exception detailing a failure to retrieve the indexed cache.




getNameSpacedIndex
abstract public NameSpacedIndex getNameSpacedIndex(String indexName) throws JoftiException(Code)
Retrieves a name spaced indexed cache from the manager. If the index does not exist in the manager the method returns NULL, rather than throw an exception.

Use this method for JBossCache
Attempting to retrieve a non-name spaced indexed cache using this method will result in an exception.


Parameters:
  indexName - - the key name to retrive the indexed cache. This set in the config as the Name.
- the cache or NULL if no cache can be found under that name.

throws:
  JoftiException - an exception detailing a failure to retrieve the indexed cache.




init
abstract public void init(String configFileName) throws JoftiException(Code)
Initialisation method that takes a config file name. This over-rides the fileName (if any) set in the setConfigFile() method.This method (or one of the other init methods) must be called BEFORE any other method is called on the manager.


Parameters:
  configFileName - - the filename containing the config - relative to the classpath.
throws:
  JoftiException - - an exception detailing a failure to initialise the cache.




init
abstract public void init() throws JoftiException(Code)
Initialisation method that takes no parameters. This configures the cache with the fileName set in the setConfigFile() method. This method (or one of the other init methods) must be called BEFORE any other method is called on the manager.


throws:
  JoftiException - - an exception detailing a failure to initialise the cache.




init
abstract public void init(InputStream configStream) throws JoftiException(Code)
Initialise method that takes an inputstream. This over-rides the fileName (if any) set in the setConfigFile() method.This method (or one of the other init methods must be called BEFORE any other method is called on the manager.


Parameters:
  configStream - a stream containing the loaded file.
throws:
  JoftiException - - an exception detailing a failure to initialise the cache.




removeIndex
abstract public Object removeIndex(Object cache)(Code)
Used to only remove an indexed cache from the manager and return the cache instance. You should use this method when you want to remive the index but keep the cache. This is the opposite of the addIndex method.

Once this method has been called the index becomes unusable and behaviour if you retain a reference is indeterminate.


Parameters:
  cache - - the cache to be removed.




setConfigFile
abstract public void setConfigFile(String configFile)(Code)
Sets a config file to use in the Manager. This file must be on the classpath.


Parameters:
  configFile - - the filename containing the config - relative to the classpath.




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