net.engio.mbassy.bus.error.PublicationError Java Examples

The following examples show how to use net.engio.mbassy.bus.error.PublicationError. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Slf4jLogger.java    From docx4j-template with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void handleError(final PublicationError error) {

    // Logger the error itself
 logger.error(error.toString());
    
    // Logger the stacktrace from the cause.
    if (printStackTrace && error.getCause() != null) {
   	 logger.error(error.getCause().getMessage());
    }
}
 
Example #2
Source File: MatchOne.java    From Entitas-Java with MIT License 4 votes vote down vote up
@Override
    public void create() {
        AssetManager assetsManager = new AssetManager(new TestFileHandleResolver());
        BasePreferencesManager preferencesManager = new BasePreferencesManager();
        MatchOneEngine engine = new MatchOneEngine();
        engine.addManager(new BaseAssetsManager(assetsManager, preferencesManager));
//        new Collections(new CollectionsFactory() {
//            @Override
//            public <T> List<T> createList(Class<T> clazz) {
//                if (clazz.equals(Integer.class))
//                    return (List<T>) new IntArrayList();
//                else
//                    return new ObjectArrayList();
//            }
//
//            @Override
//            public <T> Set createSet(Class<T> clazz) {
//                if (clazz.equals(Integer.class))
//                    return new IntArraySet();
//                else
//                    return new ObjectOpenHashSet();
//        }
//
//            @Override
//            public <K, V> Map createMap(Class<K> keyClazz, Class<V> valueClazz) {
//                return new Object2ObjectArrayMap();
//            }
//
//
//        });

        new EntitasCollections(new CollectionsFactories(){});

        MBassador bus = new MBassador(new IPublicationErrorHandler() {
            @Override
            public void handleError(PublicationError error) {
                Gdx.app.error("EBUS ERROR: ", error.toString());
            }
        });


        game = new MatchOneGame(engine, new EGEventBus(bus));
        game.init();
        game.pushState(new MatchOneState(engine));
    }
 
Example #3
Source File: MBassadorConfigurationUnitTest.java    From tutorials with MIT License 4 votes vote down vote up
@Override
public void handleError(PublicationError error) {
    errorCause = error.getCause().getCause();
}