@Beta public class CatalogInitialization extends java.lang.Object implements ManagementContextInjectable
Constructor and Description |
---|
CatalogInitialization() |
CatalogInitialization(java.lang.String initialUri,
boolean reset,
java.lang.String additionUri,
boolean force) |
Modifier and Type | Method and Description |
---|---|
CatalogInitialization |
addPopulationCallback(com.google.common.base.Function<CatalogInitialization,java.lang.Void> callback) |
void |
applyCatalogLoadMode()
Deprecated.
since introduced in 0.7.0, only for legacy compatibility with
CatalogLoadMode BrooklynServerConfig.CATALOG_LOAD_MODE ,
allowing control of catalog loading from a brooklyn property |
ManagementContext |
getManagementContext() |
void |
handleException(java.lang.Throwable throwable,
java.lang.Object details) |
boolean |
hasRunAnyInitialization()
Returns true if the initializer has run at all,
including transient initializations which might be needed before a canonical becoming-master rebind,
for instance because the catalog is being accessed before loading rebind information
(done by
populateUnofficial(BasicBrooklynCatalog) ) |
boolean |
hasRunFinalInitialization()
Returns true if the canonical initialization has completed,
that is, an initialization which is done when a node is rebinded as master
(or an initialization done by the startup routines when not running persistence);
see also
hasRunAnyInitialization() . |
boolean |
hasRunOfficialInitialization()
Returns true if an official initialization has run,
even if it was a transient run, e.g.
|
void |
injectManagementContext(ManagementContext managementContext)
Sets the
ManagementContext reference. |
boolean |
isInitialResetRequested() |
void |
populateCatalog(ManagementNodeState nodeState,
boolean needsInitialItemsLoaded,
boolean needsAdditionsLoaded,
java.util.Collection<CatalogItem<?,?>> optionalExcplicitItemsForResettingCatalog)
makes or updates the mgmt catalog, based on the settings in this class
|
void |
populateUnofficial(BasicBrooklynCatalog catalog)
Creates the catalog based on parameters set here, if not yet loaded,
but ignoring persisted state and warning if persistence is on and we are starting up
(because the official persistence is preferred and the catalog will be subsequently replaced);
for use when the catalog is accessed before persistence is completed.
|
void |
setFailOnStartupErrors(boolean startupFailOnCatalogErrors) |
void |
setStartingUp(boolean isStartingUp)
Called by the framework to set true while starting up, and false afterwards,
in order to assist in appropriate logging and error handling.
|
public CatalogInitialization(java.lang.String initialUri, boolean reset, java.lang.String additionUri, boolean force)
public CatalogInitialization()
public void injectManagementContext(ManagementContext managementContext)
ManagementContextInjectable
ManagementContext
reference.injectManagementContext
in interface ManagementContextInjectable
public void setStartingUp(boolean isStartingUp)
public void setFailOnStartupErrors(boolean startupFailOnCatalogErrors)
public CatalogInitialization addPopulationCallback(com.google.common.base.Function<CatalogInitialization,java.lang.Void> callback)
public ManagementContext getManagementContext()
public boolean isInitialResetRequested()
public boolean hasRunFinalInitialization()
hasRunAnyInitialization()
.public boolean hasRunOfficialInitialization()
public boolean hasRunAnyInitialization()
populateUnofficial(BasicBrooklynCatalog)
)public void populateCatalog(ManagementNodeState nodeState, boolean needsInitialItemsLoaded, boolean needsAdditionsLoaded, java.util.Collection<CatalogItem<?,?>> optionalExcplicitItemsForResettingCatalog)
nodeState
- the management node for which this is being read; if master, then we expect this run to be the last one,
and so subsequent applications should ignore any initialization data (e.g. on a subsequent promotion to master,
after a master -> standby -> master cycle)needsInitialItemsLoaded
- whether the catalog needs the initial items loadedneedsAdditionalItemsLoaded
- whether the catalog needs the additions loadedoptionalExcplicitItemsForResettingCatalog
- if supplied, the catalog is reset to contain only these items, before calling any other initialization
for use primarily when rebinding@Deprecated public void applyCatalogLoadMode()
CatalogLoadMode
BrooklynServerConfig.CATALOG_LOAD_MODE
,
allowing control of catalog loading from a brooklyn propertypublic void populateUnofficial(BasicBrooklynCatalog catalog)
This method is primarily used during testing, which in many cases does not enforce the full startup order and which wants a local catalog in any case. It may also be invoked if a client requests the catalog while the server is starting up.
public void handleException(java.lang.Throwable throwable, java.lang.Object details)