/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.liferay.portal.scheduler.single.internal.portal.profile; import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.util.Props; import com.liferay.portal.kernel.util.PropsKeys; import com.liferay.portal.profile.BaseDSModulePortalProfile; import com.liferay.portal.profile.PortalProfile; import com.liferay.portal.scheduler.single.internal.SingleSchedulerEngineConfigurator; import java.util.Collections; import java.util.Set; import org.osgi.service.component.ComponentContext; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import org.osgi.service.component.annotations.Reference; /** * @author Shuyang Zhou */ @Component(immediate = true, service = PortalProfile.class) public class ModulePortalProfile extends BaseDSModulePortalProfile { @Activate public void activate(ComponentContext componentContext) { Set<String> supportedPortalProfileNames = null; if (GetterUtil.getBoolean(_props.get(PropsKeys.SCHEDULER_ENABLED))) { supportedPortalProfileNames = Collections.singleton( PortalProfile.PORTAL_PROFILE_NAME_CE); } else { supportedPortalProfileNames = Collections.emptySet(); } init( componentContext, supportedPortalProfileNames, SingleSchedulerEngineConfigurator.class.getName()); } @Reference(unbind = "-") protected void setProps(Props props) { _props = props; } private Props _props; }