Пример #1
0
/*
 *          int getStartSource()
 *          {
 *              for( int i = 0; i < m_sources.size(); i++ )
 *              {
 *                  SyncSource src = (SyncSource)m_sources.elementAt(i);
 *                  if ( !src.isEmptyToken() )
 *                      return i;
 *              }
 *
 *              return -1;
 *          }
 */
        void syncOneSource(int i)
        {
            SyncSource src = null;

            //boolean bError = false;
            try{
                src = (SyncSource)m_sources.elementAt(i);
                if (src.getSyncType().compareTo("bulk_sync_only") == 0)
                {
                    return;
                }

                if (isSessionExist() && getState() != esStop)
                {
                    src.sync();
                }

                //getNotify().onSyncSourceEnd(i, m_sources);
            }catch (Exception exc)
            {
                if (src.m_nErrCode == RhoAppAdapter.ERR_NONE)
                {
                    src.m_nErrCode = RhoAppAdapter.ERR_RUNTIME;
                }

                //setState(esStop);
                //throw exc;
                LOG.ERROR("Sync of source '" + src.getName() + "' failed.", exc);
            }finally{
                getNotify().onSyncSourceEnd(i, m_sources);
                //bError = src.m_nErrCode != RhoAppAdapter.ERR_NONE;
            }

            //return !bError;
        }