blob: e310439a97eb2485fb5d4edc9b8370004bb2c28a [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 org.apache.reef.wake;
import java.lang.reflect.InvocationTargetException;
/**
* MultiObserver interface definition whose implementation allows the
* a single java class to be the recipient of multiple events by simply
* defining the methods to handle those events.
*/
public interface MultiObserver {
/**
* Generic event onNext method in the base interface which maps the call to a concrete
* event onNext method in TSubCls if one exists otherwise unimplemented is invoked.
* @param event An event of type TEvent which will be sent to TSubCls as appropriate.
* @param <TEvent> The type of the event being processed.
*/
<TEvent> void onNext(long identifier, TEvent event) throws IllegalAccessException, InvocationTargetException;
}