26 #include <glib-unix.h> 29 #include <ivi-profiling.h> 31 #include "filetoolkitwithundo.h" 32 #include "softwarecontainer.h" 33 #include "softwarecontainer-common.h" 34 #include "softwarecontainererror.h" 36 #include "capability/filteredconfigstore.h" 37 #include "capability/defaultconfigstore.h" 38 #include "capability/servicemanifestloader.h" 39 #include "config/config.h" 40 #include "containeroptions/containeroptionparser.h" 44 #include <jsonparser.h> 45 #include "commandjob.h" 50 static constexpr ContainerID INVALID_CONTAINER_ID = -1;
63 m_message(
"SoftwareContainer error")
72 virtual const char *what()
const throw()
74 return m_message.c_str();
78 std::string m_message;
84 LOG_DECLARE_CLASS_CONTEXT(
"SCA",
"SoftwareContainerAgent");
85 typedef std::shared_ptr<SoftwareContainerAbstractInterface> SoftwareContainerPtr;
104 std::shared_ptr<Config> config,
105 std::shared_ptr<SoftwareContainerFactory> factory,
106 std::shared_ptr<ContainerUtilityInterface> utility);
115 std::vector<ContainerID> listContainers();
126 std::vector<std::string> listCapabilities();
132 void deleteContainer(ContainerID containerID);
141 SoftwareContainerPtr getContainer(ContainerID containerID);
152 ContainerID createContainer(
const std::string &config);
165 pid_t execute(ContainerID containerID,
166 const std::string &cmdLine,
167 const std::string &workingDirectory,
168 const std::string &outputFile,
169 const EnvironmentVariables &env,
170 std::function<
void (pid_t,
int)> listener);
178 void shutdownContainer(ContainerID containerID);
186 void suspendContainer(ContainerID containerID);
194 void resumeContainer(ContainerID containerID);
207 void bindMount(
const ContainerID containerID,
208 const std::string &pathInHost,
209 const std::string &pathInContainer,
224 void setCapabilities(
const ContainerID &containerID,
225 const std::vector<std::string> &capabilities);
235 bool updateGatewayConfigs(
const ContainerID &containerID,
239 std::shared_ptr<CommandJob> getJob(pid_t pid);
241 void assertContainerExists(ContainerID containerID);
243 ContainerID findSuitableId();
246 std::map<ContainerID, SoftwareContainerPtr> m_containers;
248 Glib::RefPtr<Glib::MainContext> m_mainLoopContext;
250 std::vector<ContainerID> m_containerIdPool;
252 std::shared_ptr<FilteredConfigStore> m_filteredConfigStore;
253 std::shared_ptr<DefaultConfigStore> m_defaultConfigStore;
255 std::shared_ptr<Config> m_config;
273 std::shared_ptr<SoftwareContainerFactory> m_factory;
274 std::shared_ptr<ContainerUtilityInterface> m_containerUtility;
Contains all values that should be passed to SoftwareContainer on creation.
Contains the softwarecontainer::ContainerUtilityAbstractInterface class.
Contains the softwarecontainer::SoftwareContainerFactory class.
The SignalConnectionsHandler class contains references to sigc++ connections and automatically discon...
Developers guide to adding a config item:
An error occured in SoftwareContainerAgent.