org.jbundle.base.db.Record.getMasterSlave()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(11.6k)|赞(0)|评价(0)|浏览(66)

本文整理了Java中org.jbundle.base.db.Record.getMasterSlave方法的一些代码示例,展示了Record.getMasterSlave的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Record.getMasterSlave方法的具体详情如下:
包路径:org.jbundle.base.db.Record
类名称:Record
方法名:getMasterSlave

Record.getMasterSlave介绍

[英]Is this a client or a server. Get the client/server flag.
[中]这是客户端还是服务器。获取客户机/服务器标志。

代码示例

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * Override this to add record listeners and filters.
 */
public void addListeners()
{
  if ((this.getMasterSlave() & RecordOwner.MASTER) != 0)    // Don't add in slave
    this.addMasterListeners();
  if ((this.getMasterSlave() & RecordOwner.SLAVE) != 0)     // Do add in slave
    this.addSlaveListeners();
}
/**

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

/**
 * Override this to add record listeners and filters.
 */
public void addListeners()
{
  if ((this.getMasterSlave() & RecordOwner.MASTER) != 0)    // Don't add in slave
    this.addMasterListeners();
  if ((this.getMasterSlave() & RecordOwner.SLAVE) != 0)     // Do add in slave
    this.addSlaveListeners();
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base

/**
 * Override this to add record listeners and filters.
 */
public void addListeners()
{
  if ((this.getMasterSlave() & RecordOwner.MASTER) != 0)    // Don't add in slave
    this.addMasterListeners();
  if ((this.getMasterSlave() & RecordOwner.SLAVE) != 0)     // Do add in slave
    this.addSlaveListeners();
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * Is this listener enabled?
 * Note: This logic checks for 'client-only behaviors' trying to run in
 * an environment that doesn't support 'servers' (client-only environments).
 * @return true if this should be used.
 */
public boolean isEnabled()
{
  if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_SLAVE) == 0) // Is NOT enabled in a SERVER only environment
    if (this.getOwner() != null)
      if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) == 0) // Is not a client environment
    return false;   // Don't run this listener in a server-only environment
  if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_MASTER) == 0) // Is NOT enabled in a CLIENT only environment
    if (this.getOwner() != null)
      if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) == 0) // Is not a server environment
    return false;   // Don't run this listener in a client-only environment
  return super.isEnabled();
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base

/**
 * Is this listener enabled?
 * Note: This logic checks for 'client-only behaviors' trying to run in
 * an environment that doesn't support 'servers' (client-only environments).
 * @return true if this should be used.
 */
public boolean isEnabled()
{
  if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_SLAVE) == 0) // Is NOT enabled in a SERVER only environment
    if (this.getOwner() != null)
      if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) == 0) // Is not a client environment
    return false;   // Don't run this listener in a server-only environment
  if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_MASTER) == 0) // Is NOT enabled in a CLIENT only environment
    if (this.getOwner() != null)
      if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) == 0) // Is not a server environment
    return false;   // Don't run this listener in a client-only environment
  return super.isEnabled();
}
/**

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

/**
 * Is this listener enabled?
 * Note: This logic checks for 'client-only behaviors' trying to run in
 * an environment that doesn't support 'servers' (client-only environments).
 * @return true if this should be used.
 */
public boolean isEnabled()
{
  if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_SLAVE) == 0) // Is NOT enabled in a SERVER only environment
    if (this.getOwner() != null)
      if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) == 0) // Is not a client environment
    return false;   // Don't run this listener in a server-only environment
  if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_MASTER) == 0) // Is NOT enabled in a CLIENT only environment
    if (this.getOwner() != null)
      if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) == 0) // Is not a server environment
    return false;   // Don't run this listener in a client-only environment
  return super.isEnabled();
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base

/**
 * Called when a error happens on a file operation, return the error code, or fix the problem.
 * @param changeType The type of change that occurred.
 * @param iErrorCode The error code from the previous listener.
 * @return The new error code.
 */
