Class BeanDatabaseImpl
- java.lang.Object
-
- org.glassfish.hk2.configuration.hub.internal.BeanDatabaseImpl
-
- All Implemented Interfaces:
BeanDatabase
public class BeanDatabaseImpl extends java.lang.Object implements BeanDatabase
-
-
Constructor Summary
Constructors Constructor Description BeanDatabaseImpl(long revision)Creates a new, fresh databaseBeanDatabaseImpl(long revision, BeanDatabase beanDatabase)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddumpDatabase()Dumps the type and instance names to stderrvoiddumpDatabase(java.io.PrintStream output)Dumps the type and instance names to the given streamjava.lang.StringdumpDatabaseAsString()Dumps the type and instance names to a String for debuggingjava.util.Set<Type>getAllTypes()Gets an unmodifiable set of all the types in the bean databaseInstancegetInstance(java.lang.String type, java.lang.String instanceKey)Returns the instance with the given instanceKey from the type with the given name(package private) longgetRevision()TypegetType(java.lang.String type)Gets the type with the given namejava.lang.StringtoString()
-
-
-
Field Detail
-
revision
private final long revision
-
types
private final java.util.HashMap<java.lang.String,TypeImpl> types
-
-
Constructor Detail
-
BeanDatabaseImpl
BeanDatabaseImpl(long revision)
Creates a new, fresh database
-
BeanDatabaseImpl
BeanDatabaseImpl(long revision, BeanDatabase beanDatabase)
-
-
Method Detail
-
getAllTypes
public java.util.Set<Type> getAllTypes()
Description copied from interface:BeanDatabaseGets an unmodifiable set of all the types in the bean database- Specified by:
getAllTypesin interfaceBeanDatabase- Returns:
- A non-null unmodifiable and possibly empty set of all the types in the database
-
getInstance
public Instance getInstance(java.lang.String type, java.lang.String instanceKey)
Description copied from interface:BeanDatabaseReturns the instance with the given instanceKey from the type with the given name- Specified by:
getInstancein interfaceBeanDatabase- Parameters:
type- The non-null name of the type to get the instance frominstanceKey- The non-null key of the instance- Returns:
- The bean from the given type with the given name. Will return null if the type does not exist or an instance with that key does not exist
-
getType
public Type getType(java.lang.String type)
Description copied from interface:BeanDatabaseGets the type with the given name- Specified by:
getTypein interfaceBeanDatabase- Parameters:
type- The non-null name- Returns:
- The type corresponding to the given name. May return null
-
getRevision
long getRevision()
-
dumpDatabase
public void dumpDatabase()
Description copied from interface:BeanDatabaseDumps the type and instance names to stderr- Specified by:
dumpDatabasein interfaceBeanDatabase
-
dumpDatabase
public void dumpDatabase(java.io.PrintStream output)
Description copied from interface:BeanDatabaseDumps the type and instance names to the given stream- Specified by:
dumpDatabasein interfaceBeanDatabase- Parameters:
output- - The non-null outut stream to write the database to
-
dumpDatabaseAsString
public java.lang.String dumpDatabaseAsString()
Description copied from interface:BeanDatabaseDumps the type and instance names to a String for debugging- Specified by:
dumpDatabaseAsStringin interfaceBeanDatabase- Returns:
- A string with all type and instance names
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-