Android Open Source - BusWear Throwable Failure Event






From Project

Back to project page BusWear.

License

The source code is released under:

Apache License

If you think the Android project BusWear listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2012 Markus Junginger, greenrobot (http://greenrobot.de)
 */* w w  w  .j a v a2s. co m*/
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package pl.tajchert.buswear.util;

/**
 * A generic failure event, which can be used by apps to propagate thrown exceptions. Also used in conjunction with
 * {@link ErrorDialogManager}.
 */
public class ThrowableFailureEvent implements HasExecutionScope {
    protected final Throwable throwable;
    protected final boolean suppressErrorUi;
    private Object executionContext;

    public ThrowableFailureEvent(Throwable throwable) {
        this.throwable = throwable;
        suppressErrorUi = false;
    }

    /**
     * @param suppressErrorUi
     *            true indicates to the receiver that no error UI (e.g. dialog) should now displayed.
     */
    public ThrowableFailureEvent(Throwable throwable, boolean suppressErrorUi) {
        this.throwable = throwable;
        this.suppressErrorUi = suppressErrorUi;
    }

    public Throwable getThrowable() {
        return throwable;
    }

    public boolean isSuppressErrorUi() {
        return suppressErrorUi;
    }

    public Object getExecutionScope() {
        return executionContext;
    }

    public void setExecutionScope(Object executionContext) {
        this.executionContext = executionContext;
    }
    
}




Java Source Code List

pl.tajchert.buswear.AsyncPoster.java
pl.tajchert.buswear.BackgroundPoster.java
pl.tajchert.buswear.EventBusBuilder.java
pl.tajchert.buswear.EventBusException.java
pl.tajchert.buswear.EventBus.java
pl.tajchert.buswear.HandlerPoster.java
pl.tajchert.buswear.NoSubscriberEvent.java
pl.tajchert.buswear.PendingPostQueue.java
pl.tajchert.buswear.PendingPost.java
pl.tajchert.buswear.SubscriberExceptionEvent.java
pl.tajchert.buswear.SubscriberMethodFinder.java
pl.tajchert.buswear.SubscriberMethod.java
pl.tajchert.buswear.Subscription.java
pl.tajchert.buswear.ThreadMode.java
pl.tajchert.buswear.sample.CustomObject.java
pl.tajchert.buswear.sample.CustomObject.java
pl.tajchert.buswear.sample.MainMobileActivity.java
pl.tajchert.buswear.sample.MainWearActivity.java
pl.tajchert.buswear.util.AsyncExecutor.java
pl.tajchert.buswear.util.ErrorDialogConfig.java
pl.tajchert.buswear.util.ErrorDialogFragmentFactory.java
pl.tajchert.buswear.util.ErrorDialogFragments.java
pl.tajchert.buswear.util.ErrorDialogManager.java
pl.tajchert.buswear.util.ExceptionToResourceMapping.java
pl.tajchert.buswear.util.HasExecutionScope.java
pl.tajchert.buswear.util.ThrowableFailureEvent.java
pl.tajchert.buswear.wear.EventCatcher.java
pl.tajchert.buswear.wear.SendByteArrayToNode.java
pl.tajchert.buswear.wear.SendCommandToNode.java
pl.tajchert.buswear.wear.SendWearManager.java
pl.tajchert.buswear.wear.WearBusTools.java