001 /*
002 * jDTAUS - DTAUS fileformat.
003 * Copyright (c) 2005 Christian Schulte <cs@schulte.it>
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either
008 * version 2.1 of the License, or any later version.
009 *
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013 * Lesser General Public License for more details.
014 *
015 * You should have received a copy of the GNU Lesser General Public
016 * License along with this library; if not, write to the Free Software
017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
018 *
019 */
020 package org.jdtaus.core.container;
021
022 /**
023 * Context initialization.
024 * <p>By implementing this interface implementations indicate that state may be
025 * bound to the callee's context.</p>
026 *
027 * @author <a href="mailto:cs@schulte.it">Christian Schulte</a>
028 * @version $Id: ContextInitializer.java 1914 2007-03-01 02:20:44Z schulte2005 $
029 */
030 public interface ContextInitializer
031 {
032
033 /**
034 * Checks if a context is initialized.
035 *
036 * @param ctx the context to check.
037 *
038 * @return {@code true} if {@code ctx} is initialized; {@code false} if not.
039 *
040 * @throws NullPointerException if {@code ctx} is {@code null}.
041 * @throws ContextError for unrecoverable context errors.
042 */
043 boolean isInitialized(Context ctx);
044
045 /**
046 * Initializes a context.
047 *
048 * @param ctx the context to initialze.
049 *
050 * @throws NullPointerException if {@code ctx} is {@code null}.
051 * @throws ContextError for unrecoverable context errors.
052 */
053 void initialize(Context ctx);
054
055 }