public class DomainModelControllerService extends AbstractControllerService implements DomainController, HostModelUtil.HostModelRegistrar, HostRegistrations
ModelController
for a Host Controller process.AbstractControllerService.ModelControllerServiceInitializationParams, AbstractControllerService.PartialModelIndicator
Modifier and Type | Field and Description |
---|---|
static org.jboss.msc.service.ServiceName |
SERVICE_NAME |
authorizer, BOOT_STACK_SIZE_PROPERTY, DEFAULT_BOOT_STACK_SIZE, processType
Modifier and Type | Method and Description |
---|---|
void |
addHostEvent(String hostName,
HostConnectionInfo.Event event)
Add a host event.
|
protected void |
boot(BootContext context)
Boot the controller.
|
protected OperationStepHandler |
createExtraValidationStepHandler() |
ImmutableCapabilityRegistry |
getCapabilityRegistry() |
RunningMode |
getCurrentRunningMode()
Gets the domain controller's current running mode.
|
ExpressionResolver |
getExpressionResolver() |
ExtensionRegistry |
getExtensionRegistry() |
HostConnectionInfo |
getHostInfo(String hostName)
Get the host registration info.
|
HostFileRepository |
getLocalFileRepository()
Gets the file repository backing this domain controller
|
LocalHostControllerInfo |
getLocalHostInfo()
Gets the local host controller info.
|
protected AbstractControllerService.ModelControllerServiceInitializationParams |
getModelControllerServiceInitializationParams()
Override to return a
AbstractControllerService.ModelControllerServiceInitializationParams . |
protected AbstractControllerService.PartialModelIndicator |
getPartialModelIndicator() |
org.jboss.dmr.ModelNode |
getProfileOperations(String profileName)
Get the operations needed to create the given profile.
|
HostFileRepository |
getRemoteFileRepository()
Gets the file repository backing the master domain controller
|
void |
initializeMasterDomainRegistry(ManagementResourceRegistration root,
ExtensibleConfigurationPersister configurationPersister,
ContentRepository contentRepository,
HostFileRepository fileRepository,
ExtensionRegistry extensionRegistry,
PathManagerService pathManager) |
void |
initializeSlaveDomainRegistry(ManagementResourceRegistration root,
ExtensibleConfigurationPersister configurationPersister,
ContentRepository contentRepository,
HostFileRepository fileRepository,
LocalHostControllerInfo hostControllerInfo,
ExtensionRegistry extensionRegistry,
IgnoredDomainResourceRegistry ignoredDomainResourceRegistry,
PathManagerService pathManagery) |
protected void |
initModel(ManagementModel managementModel,
Resource modelControllerResource) |
boolean |
isHostRegistered(String id)
Check if a Host Controller is already registered with this domain controller.
|
void |
pingRemoteHost(String id)
Asynchronously ping the slave host with the given
hostName to validate its connection. |
void |
pruneDisconnected()
Prune all info for disconnected hosts.
|
void |
pruneExpired()
Prune all expired host info.
|
void |
registerHostModel(String hostName,
ManagementResourceRegistration root) |
void |
registerRemoteHost(String hostName,
ManagementChannelHandler handler,
Transformers transformers,
Long remoteConnectionId,
boolean registerProxyController)
Registers a slave Host Controller with this domain controller.
|
void |
registerRunningServer(ProxyController serverControllerClient)
Registers a running server in the domain model
|
void |
start(org.jboss.msc.service.StartContext context) |
void |
stop(org.jboss.msc.service.StopContext context) |
protected void |
stopAsynchronous(org.jboss.msc.service.StopContext context)
Hook for subclasses to perform work during the asynchronous task started by
AbstractControllerService.stop(org.jboss.msc.service.StopContext) . |
void |
stopLocalHost()
Stops this host controller
|
void |
stopLocalHost(int exitCode)
Stop this host controller with a specific exit code.
|
void |
unregisterRemoteHost(String id,
Long remoteConnectionId,
boolean cleanShutdown)
Unregisters a previously registered Host Controller.
|
void |
unregisterRunningServer(String serverName)
Unregisters a running server from the domain model
|
acquireReadLock, boot, boot, boot, boot, bootThreadDone, executeReadOnlyOperation, executeReadOnlyOperation, executeReadOnlyOperation, executeReadOnlyOperation, finishBoot, getAuditLogger, getBootErrorCollector, getExecutorServiceInjector, getMutableRootResourceRegistrationProvider, getValue, internalExecute, internalExecute, internalExecute, internalExecute, registerModelControllerServiceInitializationBootStep, releaseReadLock, setConfigurationPersister
public RunningMode getCurrentRunningMode()
DomainController
getCurrentRunningMode
in interface DomainController
public LocalHostControllerInfo getLocalHostInfo()
DomainController
getLocalHostInfo
in interface DomainController
public void registerRemoteHost(String hostName, ManagementChannelHandler handler, Transformers transformers, Long remoteConnectionId, boolean registerProxyController) throws SlaveRegistrationException
DomainController
registerRemoteHost
in interface DomainController
hostName
- the name of the slave hosthandler
- handler for communications with the hosttransformers
- transformation handler for converting resources and operations to forms appropriate for the slaveremoteConnectionId
- long identifying this specific connection to the host, or null
if the host did not provide such an idregisterProxyController
- true
if a proxy controller should be registered for the host; false
if the host is in --admin-only mode and should not be visible to outside usersSlaveRegistrationException
- if there is a problem registering the hostpublic boolean isHostRegistered(String id)
DomainController
isHostRegistered
in interface DomainController
id
- the name of the host controllertrue
if there is such a host controller registered, false
otherwisepublic void unregisterRemoteHost(String id, Long remoteConnectionId, boolean cleanShutdown)
DomainController
unregisterRemoteHost
in interface DomainController
id
- the name of the previously
registered Host ControllerremoteConnectionId
- long identifying the specific connection to the host, or null
. If null
the host's registration will be removed regardless of any remote connection id
that was provided at registration. If not null
, the registration will only
be removed if the currently registered id matches the given idcleanShutdown
- flag indication whether the host was cleanly unregisteredpublic void addHostEvent(String hostName, HostConnectionInfo.Event event)
HostRegistrations
addHostEvent
in interface HostRegistrations
hostName
- the host idevent
- the eventpublic void pruneExpired()
HostRegistrations
pruneExpired
in interface HostRegistrations
public void pruneDisconnected()
HostRegistrations
pruneDisconnected
in interface HostRegistrations
public HostConnectionInfo getHostInfo(String hostName)
HostRegistrations
getHostInfo
in interface HostRegistrations
hostName
- the host namepublic void pingRemoteHost(String id)
DomainController
hostName
to validate its connection.pingRemoteHost
in interface DomainController
id
- the name of the slave hostpublic void registerRunningServer(ProxyController serverControllerClient)
DomainController
registerRunningServer
in interface DomainController
serverControllerClient
- client the controller can use to communicate with the server.public void unregisterRunningServer(String serverName)
DomainController
unregisterRunningServer
in interface DomainController
serverName
- the name of the serverpublic org.jboss.dmr.ModelNode getProfileOperations(String profileName)
DomainController
getProfileOperations
in interface DomainController
profileName
- the name of the profilepublic HostFileRepository getLocalFileRepository()
DomainController
getLocalFileRepository
in interface DomainController
public HostFileRepository getRemoteFileRepository()
DomainController
getRemoteFileRepository
in interface DomainController
public void start(org.jboss.msc.service.StartContext context) throws org.jboss.msc.service.StartException
start
in interface org.jboss.msc.service.Service<ModelController>
start
in class AbstractControllerService
org.jboss.msc.service.StartException
protected void initModel(ManagementModel managementModel, Resource modelControllerResource)
initModel
in class AbstractControllerService
protected OperationStepHandler createExtraValidationStepHandler()
createExtraValidationStepHandler
in class AbstractControllerService
protected void boot(BootContext context) throws ConfigurationPersistenceException
AbstractControllerService
boot
in class AbstractControllerService
context
- the boot contextConfigurationPersistenceException
- if the configuration failed to be loadedprotected final AbstractControllerService.PartialModelIndicator getPartialModelIndicator()
getPartialModelIndicator
in class AbstractControllerService
protected AbstractControllerService.ModelControllerServiceInitializationParams getModelControllerServiceInitializationParams()
AbstractControllerService
AbstractControllerService.ModelControllerServiceInitializationParams
. If null
is returned,
AbstractControllerService.registerModelControllerServiceInitializationBootStep(BootContext)
will not perform any initialization
of ModelControllerServiceInitialization
instances.getModelControllerServiceInitializationParams
in class AbstractControllerService
ModelControllerServiceInitialization
instancespublic void stop(org.jboss.msc.service.StopContext context)
stop
in interface org.jboss.msc.service.Service<ModelController>
stop
in class AbstractControllerService
protected void stopAsynchronous(org.jboss.msc.service.StopContext context)
AbstractControllerService
AbstractControllerService.stop(org.jboss.msc.service.StopContext)
. This base method does nothing.
Subclasses must not invoke LifecycleContext.complete()
stopAsynchronous
in class AbstractControllerService
context
- the stop contextpublic void stopLocalHost()
DomainController
stopLocalHost
in interface DomainController
public void stopLocalHost(int exitCode)
DomainController
stopLocalHost
in interface DomainController
exitCode
- the exit code passed to the ProcessControllerpublic void registerHostModel(String hostName, ManagementResourceRegistration root)
registerHostModel
in interface HostModelUtil.HostModelRegistrar
public void initializeMasterDomainRegistry(ManagementResourceRegistration root, ExtensibleConfigurationPersister configurationPersister, ContentRepository contentRepository, HostFileRepository fileRepository, ExtensionRegistry extensionRegistry, PathManagerService pathManager)
initializeMasterDomainRegistry
in interface DomainController
public void initializeSlaveDomainRegistry(ManagementResourceRegistration root, ExtensibleConfigurationPersister configurationPersister, ContentRepository contentRepository, HostFileRepository fileRepository, LocalHostControllerInfo hostControllerInfo, ExtensionRegistry extensionRegistry, IgnoredDomainResourceRegistry ignoredDomainResourceRegistry, PathManagerService pathManagery)
initializeSlaveDomainRegistry
in interface DomainController
public ExtensionRegistry getExtensionRegistry()
getExtensionRegistry
in interface DomainController
public ImmutableCapabilityRegistry getCapabilityRegistry()
getCapabilityRegistry
in interface DomainController
public ExpressionResolver getExpressionResolver()
getExpressionResolver
in interface DomainController
Copyright © 2023 JBoss by Red Hat. All rights reserved.