Search in sources :

Example 6 with ServicePlugin

use of org.bimserver.plugins.services.ServicePlugin in project BIMserver by opensourceBIM.

the class BimServer method activateService.

public void activateService(long uoid, InternalServicePluginConfiguration internalServicePluginConfiguration) {
    ServicePlugin servicePlugin = getPluginManager().getServicePlugin(internalServicePluginConfiguration.getPluginDescriptor().getPluginClassName(), true);
    if (servicePlugin == null) {
        LOGGER.warn("Plugin " + internalServicePluginConfiguration.getPluginDescriptor().getPluginClassName() + " not found");
    } else {
        SInternalServicePluginConfiguration sInternalService = (SInternalServicePluginConfiguration) getSConverter().convertToSObject(internalServicePluginConfiguration);
        try {
            servicePlugin.unregister(sInternalService);
            servicePlugin.register(uoid, sInternalService, new org.bimserver.plugins.PluginConfiguration(internalServicePluginConfiguration.getSettings()));
        } catch (Throwable e) {
            LOGGER.error("", e);
        }
    }
}
Also used : ServicePlugin(org.bimserver.plugins.services.ServicePlugin) SInternalServicePluginConfiguration(org.bimserver.interfaces.objects.SInternalServicePluginConfiguration)

Aggregations

ServicePlugin (org.bimserver.plugins.services.ServicePlugin)6 DatabaseSession (org.bimserver.database.DatabaseSession)4 IOException (java.io.IOException)3 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)3 SInternalServicePluginConfiguration (org.bimserver.interfaces.objects.SInternalServicePluginConfiguration)3 InternalServicePluginConfiguration (org.bimserver.models.store.InternalServicePluginConfiguration)3 PluginDescriptor (org.bimserver.models.store.PluginDescriptor)3 ServerException (org.bimserver.shared.exceptions.ServerException)3 UserException (org.bimserver.shared.exceptions.UserException)3 ArrayList (java.util.ArrayList)2 ServletException (javax.servlet.ServletException)2 BimBotsException (org.bimserver.bimbots.BimBotsException)2 BimBotsServiceInterface (org.bimserver.bimbots.BimBotsServiceInterface)2 BimDatabase (org.bimserver.database.BimDatabase)2 IfcModelInterface (org.bimserver.emf.IfcModelInterface)2 SDeserializerPluginConfiguration (org.bimserver.interfaces.objects.SDeserializerPluginConfiguration)2 DeserializeException (org.bimserver.plugins.deserializers.DeserializeException)2 PluginException (org.bimserver.shared.exceptions.PluginException)2 AuthenticationException (org.bimserver.webservices.authorization.AuthenticationException)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1