001
014
015 package com.liferay.portal.dao.shard;
016
017 import com.liferay.portal.kernel.dao.shard.Shard;
018
019 import javax.sql.DataSource;
020
021
024 public class ShardImpl implements Shard {
025
026 public DataSource getDataSource() {
027 return _shardAdvice.getDataSource();
028 }
029
030 public boolean isEnabled() {
031 if (_shardAdvice != null) {
032 return true;
033 }
034 else {
035 return false;
036 }
037 }
038
039 public String popCompanyService() {
040 String value = null;
041
042 if (_shardAdvice != null) {
043 value = _shardAdvice.popCompanyService();
044 }
045
046 return value;
047 }
048
049 public void pushCompanyService(long companyId) {
050 if (_shardAdvice != null) {
051 _shardAdvice.pushCompanyService(companyId);
052 }
053 }
054
055 public void pushCompanyService(String shardName) {
056 if (_shardAdvice != null) {
057 _shardAdvice.pushCompanyService(shardName);
058 }
059 }
060
061 public void setShardAdvice(ShardAdvice shardAdvice) {
062 _shardAdvice = shardAdvice;
063 }
064
065 private static ShardAdvice _shardAdvice;
066
067 }