
org.refcodes.eventbus.impls.EventBusObservableImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of refcodes-eventbus Show documentation
Show all versions of refcodes-eventbus Show documentation
Artifact providing observer pattern based event-bus functionality.
package org.refcodes.eventbus.impls;
import org.refcodes.component.UnknownHandleRuntimeException;
import org.refcodes.eventbus.EventBusObservable;
import org.refcodes.observer.Event;
import org.refcodes.observer.EventMatcher;
import org.refcodes.observer.Observer;
/**
* This delegate hides any additional functionality away from a caller
* concerning the the provides implementation.
*
* @author steiner
*
* @param The event type
* @param The event listener descriptor type
* @param The handle type
*/
public class EventBusObservableImpl, O extends Observer, EM extends EventMatcher, H> implements EventBusObservable {
private EventBusObservable _eventBusObserver;
/**
* Constructs a delegate for a subscribe event bus.
*
* @param aSubscribeEventBus The publish event bus to hide away.
*/
public EventBusObservableImpl( EventBusObservable aSubscribeEventBus ) {
_eventBusObserver = aSubscribeEventBus;
}
@Override
public H subscribe( O aObserver, EM aEventMatcher ) {
return _eventBusObserver.subscribe( aObserver, aEventMatcher );
}
@Override
public void unsubscribeAll( O aEventListener ) {
_eventBusObserver.unsubscribeAll( aEventListener );
}
@Override
public boolean hasHandle( H aHandle ) {
return _eventBusObserver.hasHandle( aHandle );
}
@Override
public O lookupHandle( H aHandle ) throws UnknownHandleRuntimeException {
return _eventBusObserver.lookupHandle( aHandle );
}
@Override
public O removeHandle( H aHandle ) throws UnknownHandleRuntimeException {
return _eventBusObserver.removeHandle( aHandle );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy