IdentifiableFactoryFinder.java revision 608:7e06bf1dcb09
10SN/A/*
21033Sclanger * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
30SN/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
40SN/A *
51033Sclanger * This code is free software; you can redistribute it and/or modify it
61033Sclanger * under the terms of the GNU General Public License version 2 only, as
71033Sclanger * published by the Free Software Foundation.  Oracle designates this
81033Sclanger * particular file as subject to the "Classpath" exception as provided
91033Sclanger * by Oracle in the LICENSE file that accompanied this code.
101033Sclanger *
110SN/A * This code is distributed in the hope that it will be useful, but WITHOUT
120SN/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
130SN/A * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
140SN/A * version 2 for more details (a copy is included in the LICENSE file that
150SN/A * accompanied this code).
160SN/A *
170SN/A * You should have received a copy of the GNU General Public License version
180SN/A * 2 along with this work; if not, write to the Free Software Foundation,
190SN/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
201033Sclanger *
210SN/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
220SN/A * or visit www.oracle.com if you need additional information or have any
23599SN/A * questions.
240SN/A */
250SN/A
260SN/Apackage com.sun.corba.se.spi.ior;
270SN/A
280SN/Aimport org.omg.CORBA_2_3.portable.InputStream ;
290SN/A
300SN/A/** Interface used to manage a group of related IdentifiableFactory instances.
310SN/A * Factories can be registered, and invoked through a create method, which
320SN/A * must be implemented to handle the case of no registered factory
330SN/A * appropriately.
340SN/A * @author Ken Cavanaugh
350SN/A */
360SN/Apublic interface IdentifiableFactoryFinder
370SN/A{
380SN/A    /** If there is a registered factory for id, use it to
391033Sclanger     * read an Identifiable from is.  Otherwise create an
401033Sclanger     * appropriate generic container, or throw an error.
410SN/A     * The type of generic container, or error behavior is
421033Sclanger     * a property of the implementation.
430SN/A     */
440SN/A    Identifiable create(int id, InputStream is);
450SN/A
460SN/A    /** Register a factory for the given id.
471033Sclanger     */
481033Sclanger    void registerFactory( IdentifiableFactory factory ) ;
490SN/A}
500SN/A