001
014
015 package com.liferay.portal.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.util.MethodCache;
019 import com.liferay.portal.kernel.util.ReferenceRegistry;
020
021
034 public class RegionServiceUtil {
035
040 public static com.liferay.portal.model.Region addRegion(long countryId,
041 java.lang.String regionCode, java.lang.String name, boolean active)
042 throws com.liferay.portal.kernel.exception.PortalException,
043 com.liferay.portal.kernel.exception.SystemException {
044 return getService().addRegion(countryId, regionCode, name, active);
045 }
046
047 public static com.liferay.portal.model.Region getRegion(long regionId)
048 throws com.liferay.portal.kernel.exception.PortalException,
049 com.liferay.portal.kernel.exception.SystemException {
050 return getService().getRegion(regionId);
051 }
052
053 public static java.util.List<com.liferay.portal.model.Region> getRegions()
054 throws com.liferay.portal.kernel.exception.SystemException {
055 return getService().getRegions();
056 }
057
058 public static java.util.List<com.liferay.portal.model.Region> getRegions(
059 boolean active)
060 throws com.liferay.portal.kernel.exception.SystemException {
061 return getService().getRegions(active);
062 }
063
064 public static java.util.List<com.liferay.portal.model.Region> getRegions(
065 long countryId)
066 throws com.liferay.portal.kernel.exception.SystemException {
067 return getService().getRegions(countryId);
068 }
069
070 public static java.util.List<com.liferay.portal.model.Region> getRegions(
071 long countryId, boolean active)
072 throws com.liferay.portal.kernel.exception.SystemException {
073 return getService().getRegions(countryId, active);
074 }
075
076 public static RegionService getService() {
077 if (_service == null) {
078 _service = (RegionService)PortalBeanLocatorUtil.locate(RegionService.class.getName());
079
080 ReferenceRegistry.registerReference(RegionServiceUtil.class,
081 "_service");
082 MethodCache.remove(RegionService.class);
083 }
084
085 return _service;
086 }
087
088 public void setService(RegionService service) {
089 MethodCache.remove(RegionService.class);
090
091 _service = service;
092
093 ReferenceRegistry.registerReference(RegionServiceUtil.class, "_service");
094 MethodCache.remove(RegionService.class);
095 }
096
097 private static RegionService _service;
098 }