当前位置: 首页>>代码示例>>Java>>正文


Java FileDownloadLog.d方法代码示例

本文整理汇总了Java中com.liulishuo.filedownloader.util.FileDownloadLog.d方法的典型用法代码示例。如果您正苦于以下问题:Java FileDownloadLog.d方法的具体用法?Java FileDownloadLog.d怎么用?Java FileDownloadLog.d使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liulishuo.filedownloader.util.FileDownloadLog的用法示例。


在下文中一共展示了FileDownloadLog.d方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onStatusChanged

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
private void onStatusChanged(final byte status) {
    // In current situation, it maybe invoke this method simultaneously between #onPause() and
    // others.
    if (model.getStatus() == FileDownloadStatus.paused) {
        if (FileDownloadLog.NEED_LOG) {
            /**
             * Already paused or the current status is paused.
             *
             * We don't need to call-back to Task in here, because the pause status has
             * already handled by {@link BaseDownloadTask#pause()} manually.
             *
             * In some case, it will arrive here by High concurrent cause.  For performance
             * more make sense.
             *
             * High concurrent cause.
             */
            FileDownloadLog.d(this, "High concurrent cause, Already paused and we don't " +
                    "need to call-back to Task in here, %d", model.getId());
        }
        return;
    }

    MessageSnapshotFlow.getImpl().inflow(MessageSnapshotTaker.take(status, model, processParams));
}
 
开发者ID:yannanzheng,项目名称:FileDownloader-master,代码行数:25,代码来源:DownloadStatusCallback.java

示例2: connect

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
FileDownloadConnection connect() throws IOException, IllegalAccessException {
    FileDownloadConnection connection = CustomComponentHolder.getImpl().createConnection(url);

    addUserRequiredHeader(connection);
    addRangeHeader(connection);

    // init request
    // get the request header in here, because of there are many connection
    // component(such as HttpsURLConnectionImpl, HttpURLConnectionImpl in okhttp3) don't
    // allow access to the request header after it connected.
    requestHeader = connection.getRequestHeaderFields();
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "%s request header %s", downloadId, requestHeader);
    }

    connection.execute();
    redirectedUrlList = new ArrayList<>();
    connection = RedirectHandler.process(requestHeader, connection, redirectedUrlList);

    return connection;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:22,代码来源:ConnectTask.java

示例3: publish

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public boolean publish(final IDownloadEvent event) {
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.v(this, "publish %s", event.getId());
    }
    Assert.assertNotNull("EventPoolImpl.publish", event);
    String eventId = event.getId();
    LinkedList<IDownloadListener> listeners = listenersMap.get(eventId);
    if (listeners == null) {
        synchronized (eventId.intern()) {
            listeners = listenersMap.get(eventId);
            if (listeners == null) {
                if (FileDownloadLog.NEED_LOG) {
                    FileDownloadLog.d(this, "No listener for this event %s", eventId);
                }
                return false;
            }
        }
    }

    trigger(listeners, event);
    return true;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:24,代码来源:DownloadEventPoolImpl.java

示例4: dispatchTaskStart

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public boolean dispatchTaskStart(BaseDownloadTask.IRunningTask task) {
    if (!FileDownloader.getImpl().isServiceConnected()) {
        synchronized (mWaitingList) {
            if (!FileDownloader.getImpl().isServiceConnected()) {
                if (FileDownloadLog.NEED_LOG) {
                    FileDownloadLog.d(this, "Waiting for connecting with the downloader " +
                            "service... %d", task.getOrigin().getId());
                }
                FileDownloadServiceProxy.getImpl().
                        bindStartByContext(FileDownloadHelper.getAppContext());
                if (!mWaitingList.contains(task)) {
                    task.free();
                    mWaitingList.add(task);
                }
                return true;
            }
        }
    }

    taskWorkFine(task);

    return false;
}
 
开发者ID:yannanzheng,项目名称:FileDownloader-master,代码行数:25,代码来源:LostServiceConnectedHandler.java

示例5: cancel

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
public void cancel(final int id) {
    filterOutNoExist();
    synchronized (this) {
        DownloadLaunchRunnable r = runnablePool.get(id);
        if (r != null) {
            r.pause();
            boolean result = mThreadPool.remove(r);
            if (FileDownloadLog.NEED_LOG) {
                // If {@code result} is false, must be: the Runnable has been running before
                // invoke this method.
                FileDownloadLog.d(this, "successful cancel %d %B", id, result);
            }
        }
        runnablePool.remove(id);
    }
}
 
开发者ID:yannanzheng,项目名称:FileDownloader-master,代码行数:17,代码来源:FileDownloadThreadPool.java

示例6: releaseConnect

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
private void releaseConnect(final boolean isLost) {
    if (!isLost && this.service != null) {
        try {
            unregisterCallback(this.service, this.callback);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "release connect resources %s", this.service);
    }
    this.service = null;

    FileDownloadEventPool.getImpl().
            asyncPublishInNewThread(new DownloadServiceConnectChangedEvent(
                    isLost ? DownloadServiceConnectChangedEvent.ConnectStatus.lost :
                            DownloadServiceConnectChangedEvent.ConnectStatus.disconnected,
                    serviceClass));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:BaseFileServiceUIGuard.java

示例7: notifyError

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public void notifyError(MessageSnapshot snapshot) {
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "notify error %s %s", mTask, mTask.getOrigin().getErrorCause());
    }

    mLifeCycleCallback.onOver();

    process(snapshot);
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:11,代码来源:FileDownloadMessenger.java

