001 // SECTION-START[License Header]
002 // <editor-fold defaultstate="collapsed" desc=" Generated License ">
003 /*
004 * Copyright (c) 2009 The JOMC Project
005 * Copyright (c) 2005 Christian Schulte <cs@jomc.org>
006 * All rights reserved.
007 *
008 * Redistribution and use in source and binary forms, with or without
009 * modification, are permitted provided that the following conditions
010 * are met:
011 *
012 * o Redistributions of source code must retain the above copyright
013 * notice, this list of conditions and the following disclaimer.
014 *
015 * o Redistributions in binary form must reproduce the above copyright
016 * notice, this list of conditions and the following disclaimer in
017 * the documentation and/or other materials provided with the
018 * distribution.
019 *
020 * THIS SOFTWARE IS PROVIDED BY THE JOMC PROJECT AND CONTRIBUTORS "AS IS"
021 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
022 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
023 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JOMC PROJECT OR
024 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
025 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
026 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
027 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
028 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
029 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
030 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
031 *
032 * $Id: Listener.java 968 2009-11-18 06:08:28Z schulte2005 $
033 *
034 */
035 // </editor-fold>
036 // SECTION-END
037 package org.jomc.spi;
038
039 import java.util.logging.Level;
040
041 // SECTION-START[Documentation]
042 // <editor-fold defaultstate="collapsed" desc=" Generated Documentation ">
043 /**
044 * Object management and configuration listener interface.
045 * <p>This specification declares a multiplicity of {@code Many}.
046 * An application assembler may provide multiple implementations of this specification (including none).
047 * Use of class {@link org.jomc.ObjectManager ObjectManager} is supported for getting these implementations or for
048 * selecting a single implementation.<pre>
049 * Listener[] objects = (Listener[]) ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( Listener.class );
050 * Listener object = ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( Listener.class, "<i>implementation name</i>" );
051 * </pre>
052 * </p>
053 *
054 * <p>This specification does not apply to any scope. A new object is returned whenever requested.</p>
055 *
056 * @author <a href="mailto:cs@jomc.org">Christian Schulte</a> 1.0
057 * @version $Id: Listener.java 968 2009-11-18 06:08:28Z schulte2005 $
058 */
059 // </editor-fold>
060 // SECTION-END
061 // SECTION-START[Annotations]
062 // <editor-fold defaultstate="collapsed" desc=" Generated Annotations ">
063 @javax.annotation.Generated( value = "org.jomc.tools.JavaSources",
064 comments = "See http://jomc.sourceforge.net/jomc/1.0-alpha-8/jomc-tools" )
065 // </editor-fold>
066 // SECTION-END
067 public interface Listener
068 {
069 // SECTION-START[ObjectManagementListener]
070
071 /**
072 * Get called on logging.
073 *
074 * @param level The level of the event.
075 * @param message The message of the event or {@code null}.
076 * @param throwable The throwable of the event or {@code null}.
077 *
078 * @throws NullPointerException if {@code level} is {@code null}.
079 */
080 void onLog( Level level, String message, Throwable throwable ) throws NullPointerException;
081
082 // SECTION-END
083 }