|
@ -7,7 +7,7 @@ import ( |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
// 默认组件信息管理器
|
|
|
// 默认组件信息管理器
|
|
|
// @Implement LAPP_GAAS_GFrame_BACKEND/container/InformationManager
|
|
|
|
|
|
|
|
|
// @Implement LAPP_ACURA_MOM_BACKEND/container/InformationManager
|
|
|
type DefaultInformationManager struct { |
|
|
type DefaultInformationManager struct { |
|
|
// 组件信息映射: map[组件接口]组件信息
|
|
|
// 组件信息映射: map[组件接口]组件信息
|
|
|
informationMapping map[Interface]ComponentInformation |
|
|
informationMapping map[Interface]ComponentInformation |
|
@ -20,7 +20,7 @@ func NewDefaultInformationManager() *DefaultInformationManager { |
|
|
return &DefaultInformationManager{make(map[Interface]ComponentInformation, 100)} |
|
|
return &DefaultInformationManager{make(map[Interface]ComponentInformation, 100)} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// @Reference LAPP_GAAS_GFrame_BACKEND/container/InformationManager.RegisterElement
|
|
|
|
|
|
|
|
|
// @Reference LAPP_ACURA_MOM_BACKEND/container/InformationManager.RegisterElement
|
|
|
// 异常:
|
|
|
// 异常:
|
|
|
// 1.工厂不能为空
|
|
|
// 1.工厂不能为空
|
|
|
// 2.工厂必须是func
|
|
|
// 2.工厂必须是func
|
|
@ -44,7 +44,7 @@ func (manager *DefaultInformationManager) RegisterElement(factory interface{}, i |
|
|
manager.informationMapping[elementType] = elementInformation |
|
|
manager.informationMapping[elementType] = elementInformation |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// @Reference LAPP_GAAS_GFrame_BACKEND/container/InformationManager.RegisterService
|
|
|
|
|
|
|
|
|
// @Reference LAPP_ACURA_MOM_BACKEND/container/InformationManager.RegisterService
|
|
|
// 异常:
|
|
|
// 异常:
|
|
|
// 1.工厂不能为空
|
|
|
// 1.工厂不能为空
|
|
|
// 2.工厂必须是func
|
|
|
// 2.工厂必须是func
|
|
@ -69,7 +69,7 @@ func (manager *DefaultInformationManager) RegisterService(factory interface{}, i |
|
|
return serviceInformation |
|
|
return serviceInformation |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// @Reference LAPP_GAAS_GFrame_BACKEND/container/InformationManager.Item
|
|
|
|
|
|
|
|
|
// @Reference LAPP_ACURA_MOM_BACKEND/container/InformationManager.Item
|
|
|
func (manager *DefaultInformationManager) Item(interfaceType Interface) ComponentInformation { |
|
|
func (manager *DefaultInformationManager) Item(interfaceType Interface) ComponentInformation { |
|
|
|
|
|
|
|
|
if interfaceType == nil { |
|
|
if interfaceType == nil { |
|
@ -82,7 +82,7 @@ func (manager *DefaultInformationManager) Item(interfaceType Interface) Componen |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// @Reference LAPP_GAAS_GFrame_BACKEND/container/InformationManager.Items
|
|
|
|
|
|
|
|
|
// @Reference LAPP_ACURA_MOM_BACKEND/container/InformationManager.Items
|
|
|
func (manager *DefaultInformationManager) Items() []ComponentInformation { |
|
|
func (manager *DefaultInformationManager) Items() []ComponentInformation { |
|
|
|
|
|
|
|
|
items := make([]ComponentInformation, len(manager.informationMapping)) |
|
|
items := make([]ComponentInformation, len(manager.informationMapping)) |
|
|