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


java.lang.Object
   com.jofti.manager.IndexManagerImpl

IndexManagerImpl
public class IndexManagerImpl implements IndexManager(Code)
The manager is responsible for providing access to caches. This class is not a singleton and is not intended to be used in that manner.

The usage for the cache manager is:

IndexManager manager = new IndexManagerImpl();
manager.setConfigFile("configFile");
manager.init();
IndexCache index = manager.getIndex("name");

or:

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

or

IndexManager manager = new IndexManagerImpl();
manager.init(configFile);
IndexCache index = manager.getIndex("name");

The name of the index is one of the indexs configured in the configFile.

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.0




Constructor Summary
public  IndexManagerImpl()
    

Method Summary
public  IndexaddIndex(IndexConfig config, Object cache, String classesFileName)
     This method allows cache instances to be added to the cache programatically rather than at start-up.
public  IndexaddIndex(IndexConfig config, Object cache)
     This method allows cache instances to be added to the cache programatically rather than at start-up.
public  IndexaddIndex(IndexConfig config, Object cache, InputStream stream)
    
public  IndexaddIndexCache(IndexConfig config, String classesFileName)
     This method allows cache instances to be added to the cache programatically rather than at start-up.
public  IndexaddIndexCache(IndexConfig config)
     This method allows cache instances to be added to the cache 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.

public synchronized  voiddestroy()
    
public synchronized  voiddestroyIndex(Object cache)
     Used to shutdown and remove a cache from the manager.
public  IndexgetIndexCache(String indexName)
     Retrieves a cache from the manager.
public  NameSpacedIndexgetNameSpacedIndex(String indexName)
     Retrieves a name spaced indexed cache from the manager.
public synchronized  voidinit(String configFileName)
     Initialise method that takes a config file name.
public synchronized  voidinit()
     Initialise method that no parameters.
public synchronized  voidinit(InputStream configStream)
     Initialise method that takes an inputstream.
protected synchronized  voidremoveCache(LifeCycleAdapter wrapper)
    
public synchronized  ObjectremoveIndex(Object cache)
    
public  voidsetConfigFile(String configFile)
     Sets a config file to use in the indexManager.


Constructor Detail
IndexManagerImpl
public IndexManagerImpl()(Code)
Creates a new instance of IndexManagerImpl




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

The usage is for example:

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

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, , );

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. Passing NULL will result in the adapter creating a newcache instance.
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 -




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

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

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, );

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. Passing NULL will result in the adapter creating a newcache instance. The added cache.
throws:
  JoftiException -




addIndex
public Index addIndex(IndexConfig config, Object cache, InputStream stream) throws JoftiException(Code)



addIndexCache
public Index addIndexCache(IndexConfig config, String classesFileName) throws JoftiException(Code)
This method allows cache instances to be added to the cache programatically rather than at start-up. This method will result in the adapter used creating a new instance of its cache type.

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 cacheConfig class andthe class definition file.


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 -




addIndexCache
public Index addIndexCache(IndexConfig config) throws JoftiException(Code)
This method allows cache instances to be added to the cache 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 cacheConfigclass.

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 cache.
throws:
  JoftiException -




destroy
public synchronized void destroy()(Code)



destroyIndex
public synchronized void destroyIndex(Object cache)(Code)
Used to shutdown and remove a cache from the manager. You should always use this method to remove a cache from the manager - 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
public Index getIndexCache(String indexName) throws JoftiException(Code)
Retrieves a 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 cache using this method will result in an exception.
Parameters:
  indexName - - the key name to retrive the cache. This set in the config as the cacheName. - the cache or NULL if no cache can be found under that name.
throws:
  JoftiException -



getNameSpacedIndex
public NameSpacedIndex getNameSpacedIndex(String indexName) throws JoftiException(Code)
Retrieves a name spaced 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 non-name spaced cache using this method will result in an exception.
Parameters:
  indexName - - the key name to retrive the cache. This set in the config as the cacheName. - the cache or NULL if no cache can be found under that name.
throws:
  JoftiException -



init
public synchronized void init(String configFileName) throws JoftiException(Code)
Initialise method that takes a config file name. This over-rides the fileName (if any) set in the setConfigFile() method.
Parameters:
  configFileName -
throws:
  JoftiException -



init
public synchronized void init() throws JoftiException(Code)
Initialise method that no parameters. This configures the Indexes with the fileName set in the setConfigFile() method.
throws:
  JoftiException -



init
public synchronized 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.
Parameters:
  configStream -
throws:
  JoftiException -



removeCache
protected synchronized void removeCache(LifeCycleAdapter wrapper)(Code)



removeIndex
public synchronized Object removeIndex(Object cache)(Code)



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



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.