| 40 | } |
| 41 | |
| 42 | void Service::OnAllConfigLoaded() |
| 43 | { |
| 44 | ObjectImpl<Service>::OnAllConfigLoaded(); |
| 45 | |
| 46 | String zoneName = GetZoneName(); |
| 47 | |
| 48 | if (!zoneName.IsEmpty()) { |
| 49 | Zone::Ptr zone = Zone::GetByName(zoneName); |
| 50 | |
| 51 | if (zone && zone->IsGlobal()) |
| 52 | BOOST_THROW_EXCEPTION(std::invalid_argument("Service '" + GetName() + "' cannot be put into global zone '" + zone->GetName() + "'.")); |
| 53 | } |
| 54 | |
| 55 | m_Host = Host::GetByName(GetHostName()); |
| 56 | |
| 57 | if (m_Host) |
| 58 | m_Host->AddService(this); |
| 59 | |
| 60 | ServiceGroup::EvaluateObjectRules(this); |
| 61 | |
| 62 | Array::Ptr groups = GetGroups(); |
| 63 | |
| 64 | if (groups) { |
| 65 | groups = groups->ShallowClone(); |
| 66 | |
| 67 | ObjectLock olock(groups); |
| 68 | |
| 69 | for (String name : groups) { |
| 70 | ServiceGroup::Ptr sg = ServiceGroup::GetByName(name); |
| 71 | |
| 72 | if (sg) |
| 73 | sg->ResolveGroupMembership(this, true); |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | void Service::CreateChildObjects(const Type::Ptr& childType) |
| 79 | { |
nothing calls this directly
no test coverage detected