示例8: sync

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
private void sync() {
    final long startTimestamp = SystemClock.uptimeMillis();

    boolean bufferPersistToDevice;
    try {
        outputStream.flushAndSync();
        bufferPersistToDevice = true;
    } catch (IOException e) {
        bufferPersistToDevice = false;
        if (FileDownloadLog.NEED_LOG) {
            FileDownloadLog.d(this, "Because of the system cannot guarantee that all " +
                    "the buffers have been synchronized with physical media, or write to file " +
                    "failed, we just not flushAndSync process to database too %s", e);
        }
    }

    if (bufferPersistToDevice) {
        final boolean isBelongMultiConnection = hostRunnable != null;
        if (isBelongMultiConnection) {
            // only need update the connection table.
            database.updateConnectionModel(downloadId, connectionIndex, currentOffset);
        } else {
            // only need update the filedownloader table.
            callback.syncProgressFromCache();
        }

        if (FileDownloadLog.NEED_LOG) {
            FileDownloadLog.d(this, "require flushAndSync id[%d] index[%d] offset[%d], consume[%d]",
                    downloadId, connectionIndex, currentOffset, SystemClock.uptimeMillis() - startTimestamp);
        }
    }
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:33,代码来源:FetchDataTask.java

示例9: notifyPaused

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public void notifyPaused(MessageSnapshot snapshot) {
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "notify paused %s", mTask);
    }

    mLifeCycleCallback.onOver();

    process(snapshot);
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:11,代码来源:FileDownloadMessenger.java

示例10: notifyStarted

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public void notifyStarted(MessageSnapshot snapshot) {
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "notify started %s", mTask);
    }

    mLifeCycleCallback.onIng();

    process(snapshot);
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:11,代码来源:FileDownloadMessenger.java

示例11: updateKeepFlow

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public boolean updateKeepFlow(MessageSnapshot snapshot) {
    final int currentStatus = getStatus();
    final int nextStatus = snapshot.getStatus();

    if (FileDownloadStatus.paused == currentStatus && FileDownloadStatus.isIng(nextStatus)) {
        if (FileDownloadLog.NEED_LOG) {
            /**
             * Occur such situation, must be the running-mStatus waiting for turning up in flow
             * thread pool(or binder thread) when there is someone invoked the {@link #pause()} .
             *
             * High concurrent cause.
             */
            FileDownloadLog.d(this, "High concurrent cause, callback pending, but has already" +
                    " be paused %d", getId());
        }
        return true;
    }

    if (!FileDownloadStatus.isKeepFlow(currentStatus, nextStatus)) {
        if (FileDownloadLog.NEED_LOG) {
            FileDownloadLog.d(this, "can't update mStatus change by keep flow, %d, but the" +
                    " current mStatus is %d, %d", mStatus, getStatus(), getId());
        }

        return false;
    }

    update(snapshot);
    return true;
}
 
开发者ID:yannanzheng,项目名称:FileDownloader-master,代码行数:32,代码来源:DownloadTaskHunter.java

示例12: free

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public void free() {
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "free the task %d, when the status is %d", getId(), mStatus);
    }
    mStatus = FileDownloadStatus.INVALID_STATUS;
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:8,代码来源:DownloadTaskHunter.java

示例13: notifyCompleted

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public void notifyCompleted(MessageSnapshot snapshot) {
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "notify completed %s", mTask);
    }

    mLifeCycleCallback.onOver();

    process(snapshot);
}
 
开发者ID:yannanzheng,项目名称:FileDownloader-master,代码行数:11,代码来源:FileDownloadMessenger.java

示例14: setListener

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
@Override
public BaseDownloadTask setListener(final FileDownloadListener listener) {
    this.mListener = listener;

    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(this, "setListener %s", listener);
    }
    return this;
}
 
开发者ID:yannanzheng,项目名称:FileDownloader-master,代码行数:10,代码来源:DownloadTask.java

示例15: init

import com.liulishuo.filedownloader.util.FileDownloadLog; //导入方法依赖的package包/类
/**
 * @deprecated please using {@link #setupOnApplicationOnCreate(Application)} instead.
 */
public static void init(final Context context,
                        final DownloadMgrInitialParams.InitCustomMaker maker) {
    if (FileDownloadLog.NEED_LOG) {
        FileDownloadLog.d(FileDownloader.class, "init Downloader with params: %s %s",
                context, maker);
    }

    if (context == null)
        throw new IllegalArgumentException("the provided context must not be null!");

    FileDownloadHelper.holdContext(context.getApplicationContext());

    CustomComponentHolder.getImpl().setInitCustomMaker(maker);
}
 
开发者ID:angcyo,项目名称:RLibrary,代码行数:18,代码来源:FileDownloader.java


注:本文中的com.liulishuo.filedownloader.util.FileDownloadLog.d方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。