fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee/*
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * CDDL HEADER START
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee *
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * The contents of this file are subject to the terms of the
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Common Development and Distribution License (the "License").
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * You may not use this file except in compliance with the License.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee *
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * or http://www.opensolaris.org/os/licensing.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * See the License for the specific language governing permissions
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * and limitations under the License.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee *
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * When distributing Covered Code, include this CDDL HEADER in each
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * If applicable, add the following below this CDDL HEADER, with the
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * fields enclosed by brackets "[]" replaced with your own identifying
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * information: Portions Copyright [yyyy] [name of copyright owner]
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee *
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * CDDL HEADER END
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee/*
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Use is subject to license terms.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee *
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * ident "%Z%%M% %I% %E% SMI"
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomeepackage org.opensolaris.os.dtrace;
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee/**
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * An abstract adapter class for getting events from a {@link Consumer}.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * The methods in this class are empty except for a few that implement
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * the default behavior of terminating a consumer by throwing an
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * exception. This class exists as a convenience for implementing
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * consumer listeners.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee *
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @see Consumer#addConsumerListener(ConsumerListener l)
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee *
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @author Tom Erickson
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomeepublic abstract class ConsumerAdapter implements ConsumerListener {
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** Empty method */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public void dataReceived(DataEvent e) throws ConsumerException {}
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /**
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Terminates a running {@link Consumer} by throwing an exception.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee *
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @throws ConsumerException
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public void
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee dataDropped(DropEvent e) throws ConsumerException
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee {
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee Drop drop = e.getDrop();
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee throw new ConsumerException(drop.getDefaultMessage(), drop);
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee }
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /**
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * Terminates a running {@link Consumer} by throwing an exception.
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee *
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee * @throws ConsumerException
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public void
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee errorEncountered(ErrorEvent e) throws ConsumerException
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee {
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee Error error = e.getError();
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee throw new ConsumerException(error.getDefaultMessage(), error);
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee }
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** Empty method */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public void processStateChanged(ProcessEvent e) throws ConsumerException {}
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** Empty method */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public void consumerStarted(ConsumerEvent e) {}
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** Empty method */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public void consumerStopped(ConsumerEvent e) {}
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** Empty method */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public void intervalBegan(ConsumerEvent e) {}
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee /** Empty method */
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee public void intervalEnded(ConsumerEvent e) {}
fb3fb4f3d76d55b64440afd0af72775dfad3bd1dtomee}