public int doErrorReturn(int iChangeType, int iErrorCode)        // init this field override for other value
{
  if (iChangeType == DBConstants.AFTER_UPDATE_TYPE)
    if (this.isModLockMode())
    {
      if (this.getOwner().getTable().getCurrentTable() == this.getOwner().getTable())
      {    // Must be the top-level record to do the merge. Otherwise, return an error and let the current record handle the merge
        boolean bRunMergeCode = false;
        if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) != 0)
          if ((this.getOwner().getDatabaseType() & DBConstants.SERVER_REWRITES) == 0)
            bRunMergeCode = true;	// Typically refresh in the client so listeners can be run
        if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)
          if ((this.getOwner().getDatabaseType() & DBConstants.SERVER_REWRITES) != 0)
            bRunMergeCode = true;	// Unless server rewrite is set, then do the rewrite in the server
        if (bRunMergeCode)
          return this.refreshMergeAndRewrite(iErrorCode);		// Only do this in the master and shared code
      }
    }
  return super.doErrorReturn(iChangeType, iErrorCode);
}
/**

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

/**
 * Called when a error happens on a file operation, return the error code, or fix the problem.
 * @param changeType The type of change that occurred.
 * @param iErrorCode The error code from the previous listener.
 * @return The new error code.
 */
public int doErrorReturn(int iChangeType, int iErrorCode)        // init this field override for other value
{
  if (iChangeType == DBConstants.AFTER_UPDATE_TYPE)
    if (this.isModLockMode())
    {
      if (this.getOwner().getTable().getCurrentTable() == this.getOwner().getTable())
      {    // Must be the top-level record to do the merge. Otherwise, return an error and let the current record handle the merge
        boolean bRunMergeCode = false;
        if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) != 0)
          if ((this.getOwner().getDatabaseType() & DBConstants.SERVER_REWRITES) == 0)
            bRunMergeCode = true;	// Typically refresh in the client so listeners can be run
        if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)
          if ((this.getOwner().getDatabaseType() & DBConstants.SERVER_REWRITES) != 0)
            bRunMergeCode = true;	// Unless server rewrite is set, then do the rewrite in the server
        if (bRunMergeCode)
          return this.refreshMergeAndRewrite(iErrorCode);		// Only do this in the master and shared code
      }
    }
  return super.doErrorReturn(iChangeType, iErrorCode);
}
/**

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

/**
 * Called when a error happens on a file operation, return the error code, or fix the problem.
 * @param changeType The type of change that occurred.
 * @param iErrorCode The error code from the previous listener.
 * @return The new error code.
 */
