Java Doc for Turbo.java in  » IDE-Netbeans » versioning » org » netbeans » modules » turbo » 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 » IDE Netbeans » versioning » org.netbeans.modules.turbo 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.modules.turbo.Turbo

Turbo
final public class Turbo (Code)
Turbo is general purpose entries/attributes dictionary with pluggable layer enabling high scalability disk swaping implementations. It allows to store several name identified values for an entity identified by a key.

All methods take a key parameter. It identifies entity to which attribute values are associated. It must have properly implemented equals(), hashcode() and toString() (returning unique string) methods. Key lifetime must be well understood to set cache strategy effeciently:

  • MAXIMUM: The implementation monitors key instance lifetime and does not release data from memory until max. size limit reached or key instance garbage collected whichever comes sooner. For unbound caches the key must not be hard referenced from stored value.
  • MINIMUM: For value lookups key's value based equalence is used. Key's instance lifetime is monitored by instance based equalence. Reasonable min limit must be set because there can be several value equalent key instances but only one used key instance actually stored in cache and lifetime monitored.

Entry name fully indentifies contract between consumers and providers. Contracts are described elsewhere.

The dictionary does not support storing null values. Writing null value means that given entry should be invalidated and removed (it actualy depends on externally negotiated contract identified by name). Getting null as requets result means that given value is not (yet) known or does not exist at all.
author:
   Petr Kuzel


Inner Class :static class Environment



Method Summary
public  voidaddTurboListener(TurboListener l)
    
public static synchronized  TurbocreateCustom(CustomProviders providers, int min, int max)
     Creates new instance with customized providers layer.
protected  voidfinalize()
     Logs cache statistics data.
protected  voidfireEntryChange(Object key, String name, Object value)
    
public static synchronized  TurbogetDefault()
     Returns default instance.
public  ObjectgetMonitoredKey(Object key)
     Gets key instance that it actually used in memory layer.
static synchronized  voidinitEnvironment(Environment environment)
     Tests can set different environment.
public  booleanisPrepared(Object key, String name)
     Checks name instant availability.
public  booleanprepareEntry(Object key, String name)
     Checks value instant availability and possibly schedules its background loading.
public  ObjectreadEntry(Object key, String name)
     Reads given attribute for given entity key.
public  voidremoveTurboListener(TurboListener l)
    
 intstoreEntry(Object key, String name, Object value)
     Stores directly to providers.
public  StringtoString()
     For debugging purposes only.
public  booleanwriteEntry(Object key, String name, Object value)
     Writes given attribute, value pair and notifies all listeners. Written value is stored both into memory and providers layer. The call speed depends on actually used provider.



Method Detail
addTurboListener
public void addTurboListener(TurboListener l)(Code)



createCustom
public static synchronized Turbo createCustom(CustomProviders providers, int min, int max)(Code)
Creates new instance with customized providers layer.
Parameters:
  providers - never null
Parameters:
  min - minimum number of entries held by the cache
Parameters:
  max - maximum size or -1 for unbound size(defined just by key instance lifetime)



finalize
protected void finalize() throws Throwable(Code)
Logs cache statistics data.



fireEntryChange
protected void fireEntryChange(Object key, String name, Object value)(Code)



getDefault
public static synchronized Turbo getDefault()(Code)
Returns default instance. It's size is driven by keys lifetime. It shrinks on keys become unreferenced and grows without bounds on inserting keys.



getMonitoredKey
public Object getMonitoredKey(Object key)(Code)
Gets key instance that it actually used in memory layer. Client should keep reference to it if it wants to use key lifetime monitoring cache size strategy.
Parameters:
  key - key never null key instance that is value-equalent or nullif monitored instance does not exist.



initEnvironment
static synchronized void initEnvironment(Environment environment)(Code)
Tests can set different environment. Must be called before Turbo.getDefault .



isPrepared
public boolean isPrepared(Object key, String name)(Code)
Checks name instant availability. Note that actual value may be still null, in case that it's known that value does not exist.



prepareEntry
public boolean prepareEntry(Object key, String name)(Code)
Checks value instant availability and possibly schedules its background loading. It's designed to be called from UI tread.



readEntry
public Object readEntry(Object key, String name)(Code)
Reads given attribute for given entity key.
Parameters:
  key - a entity key, never null
Parameters:
  name - identifies requested entry, never null entry value or null if it does not exist or unknown.



removeTurboListener
public void removeTurboListener(TurboListener l)(Code)



storeEntry
int storeEntry(Object key, String name, Object value)(Code)
Stores directly to providers. 0 success, -1 contract failure, 1 other failure



toString
public String toString()(Code)
For debugging purposes only.



writeEntry
public boolean writeEntry(Object key, String name, Object value)(Code)
Writes given attribute, value pair and notifies all listeners. Written value is stored both into memory and providers layer. The call speed depends on actually used provider. However do not rely on synchronous provider call. In future it may return and fire immediately on writing into memory layer, populating providers asychronously on background.

A client calling this method is reponsible for passing valid value that is accepted by attribute serving providers.
Parameters:
  key - identifies target, never null
Parameters:
  name - identifies attribute, never null
Parameters:
  value - actual attribute value to be stored, null behaviouris defined specificaly for each name. It always invalidates memory entryand it either invalidates or removes value from providers layer(mening: value unknown versus value is known to not exist).

Client should consider a size of stored value. It must be corelatedwith Turbo memory layer limits to avoid running ouf of memory.

  • false on write failure caused by a provider denying the value.It means attribute contract violation and must be handled e.g.:

    boolean success = faq.writeAttribute(fo, name, value);
    assert success : "Unexpected name[" + name + "] value[" + value + "] denial for " + key + "!";

  • true in all other cases includins I/O error.After all it's just best efford cache. All values can be recomputed.



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.