public int doErrorReturn(int iChangeType, int iErrorCode)        // init this field override for other value
{
  if (iChangeType == DBConstants.AFTER_UPDATE_TYPE)
    if (this.isModLockMode())
    {
      if (this.getOwner().getTable().getCurrentTable() == this.getOwner().getTable())
      {    // Must be the top-level record to do the merge. Otherwise, return an error and let the current record handle the merge
        boolean bRunMergeCode = false;
        if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) != 0)
          if ((this.getOwner().getDatabaseType() & DBConstants.SERVER_REWRITES) == 0)
            bRunMergeCode = true;	// Typically refresh in the client so listeners can be run
        if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)
          if ((this.getOwner().getDatabaseType() & DBConstants.SERVER_REWRITES) != 0)
            bRunMergeCode = true;	// Unless server rewrite is set, then do the rewrite in the server
        if (bRunMergeCode)
          return this.refreshMergeAndRewrite(iErrorCode);		// Only do this in the master and shared code
      }
    }
  return super.doErrorReturn(iChangeType, iErrorCode);
}
/**

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)
  this.clearTemporaryKeyField();		// Don't do this for master only code (slave will take care of the unique incrementing date)
    if ((record.isModified()) || (iErrorCode == DBConstants.RECORD_CHANGED))
      if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)
    m_bIsTempEnabled--;
  if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)		// Don't do this for master only code (slave will take care of the unique incrementing date)
    this.clearTemporaryKeyField();

代码示例来源:origin: org.jbundle.base/org.jbundle.base

if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)
  this.clearTemporaryKeyField();		// Don't do this for master only code (slave will take care of the unique incrementing date)
    if ((record.isModified()) || (iErrorCode == DBConstants.RECORD_CHANGED))
      if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)
    m_bIsTempEnabled--;
  if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)		// Don't do this for master only code (slave will take care of the unique incrementing date)
    this.clearTemporaryKeyField();

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)

代码示例来源:origin: org.jbundle.base/org.jbundle.base

if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

case DBConstants.ADD_TYPE:
  boolean bNonNulls = this.setMainKey(bDisplayOption, null, bSetIfModified);              // Set up the key (keys are marked as changed if they change!)
  if ((bNonNulls == false) && ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) == 0))  // Don't return for a server!

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

case DBConstants.ADD_TYPE:
  boolean bNonNulls = this.setMainKey(bDisplayOption, null, bSetIfModified);              // Set up the key (keys are marked as changed if they change!)
  if ((bNonNulls == false) && ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) == 0))  // Don't return for a server!

代码示例来源:origin: org.jbundle.base/org.jbundle.base

case DBConstants.ADD_TYPE:
  boolean bNonNulls = this.setMainKey(bDisplayOption, null, bSetIfModified);              // Set up the key (keys are marked as changed if they change!)
  if ((bNonNulls == false) && ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) == 0))  // Don't return for a server!

代码示例来源:origin: org.jbundle.base/org.jbundle.base

if ((this.getMasterSlave() & RecordOwner.MASTER) != 0)   // Slaves don't need this helper class.
  if (this.getTable().getDatabase().getDatabaseOwner().getEnvironment() != null)
  if ((DBConstants.YES.equalsIgnoreCase(((Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment()).getProperty(DBParams.LOG_TRXS))) || (DBConstants.TRUE.equalsIgnoreCase(((Environment)this.getTable().getDatabase().getDatabaseOwner().getEnvironment()).getProperty(DBParams.LOG_TRXS))))
if ((this.getMasterSlave() & RecordOwner.SLAVE) != 0)   // Slaves do the logging.
  if ((this.getDatabaseType() & DBConstants.DONT_LOG_TRX) == 0)

代码示例来源:origin: org.jbundle.base.db/org.jbundle.base.db

if ((this.getMasterSlave() & RecordOwner.MASTER) != 0)   // Slaves don't need this helper class.
  if (this.getTable().getDatabase().getDatabaseOwner().getEnvironment() != null)
  if ((DBConstants.YES.equalsIgnoreCase(this.getTable().getDatabase().getDatabaseOwner().getEnvironment().getProperty(DBParams.LOG_TRXS))) || (DBConstants.TRUE.equalsIgnoreCase(this.getTable().getDatabase().getDatabaseOwner().getEnvironment().getProperty(DBParams.LOG_TRXS))))
if ((this.getMasterSlave() & RecordOwner.SLAVE) != 0)   // Slaves do the logging.
  if ((this.getDatabaseType() & DBConstants.DONT_LOG_TRX) == 0)

代码示例来源:origin: org.jbundle.base/org.jbundle.base.mixed

if ((this.getMasterSlave() & RecordOwner.MASTER) != 0)   // Slaves don't need this helper class.
  if (this.getTable().getDatabase().getDatabaseOwner().getEnvironment() != null)
  if ((DBConstants.YES.equalsIgnoreCase(this.getTable().getDatabase().getDatabaseOwner().getEnvironment().getProperty(DBParams.LOG_TRXS))) || (DBConstants.TRUE.equalsIgnoreCase(this.getTable().getDatabase().getDatabaseOwner().getEnvironment().getProperty(DBParams.LOG_TRXS))))
if ((this.getMasterSlave() & RecordOwner.SLAVE) != 0)   // Slaves do the logging.
  if ((this.getDatabaseType() & DBConstants.DONT_LOG_TRX) == 0)

相关文章

微信公众号

最新文章

更多

Record类方法