diff options
Diffstat (limited to 'libjava/classpath/org/omg/PortableServer')
85 files changed, 9149 insertions, 0 deletions
diff --git a/libjava/classpath/org/omg/PortableServer/AdapterActivator.java b/libjava/classpath/org/omg/PortableServer/AdapterActivator.java new file mode 100644 index 000000000..278f39207 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/AdapterActivator.java @@ -0,0 +1,62 @@ +/* AdapterActivator.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * Adapter activators are associated with POAs and supply the + * the ability to create child POAs on demand. The new POA can be created + * <ul> + * <li>As a side-effect of receiving a request that names the child POA + * (or one of its children).</li> + * <li>When calling + * {@link POAOperations}.find_POA(name, true) if the parameter + * <code>name</code> refers a non existing POA. + * </li></ul> + * An AdapterActivator is always a local object. + * + * @see AdapterActivatorOperations#unknown_adapter + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface AdapterActivator + extends AdapterActivatorOperations, IDLEntity, org.omg.CORBA.Object +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/AdapterActivatorOperations.java b/libjava/classpath/org/omg/PortableServer/AdapterActivatorOperations.java new file mode 100644 index 000000000..f2065252d --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/AdapterActivatorOperations.java @@ -0,0 +1,68 @@ +/* AdapterActivatorOperations.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.OBJECT_NOT_EXIST; + + +/** + * Defines the operations, applicable to the AdapterActivator. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface AdapterActivatorOperations +{ + /** + * This method is invoked when the ORB receives a request for an object + * reference that identifies a non-existing target POA, to create it. + * The ORB invokes this operation once for each POA that must be created + * in order for the target POA to exist. The process remebers creating a + * nested folder structure, starting from the ancestor POA closest to the + * root POA. The operation is invoked on the adapter activator of + * POA that is the parent of the POA that needs to be created. + * + * @param parent the parent POA, for that the child POA must be created. + * @param child_name the name of the child POA that must be created. + * + * @return true if the operation has successfully created the needed POA, + * false that POA cannot be created. In this case, the client will receive + * the remote exception ({@link OBJECT_NOT_EXIST}, minor code 2). + */ + boolean unknown_adapter(POA parent, String child_name); +} diff --git a/libjava/classpath/org/omg/PortableServer/Current.java b/libjava/classpath/org/omg/PortableServer/Current.java new file mode 100644 index 000000000..7bce10e04 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/Current.java @@ -0,0 +1,63 @@ +/* Current.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * <p>Provides the Id of the object currently being served and POA + * to that this object is connected. Both Id and POA can be + * simpler obtained from the servant by {@link Servant#_object_id() } + * and {@link Servant#_poa()} that use POA Current indirectly. + * The operations on Current for obtaining + * these data are defined in {@link CurrentOperations}. + * </p><p> + * As long as the ORB reference is still available, the current information + * is available via {@link Current} that is returned by + * ORB.resolve_initial_references("POACurrent"). To support this call, + * the ORB maintains the thread to invocation data map for all calls that + * are currently being processed. + * </p> + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface Current + extends CurrentOperations, org.omg.CORBA.Current, IDLEntity +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/CurrentHelper.java b/libjava/classpath/org/omg/PortableServer/CurrentHelper.java new file mode 100644 index 000000000..a81e839d0 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/CurrentHelper.java @@ -0,0 +1,144 @@ +/* CurrentHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the +* CORBA object {@link Current}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class CurrentHelper +{ + /** + * Get the type code of the POA Current. + * + * @return a type code of the object with POA Current id, named "Current". + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_interface_tc(id(), "Current"); + } + + /** + * Insert the POA Current into the given Any. + * + * @param any the Any to insert into. + * @param that the POA Current to insert. + */ + public static void insert(Any any, Current that) + { + any.insert_Object(that); + } + + /** + * Extract the POA Current from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain a POA Current. + */ + public static Current extract(Any any) + { + return narrow(any.extract_Object()); + } + + /** + * Get the POA Current repository id. + * + * @return "IDL:omg.org/PortableServer/Current:2.3", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/Current:2.3"; + } + + /** + * Cast the passed object into the POA Current. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a Current. + */ + public static Current narrow(org.omg.CORBA.Object obj) + { + try + { + return (Current) obj; + } + catch (ClassCastException ex) + { + BAD_PARAM bad = new BAD_PARAM("Not a POA Current"); + bad.initCause(ex); + throw bad; + } + } + + /** + * Not supported for compatibility reasons. + * + * @specnote Not supported by Sun at least till jdk 1.4 inclusive. + * + * @throws NO_IMPLEMENT always. + */ + public static Current read(InputStream input) + { + throw new NO_IMPLEMENT(); + } + + /** + * Not supported for compatibility reasons. + * + * @specnote Not supported by Sun at least till jdk 1.4 inclusive. + * + * @throws NO_IMPLEMENT always. + */ + public static void write(OutputStream output, Current value) + { + throw new NO_IMPLEMENT(); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/CurrentOperations.java b/libjava/classpath/org/omg/PortableServer/CurrentOperations.java new file mode 100644 index 000000000..58bc3141d --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/CurrentOperations.java @@ -0,0 +1,81 @@ +/* CurrentOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.PortableServer.CurrentPackage.NoContext; + +/** + * Provides the Id of the object currently being served and POA + * to that this object is connected. Both Id and POA can be much + * simpler obtained from the servant by {@link Servant#_object_id() } + * and {@link Servant#_poa()} that use the CurrentOperations indirectly. + * + * As long as the ORB reference is still available, the current information + * is available via {@link Current} that is returned by + * ORB.resolve_initial_references("POACurrent"). To support this call, + * the ORB maintains the thread to invocation data map for all calls that + * are currently being processed. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface CurrentOperations + extends org.omg.CORBA.CurrentOperations +{ + /** + * Returns the Id of the object currently being served. The returned + * value is also correct if the calling code is running is several + * paralled threads. + * + * @return the Id of the object that is currently being served by this + * thread. + */ + byte[] get_object_id() + throws NoContext; + + /** + * Returns POA to that the object currently being served is connected. + * The returned value is also correct if the calling code is running is several + * paralled threads. + * + * @return the Id of the object that is currently being served by this + * thread. + */ + POA get_POA() + throws NoContext; +} diff --git a/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContext.java b/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContext.java new file mode 100644 index 000000000..9d42174bf --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContext.java @@ -0,0 +1,82 @@ +/* NoContext.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.CurrentPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** +* This exception may be thrown by methods in +* {@link org.omg.PortableServer.CurrentOperations} +* if they are invoked outside the context of a POA-dispatched operation. +* +* @see org.omg.PortableServer.CurrentOperations#get_POA() +* @see org.omg.PortableServer.CurrentOperations#get_object_id() +* +* @author Audrius Meskauskas, Lithiania (AudriusA@Bioinformatics.org) +*/ +public final class NoContext + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 4345975812295650198L; + + /** + * Create NoContext with no explaining message and all fields initialised to + * default values. + */ + public NoContext() + { + } + + /** + * Create the NoContext with explaining message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public NoContext(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java b/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java new file mode 100644 index 000000000..2aa9268ae --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/CurrentPackage/NoContextHelper.java @@ -0,0 +1,143 @@ +/* NoContextHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.CurrentPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the exception {@link NoContext}. +* +* @author Audrius Meskauskas, Lithiania (AudriusA@Bioinformatics.org) +*/ +public abstract class NoContextHelper +{ + /** + * Create the NoContext typecode (structure, named "NoContext"). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[0]; + return orb.create_exception_tc(id(), "NoContext", members); + } + + /* + * Every user exception with no user defined fields can use + * EmptyExceptionHolder + */ + + /** + * Insert the NoContext into the given Any. + * + * @param any the Any to insert into. + * @param that the NoContext to insert. + */ + public static void insert(Any any, NoContext that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the NoContext from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain NoContext. + */ + public static NoContext extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (NoContext) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("NoContext expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the NoContext repository id. + * + * @return "IDL:omg.org/PortableServer/Current/NoContext:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/Current/NoContext:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static NoContext read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + NoContext value = new NoContext(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, NoContext value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/DynamicImplementation.java b/libjava/classpath/org/omg/PortableServer/DynamicImplementation.java new file mode 100644 index 000000000..f43fbf921 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/DynamicImplementation.java @@ -0,0 +1,58 @@ +/* DynamicImplementation.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.ServerRequest; + +/** + * This class is used for servants that support calling via server request. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class DynamicImplementation + extends Servant +{ + /** + * Handle the invocation via passed request. + * + * @param request the data structure, used both to pass parameters + * and return results of the invocation. + */ + public abstract void invoke(ServerRequest request); +} diff --git a/libjava/classpath/org/omg/PortableServer/ForwardRequest.java b/libjava/classpath/org/omg/PortableServer/ForwardRequest.java new file mode 100644 index 000000000..c9d20b345 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ForwardRequest.java @@ -0,0 +1,108 @@ +/* ForwardRequest.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * <p> + * This exception is raised by {@link ServantManager} to indicate that the + * invocation target has moved to another known location. In this case, + * the client will receive a redirection (LOCATION_FORWARD) message and should + * resend the request to the new target. The exception contains the object + * reference, indicating the new location. + * </p><p> + * The exception can be thrown both by servant locators and servant activators. + * If the exception is raised anywhere else than in the ServantManager + * methods, it is handled as an ordinary user excepton. + * </p> + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public final class ForwardRequest + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -4159318367582473975L; + + /** + * The object reference, indicating the new location of the invocation target. + */ + public org.omg.CORBA.Object forward_reference; + + /** + * Create ForwardRequest with no explaining message and stating the + * new location is <code>null</code>. + */ + public ForwardRequest() + { + } + + /** + * Create the ForwardRequest with explaining message and + * initialising the object reference to the given value. + * + * @param why a string, explaining, why this exception has been thrown. + * @param a_forward_reference a value for forward_reference. + */ + public ForwardRequest(String why, org.omg.CORBA.Object a_forward_reference) + { + super(why); + this.forward_reference = a_forward_reference; + } + + /** + * Create the ForwardRequest without explaining + * message and initialising the object reference to the given value. + * + * @param a_forward_reference a value for forward_reference. + */ + public ForwardRequest(org.omg.CORBA.Object a_forward_reference) + { + this.forward_reference = a_forward_reference; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java b/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java new file mode 100644 index 000000000..83e5707c6 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ForwardRequestHelper.java @@ -0,0 +1,154 @@ +/* ForwardRequestHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; +import gnu.CORBA.ObjectCreator; +import gnu.CORBA.OrbRestricted; +import gnu.CORBA.Poa.ForwardRequestHolder; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.ObjectHelper; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link ForwardRequest}. + * + * @specnote The helper must be here and not in POA subpackage as it must + * be discovered by the {@link ObjectCreator} when reading this remote + * exception. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ForwardRequestHelper +{ + /** + * Extract the ForwardRequest from given Any. + * This method uses the ForwardRequestHolder. + * + * @throws BAD_OPERATION if the passed Any does not contain ForwardRequest. + */ + public static ForwardRequest extract(Any any) + { + try + { + return ((ForwardRequestHolder) any.extract_Streamable()).value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("ForwardRequest expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the ForwardRequest repository id. + * + * @return "ForwardRequest", always. + */ + public static String id() + { + return "ForwardRequest"; + } + + /** + * Insert the ForwardRequest into the given Any. + * This method uses the ForwardRequestHolder. + * + * @param any the Any to insert into. + * @param that the ForwardRequest to insert. + */ + public static void insert(Any any, ForwardRequest that) + { + any.insert_Streamable(new ForwardRequestHolder(that)); + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static ForwardRequest read(InputStream input) + { + // Read the exception repository id. + input.read_string(); + ForwardRequest value = new ForwardRequest(); + + value.forward_reference = input.read_Object(); + return value; + } + + /** + * Create the ForwardRequest typecode (structure, + * named "ForwardRequest"). + * The typecode states that the structure contains the + * following fields: forward_reference. + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 1 ]; + + TypeCode field; + + field = ObjectHelper.type(); + members [ 0 ] = new StructMember("forward_reference", field, null); + return orb.create_exception_tc(id(), "ForwardRequest", members); + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, ForwardRequest value) + { + // Write the exception repository id. + output.write_string(id()); + output.write_Object(value.forward_reference); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.java b/libjava/classpath/org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.java new file mode 100644 index 000000000..f70660d76 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.java @@ -0,0 +1,53 @@ +/* ID_ASSIGNMENT_POLICY_ID.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + + +/** +* Holds an integer {@link IdAssignmentPolicy } identifier. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public interface ID_ASSIGNMENT_POLICY_ID +{ + /** + * Specifies the ID_ASSIGNMENT_POLICY_ID value, 19. + */ + int value = 19; +} diff --git a/libjava/classpath/org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.java b/libjava/classpath/org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.java new file mode 100644 index 000000000..f69defcaa --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.java @@ -0,0 +1,53 @@ +/* ID_UNIQUENESS_POLICY_ID.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + + +/** +* Holds an integer {@link IdUniquenessPolicy} identifier. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public interface ID_UNIQUENESS_POLICY_ID +{ + /** + * Specifies the ID_UNIQUENESS_POLICY_ID value, 18. + */ + int value = 18; +} diff --git a/libjava/classpath/org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.java b/libjava/classpath/org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.java new file mode 100644 index 000000000..c76e1801c --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.java @@ -0,0 +1,53 @@ +/* IMPLICIT_ACTIVATION_POLICY_ID.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + + +/** +* Holds an integer {@link ImplicitActivationPolicy} identifier. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public interface IMPLICIT_ACTIVATION_POLICY_ID +{ + /** + * Specifies the IMPLICIT_ACTIVATION_POLICY_ID value, 20. + */ + int value = 20; +} diff --git a/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicy.java b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicy.java new file mode 100644 index 000000000..15ccf4f6e --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicy.java @@ -0,0 +1,58 @@ +/* IdAssignmentPolicy.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.portable.IDLEntity; + +/** + * Specifies the Object Id assignment policy. + * + * The policy can return its current value, as defined. + * in {@link IdAssignmentPolicyOperations}. + * + * @see IdAssignmentPolicyValue for the possible values of this policy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IdAssignmentPolicy + extends Policy, IdAssignmentPolicyOperations, IDLEntity +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyOperations.java new file mode 100644 index 000000000..88c39d73d --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyOperations.java @@ -0,0 +1,55 @@ +/* IdAssignmentPolicyOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.PolicyOperations; + +/** + * Defines the operations, applicable to the IdAssignmentPolicy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IdAssignmentPolicyOperations + extends PolicyOperations +{ + /** + * Return the value of this policy type, stated by the current instance. + */ + IdAssignmentPolicyValue value(); +} diff --git a/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java new file mode 100644 index 000000000..9e52b9889 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/IdAssignmentPolicyValue.java @@ -0,0 +1,158 @@ +/* IdAssignmentPolicyValue.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** +* Specifies the Object Id assignment policy. +* <ul> +* <li>USER_ID Objects created with that POA obtain they Object Ids from the +* application. +* </li> +* <li>SYSTEM_ID Objects created with that POA obtain they Object Ids from POA. +* If the POA also has the PERSISTENT policy, these Object Ids must be +* unique across all instantiations of the same POA. +* </li> +* </ul> +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public class IdAssignmentPolicyValue + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID (V1.4) for interoperability. + */ + private static final long serialVersionUID = 2024380631469554382L; + + /** + * The value field for the current instance. + */ + private final int _value; + + /** + * The possible value of this enumeration (USER_ID). + */ + public static final int _USER_ID = 0; + + /** + * An instance of IdAssignmentPolicyValue, initialized to USER_ID. + */ + public static final IdAssignmentPolicyValue USER_ID = + new IdAssignmentPolicyValue(_USER_ID); + + /** + * The possible value of this enumeration (SYSTEM_ID),. + */ + public static final int _SYSTEM_ID = 1; + + /** + * An instance of IdAssignmentPolicyValue, initialized to SYSTEM_ID, + * indicating, that the objects created with that POA obtain they + * Object Ids from POA. + */ + public static final IdAssignmentPolicyValue SYSTEM_ID = + new IdAssignmentPolicyValue(_SYSTEM_ID); + + /** + * The private array that maps integer codes to the enumeration + * values. + */ + private static final IdAssignmentPolicyValue[] enume = + new IdAssignmentPolicyValue[] { USER_ID, SYSTEM_ID }; + + /** + * The private array of state names. + */ + private static final String[] state_names = + new String[] { "USER_ID", "SYSTEM_ID" }; + + /** + * Normally, no new instances are required, so the constructor is protected. + */ + protected IdAssignmentPolicyValue(int a_value) + { + _value = a_value; + } + + /** + * Returns the IdAssignmentPolicyValue, matching the given integer constant. + * + * @param code one of _USER_ID, _SYSTEM_ID. + * @return one of USER_ID, SYSTEM_ID. + * @throws BAD_PARAM if the parameter is not one of the valid values. + */ + public static IdAssignmentPolicyValue from_int(int code) + { + try + { + return enume [ code ]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; + } + } + + /** + * Returns a short string representation. + * @return the name of the current enumeration value. + */ + public String toString() + { + return state_names [ _value ]; + } + + /** + * Returns the integer code of the policy value. + * @return _USER_ID or _SYSTEM_ID. + */ + public int value() + { + return _value; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicy.java b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicy.java new file mode 100644 index 000000000..ba2894c7c --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicy.java @@ -0,0 +1,57 @@ +/* IdUniquenessPolicy.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.portable.IDLEntity; + +/** + * Specfies the Id uniqueness policy. + * + * The policy can return its current value, as defined. + * in {@link IdUniquenessPolicyOperations}. + * + * @see IdUniquenessPolicyValue for the possible values of this policy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IdUniquenessPolicy + extends Policy, IdUniquenessPolicyOperations, IDLEntity +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyOperations.java new file mode 100644 index 000000000..1295f88f3 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyOperations.java @@ -0,0 +1,55 @@ +/* IdUniquenessPolicyOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.PolicyOperations; + +/** + * Defines the operations, applicable to the IdUniquenessPolicy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface IdUniquenessPolicyOperations + extends PolicyOperations +{ + /** + * Return the value of this policy type, stated by the current instance. + */ + IdUniquenessPolicyValue value(); +} diff --git a/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java new file mode 100644 index 000000000..848671d1d --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/IdUniquenessPolicyValue.java @@ -0,0 +1,158 @@ +/* IdUniquenessPolicyValue.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** +* Specifies the Object Id uniqueness policy. +* +* This enumeration can obtain the following values: +* <ul> +* <li>UNIQUE_ID a servant activated with that POA supports exactly one Object Id. +* </li> +* <li>MULTIPLE_ID a servant activated with that POA supports +* multiple Object Ids. +* </li> +* </ul> +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public class IdUniquenessPolicyValue + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID (V1.4) for interoperability. + */ + private static final long serialVersionUID = 2698951826884611346L; + + /** + * The value field for the current instance. + */ + private final int _value; + + /** + * The possible value of this enumeration (UNIQUE_ID). + */ + public static final int _UNIQUE_ID = 0; + + /** + * Indicates that a servant activated with that POA, supports one and only + * one OBject Id. + */ + public static final IdUniquenessPolicyValue UNIQUE_ID = + new IdUniquenessPolicyValue(_UNIQUE_ID); + + /** + * The possible value of this enumeration (MULTIPLE_ID). + */ + public static final int _MULTIPLE_ID = 1; + + /** + * Indicates that a servant activated with that POA is able to support the + * multiple Object Ids. + */ + public static final IdUniquenessPolicyValue MULTIPLE_ID = + new IdUniquenessPolicyValue(_MULTIPLE_ID); + + /** + * The private array that maps integer codes to the enumeration + * values. + */ + private static final IdUniquenessPolicyValue[] enume = + new IdUniquenessPolicyValue[] { UNIQUE_ID, MULTIPLE_ID }; + + /** + * The private array of state names. + */ + private static final String[] state_names = + new String[] { "UNIQUE_ID", "MULTIPLE_ID" }; + + /** + * Normally, no new instances are required, so the constructor is protected. + */ + protected IdUniquenessPolicyValue(int a_value) + { + _value = a_value; + } + + /** + * Returns the IdUniquenessPolicyValue, matching the given integer constant. + * + * @param code one of _UNIQUE_ID, _MULTIPLE_ID. + * @return one of UNIQUE_ID, MULTIPLE_ID. + * @throws BAD_PARAM if the parameter is not one of the valid values. + */ + public static IdUniquenessPolicyValue from_int(int code) + { + try + { + return enume [ code ]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; + } + } + + /** + * Returns a short string representation. + * @return the name of the current enumeration value. + */ + public String toString() + { + return state_names [ _value ]; + } + + /** + * Returns the integer code of the policy value. + * @return _UNIQUE_ID or _MULTIPLE_ID. + */ + public int value() + { + return _value; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicy.java b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicy.java new file mode 100644 index 000000000..786e5fa72 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicy.java @@ -0,0 +1,57 @@ +/* ImplicitActivationPolicy.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.portable.IDLEntity; + +/** + * Specifies the implicit activation policy. + * + * The policy can return its current value, as defined. + * in {@link ImplicitActivationPolicyOperations}. + * + * @see ImplicitActivationPolicyValue for the possible values of this policy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ImplicitActivationPolicy + extends Policy, ImplicitActivationPolicyOperations, IDLEntity +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyOperations.java new file mode 100644 index 000000000..9b6136a1c --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyOperations.java @@ -0,0 +1,55 @@ +/* ImplicitActivationPolicyOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.PolicyOperations; + +/** + * Defines the operations, applicable to the ImplicitActivationPolicy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ImplicitActivationPolicyOperations + extends PolicyOperations +{ + /** + * Return the value of this policy type, stated by the current instance. + */ + ImplicitActivationPolicyValue value(); +} diff --git a/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java new file mode 100644 index 000000000..3e4049bb3 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ImplicitActivationPolicyValue.java @@ -0,0 +1,158 @@ +/* ImplicitActivationPolicyValue.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** +* Specifies the implicit activation policy. +* +* This enumeration can obtain the following values: +* <ul> +* <li>IMPLICIT_ACTIVATION The POA supports implicit activation of servants. +* ({@link IdAssignmentPolicyValue#SYSTEM_ID} and +* {@link ServantRetentionPolicyValue#RETAIN} policies required).</li> +* <li>NO_IMPLICIT_ACTIVATION The POA does not support implicit activation.</li> +* </ul> +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public class ImplicitActivationPolicyValue + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID (V1.4) for interoperability. + */ + private static final long serialVersionUID = 3826572456602949295L; + + /** + * The value field for the current instance. + */ + private final int _value; + + /** + * The possible value of this enumeration (IMPLICIT_ACTIVATION). + */ + public static final int _IMPLICIT_ACTIVATION = 0; + + /** + * An instance of ImplicitActivationPolicyValue, initialized to IMPLICIT_ACTIVATION. + */ + public static final ImplicitActivationPolicyValue IMPLICIT_ACTIVATION = + new ImplicitActivationPolicyValue(_IMPLICIT_ACTIVATION); + + /** + * The possible value of this enumeration (NO_IMPLICIT_ACTIVATION). + */ + public static final int _NO_IMPLICIT_ACTIVATION = 1; + + /** + * An instance of ImplicitActivationPolicyValue, initialized to NO_IMPLICIT_ACTIVATION. + */ + public static final ImplicitActivationPolicyValue NO_IMPLICIT_ACTIVATION = + new ImplicitActivationPolicyValue(_NO_IMPLICIT_ACTIVATION); + + /** + * The private array that maps integer codes to the enumeration + * values. + */ + private static final ImplicitActivationPolicyValue[] enume = + new ImplicitActivationPolicyValue[] + { + IMPLICIT_ACTIVATION, NO_IMPLICIT_ACTIVATION + }; + + /** + * The private array of state names. + */ + private static final String[] state_names = + new String[] { "IMPLICIT_ACTIVATION", "NO_IMPLICIT_ACTIVATION" }; + + /** + * Normally, no new instances are required, so the constructor is protected. + */ + protected ImplicitActivationPolicyValue(int a_value) + { + _value = a_value; + } + + /** + * Returns the ImplicitActivationPolicyValue, matching the given integer constant. + * + * @param code one of _IMPLICIT_ACTIVATION, _NO_IMPLICIT_ACTIVATION. + * @return one of IMPLICIT_ACTIVATION, NO_IMPLICIT_ACTIVATION. + * @throws BAD_PARAM if the parameter is not one of the valid values. + */ + public static ImplicitActivationPolicyValue from_int(int code) + { + try + { + return enume [ code ]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; + } + } + + /** + * Returns a short string representation. + * @return the name of the current enumeration value. + */ + public String toString() + { + return state_names [ _value ]; + } + + /** + * Returns the integer code of the policy value. + * @return _IMPLICIT_ACTIVATION or _NO_IMPLICIT_ACTIVATION. + */ + public int value() + { + return _value; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/LIFESPAN_POLICY_ID.java b/libjava/classpath/org/omg/PortableServer/LIFESPAN_POLICY_ID.java new file mode 100644 index 000000000..87b93af02 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/LIFESPAN_POLICY_ID.java @@ -0,0 +1,52 @@ +/* LIFESPAN_POLICY_ID.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + + /** + * Holds an integer {@link LifespanPolicy} identifier. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface LIFESPAN_POLICY_ID +{ + /** + * Specifies the LIFESPAN_POLICY_ID value, 17. + */ + int value = 17; +} diff --git a/libjava/classpath/org/omg/PortableServer/LifespanPolicy.java b/libjava/classpath/org/omg/PortableServer/LifespanPolicy.java new file mode 100644 index 000000000..2b96bf185 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/LifespanPolicy.java @@ -0,0 +1,58 @@ +/* LifespanPolicy.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.portable.IDLEntity; + +/** + * Specifies the object life span policy, if they can outlive the POA + * with that they were first created. + * + * The policy can return its current value, as defined. + * in {@link LifespanPolicyOperations}. + * + * @see LifespanPolicyValue for the possible values of this policy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface LifespanPolicy + extends Policy, LifespanPolicyOperations, IDLEntity +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/LifespanPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/LifespanPolicyOperations.java new file mode 100644 index 000000000..5eac1599e --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/LifespanPolicyOperations.java @@ -0,0 +1,55 @@ +/* LifespanPolicyOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.PolicyOperations; + +/** + * Defines the operations, applicable to the LifespanPolicy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface LifespanPolicyOperations + extends PolicyOperations +{ + /** + * Return the value of this policy type, stated by the current instance. + */ + LifespanPolicyValue value(); +} diff --git a/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java b/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java new file mode 100644 index 000000000..2be37fb37 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/LifespanPolicyValue.java @@ -0,0 +1,155 @@ +/* LifespanPolicyValue.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** +* Specifies the object life span policy. +* +* This enumeration can obtain the following values: +* <ul> +* <li>TRANSIENT The objects implemented in the POA never outlive +* the POA instance in which they are first created.</li> +* <li>PERSISTENT The mentioned objects can outlive the process in +* which they are first created.</li> +* </ul> +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public class LifespanPolicyValue + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID (V1.4) for interoperability. + */ + private static final long serialVersionUID = 6604562925399671611L; + + /** + * The value field for the current instance. + */ + private final int _value; + + /** + * The possible value of this enumeration (TRANSIENT). + */ + public static final int _TRANSIENT = 0; + + /** + * An instance of LifespanPolicyValue, initialized to TRANSIENT. + */ + public static final LifespanPolicyValue TRANSIENT = + new LifespanPolicyValue(_TRANSIENT); + + /** + * The possible value of this enumeration (PERSISTENT). + */ + public static final int _PERSISTENT = 1; + + /** + * An instance of LifespanPolicyValue, initialized to PERSISTENT. + */ + public static final LifespanPolicyValue PERSISTENT = + new LifespanPolicyValue(_PERSISTENT); + + /** + * The private array that maps integer codes to the enumeration + * values. + */ + private static final LifespanPolicyValue[] enume = + new LifespanPolicyValue[] { TRANSIENT, PERSISTENT }; + + /** + * The private array of state names. + */ + private static final String[] state_names = + new String[] { "TRANSIENT", "PERSISTENT" }; + + /** + * Normally, no new instances are required, so the constructor is protected. + */ + protected LifespanPolicyValue(int a_value) + { + _value = a_value; + } + + /** + * Returns the LifespanPolicyValue, matching the given integer constant. + * + * @param code one of _TRANSIENT, _PERSISTENT. + * @return one of TRANSIENT, PERSISTENT. + * @throws BAD_PARAM if the parameter is not one of the valid values. + */ + public static LifespanPolicyValue from_int(int code) + { + try + { + return enume [ code ]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; + } + } + + /** + * Returns a short string representation. + * @return the name of the current enumeration value. + */ + public String toString() + { + return state_names [ _value ]; + } + + /** + * Returns the integer code of the policy value. + * @return _TRANSIENT or _PERSISTENT. + */ + public int value() + { + return _value; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POA.java b/libjava/classpath/org/omg/PortableServer/POA.java new file mode 100644 index 000000000..cddeac63f --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POA.java @@ -0,0 +1,66 @@ +/* POA.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * <p> + * The Portable Object Adapter (POA) provides more control on the request + * processing than it is possible when connecting objects directly to the + * ORB. For details, see the general description of the + * <code>org.omg.PortableServer</code> package. + * </p><p> + * The operations, supported by POA are defined + * separately in {@link POAOperations}. In the simpliest case, the servant + * implementation is connected to POA by + * {@link POAOperations#servant_to_reference}, the returned object being a + * target of remote and local invocations, despite the numerous other + * strategies are possible. + * </p> + * + * @see org.omg.CORBA.ORB#resolve_initial_references + * @see POAOperations#servant_to_reference + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface POA + extends POAOperations, IDLEntity, org.omg.CORBA.Object +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/POAHelper.java b/libjava/classpath/org/omg/PortableServer/POAHelper.java new file mode 100644 index 000000000..6eb5ab542 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAHelper.java @@ -0,0 +1,154 @@ +/* POAHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.Any; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the CORBA object {@link POA}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class POAHelper +{ + /** + * Cast the passed object into the POA. As POA is a local object, the method + * just uses java type cast. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a POA. + */ + public static POA narrow(org.omg.CORBA.Object obj) + { + try + { + return (POA) obj; + } + catch (ClassCastException cex) + { + throw new BAD_PARAM(obj.getClass().getName() + " is not a POA"); + } + } + + /** + * Get the type code of the {@link POA}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_interface_tc(id(), "POA"); + } + + /** + * Insert the POA into the given Any. + * + * @param any the Any to insert into. + * + * @param that the POA to insert. + */ + public static void insert(Any any, POA that) + { + any.insert_Object(that); + } + + /** + * Extract the POA from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain POA. + */ + public static POA extract(Any any) + { + return narrow(any.extract_Object()); + } + + /** + * Get the POA repository id. + * + * @return "IDL:omg.org/PortableServer/POA:2.3", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA:2.3"; + } + + /** + * This should read POA from the CDR input stream, but, following the specs, + * it doesnot. The jdk 1.5 API specification defines that POA cannot be + * exported. + * + * @param input a org.omg.CORBA.portable stream to read from. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL, always. + */ + public static POA read(InputStream input) + { + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; + } + + /** + * This should read POA from the CDR input stream, but, following the specs, + * it doesnot. The jdk 1.5 API specification defines that POA cannot be + * exported. + * + * @param output a org.omg.CORBA.portable stream to write into. + * + * @specenote Sun throws the same exception. + * + * @throws MARSHAL, always. + */ + public static void write(OutputStream output, POA value) + { + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAManager.java b/libjava/classpath/org/omg/PortableServer/POAManager.java new file mode 100644 index 000000000..72aa22f9d --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAManager.java @@ -0,0 +1,63 @@ +/* POAManager.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * <p> + * A POA manager is associated with one or more POAs and provides means + * to regulate they activity. Using manage, it is possible to force + * requests for those POAs to be queued or discarded or have those POAs + * deactivated. The manager can turn POAs to and from holding, + * active and discarding states, but the incative state is irreversible. + * </p> + * <p> + * The manager of the ORBs root POA can be obtained by resolving initial + * reference "RootPOAManager". + * </p> + * + * @see POAManagerOperations + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface POAManager + extends POAManagerOperations, IDLEntity, org.omg.CORBA.Object +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/POAManagerOperations.java b/libjava/classpath/org/omg/PortableServer/POAManagerOperations.java new file mode 100644 index 000000000..251bbe4b1 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAManagerOperations.java @@ -0,0 +1,141 @@ +/* POAManagerOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.PortableServer.POAManagerPackage.AdapterInactive; +import org.omg.PortableServer.POAManagerPackage.State; + +/** + * Defines the operations, applicable to the {@link POAManager}. + * These operations can turn the associated POAs to and from holding, + * active and discarding states, but the incative state is irreversible. + * The inactivated POAs can only be recreated after they were destroyed. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface POAManagerOperations +{ + /** + * Turns the associated POAs into active state, allowing them to receive + * and process requests. + * + * @throws AdapterInactive if the POAs are in the inactive state. If + * once inactivated, the POA cannot be activated again. + * This method can only be called to leave the holding or discarding state. + */ + void activate() + throws AdapterInactive; + + /** + * <p> + * Turns the asociated POAs into inactive state. The POAs in the incative + * state will reject new requests. A cliet, trying to invoke an + * object, belonging to the inactivated POA, will receive the remote exception + * ({@link org.omg.CORBA.OBJ_ADAPTER}, minor code 0x535503ea, incomplete). + * </p><p> + * If the POA is once inactivated, it cannot be activated again. + * The operation is used when the associated POAs are to be shut down. + * </p> + * <p> + * Some independent implementations may set the minor code of the + * OBJ_ADAPTER to 1, as recommended by OMG (formal/04-03-12). + * The interoperable systems should expect any of these two values. + * </p> + * + * @param etherealize_objects if true, the servant managers of the + * associated POAs, having RETAIN and USE_SERVANT_MANAGER policies, + * will receive a call of {@link ServantActivatorOperations#etherealize}. + * + * @param wait_for_completion if true, the method call suspends the current + * thread till POAs complete the requests they are currently processing. If + * false, the method returns immediately. + * <p> + * + * @specnote The 0x535503ea is a Sun specific minor exception code 1002, + * used for interoperability reasons. + * + * @throws AdapterInactive if the POAs are already in the inactive state. + * + * @see POAOperations#destroy + */ + void deactivate(boolean etherealize_objects, boolean wait_for_completion) + throws AdapterInactive; + + /** + * <p> + * Turns the associated POAs into discaring state. In this state, the POAs + * discard the incoming requests. This mode is used in situations when + * the server is flooded with requests. The client receives remote exception + * ({@link org.omg.CORBA.TRANSIENT}, minor code 0x535503e9, incomplete). + * </p><p> + * Some independent implementations may set the minor code of the + * TRANSIENT to 1, as recommended by OMG (formal/04-03-12). + * The interoperable systems should expect any of these two values. + * </p> + * + * @param wait_for_completion if true, the method call suspends the current + * thread till POAs complete the requests they are currently processing. If + * false, the method returns immediately. + * + * @specnote The 0x535503e9 is a Sun specific minor exception code 1001, + * used for interoperability reasons. + * + * @throws AdapterInactive if the POAs are in the inactive state. + */ + void discard_requests(boolean wait_for_completion) + throws AdapterInactive; + + /** + * Get the state of the POA manager. + */ + State get_state(); + + /** + * Turns the associated POAs into holding state. In this state, the POAs + * queue incoming requests but do not process them. + * + * @param wait_for_completion if true, the method call suspends the current + * thread till POAs complete the requests they are currently processing. If + * false, the method returns immediately. + + * @throws AdapterInactive if the POAs are in the inactive state. + */ + void hold_requests(boolean wait_for_completion) + throws AdapterInactive; +} diff --git a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactive.java b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactive.java new file mode 100644 index 000000000..f0f729920 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactive.java @@ -0,0 +1,79 @@ +/* AdapterInactive.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAManagerPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised when the current operation is not applicable for the system + * because the POA manager is in an inactive {@link State}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class AdapterInactive + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 6945182851085567131L; + + /** + * Create AdapterInactive with no explaining + * message. + */ + public AdapterInactive() + { + } + + /** + * Create the AdapterInactive with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public AdapterInactive(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java new file mode 100644 index 000000000..d7d0336b7 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.java @@ -0,0 +1,142 @@ +/* AdapterInactiveHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAManagerPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the exception {@link AdapterInactive}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class AdapterInactiveHelper +{ + /** + * Create the AdapterInactive typecode (structure, + * named "AdapterInactive"). + */ + public static TypeCode type() + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + return orb.create_exception_tc(id(), "AdapterInactive", members); + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the AdapterInactive into the given Any. + * + * @param any the Any to insert into. + * @param that the AdapterInactive to insert. + */ + public static void insert(Any any, AdapterInactive that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the AdapterInactive from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain AdapterInactive. + */ + public static AdapterInactive extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (AdapterInactive) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("AdapterInactive expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the AdapterInactive repository id. + * + * @return "IDL:omg.org/PortableServer/POAManager/AdapterInactive:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POAManager/AdapterInactive:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static AdapterInactive read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + AdapterInactive value = new AdapterInactive(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, AdapterInactive value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java new file mode 100644 index 000000000..72a097038 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/State.java @@ -0,0 +1,184 @@ +/* State.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAManagerPackage; + +import gnu.CORBA.Minor; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TRANSIENT; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Defines the possible states of the POA manager. + * + * This enumeration can obtain the following values: + * <ul> + * <li>ACTIVE When the manager is in the active state, the associated POAs + * receive and process requests.</li> + * <li>DISCARDING When the manager is in the discarding state, + * the associated POAs discard all incoming requests. The sending clients + * receive the {@link TRANSIENT} system exception, with standard + * minor code 1. This mode is needed for flow control, when the system is + * flooded with requests. + * </li> + * <li>HOLDING When the manager is in the holding state, the associated POAs + * queue incoming requests.</li> + * <li>INACTIVE This state is entered when the associated POAs are to be + * shut down.</li> + * </ul> + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class State + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -2451866258678193271L; + + /** + * The value field for the current instance. + */ + private final int _value; + + /** + * The possible value of this enumeration (HOLDING). + */ + public static final int _HOLDING = 0; + + /** + * An instance of State, initialized to HOLDING. + */ + public static final State HOLDING = new State(_HOLDING); + + /** + * The possible value of this enumeration (ACTIVE). + */ + public static final int _ACTIVE = 1; + + /** + * An instance of State, initialized to ACTIVE. + */ + public static final State ACTIVE = new State(_ACTIVE); + + /** + * The possible value of this enumeration (DISCARDING). + */ + public static final int _DISCARDING = 2; + + /** + * An instance of State, initialized to DISCARDING. + */ + public static final State DISCARDING = new State(_DISCARDING); + + /** + * The possible value of this enumeration (INACTIVE). + */ + public static final int _INACTIVE = 3; + + /** + * An instance of State, initialized to INACTIVE. + */ + public static final State INACTIVE = new State(_INACTIVE); + + /** + * The private array that maps integer codes to the enumeration + * values. + */ + private static final State[] enume = + new State[] { HOLDING, ACTIVE, DISCARDING, INACTIVE }; + + /** + * The private array of state names. + */ + private static final String[] state_names = + new String[] { "HOLDING", "ACTIVE", "DISCARDING", "INACTIVE" }; + + /** + * Normally, no new instances are required, so the constructor is protected. + */ + protected State(int a_value) + { + _value = a_value; + } + + /** + * Returns the State, matching the given integer constant. + * + * @param code one of _HOLDING, _ACTIVE, _DISCARDING, _INACTIVE. + * @return one of HOLDING, ACTIVE, DISCARDING, INACTIVE. + * @throws BAD_PARAM if the parameter is not one of the valid values. + */ + public static State from_int(int code) + { + try + { + return enume[code]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Invalid state " + code); + bad.minor = Minor.Enumeration; + throw bad; + } + } + + /** + * Returns a short string representation. + * + * @return the name of the current enumeration value. + */ + public String toString() + { + return state_names [ _value ]; + } + + /** + * Returns the integer code of the enumeration value. + * @return one of HOLDING, ACTIVE, DISCARDING, INACTIVE. + */ + public int value() + { + return _value; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAManagerPackage/package.html b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/package.html new file mode 100644 index 000000000..fb6ae58d5 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAManagerPackage/package.html @@ -0,0 +1,46 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. --> + +<html> +<head><title>GNU Classpath - org.omg.PortableServer.POAManagerPackage</title></head> + +<body> +<p>Contains additional classes, needed by POA Manager</p> + +</body> +</html> diff --git a/libjava/classpath/org/omg/PortableServer/POAOperations.java b/libjava/classpath/org/omg/PortableServer/POAOperations.java new file mode 100644 index 000000000..f989d2681 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAOperations.java @@ -0,0 +1,529 @@ +/* POAOperations.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.OBJ_ADAPTER; +import org.omg.CORBA.Policy; +import org.omg.CORBA.TRANSIENT; +import org.omg.PortableServer.POAPackage.AdapterAlreadyExists; +import org.omg.PortableServer.POAPackage.AdapterNonExistent; +import org.omg.PortableServer.POAPackage.InvalidPolicy; +import org.omg.PortableServer.POAPackage.NoServant; +import org.omg.PortableServer.POAPackage.ObjectAlreadyActive; +import org.omg.PortableServer.POAPackage.ObjectNotActive; +import org.omg.PortableServer.POAPackage.ServantAlreadyActive; +import org.omg.PortableServer.POAPackage.ServantNotActive; +import org.omg.PortableServer.POAPackage.WrongAdapter; +import org.omg.PortableServer.POAPackage.WrongPolicy; + +/** + * Defines the operations, applicable to the POA. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface POAOperations +{ + /** + * Creates a new POA as a child of the target POA. + * + * @param child_name the name of the child POA being created. + * @param manager the manager that will control the new POA. If this parameter + * is null, a new POA manager is created and associated with the new POA. + * + * @param policies the policies, applicable for the parent POA. Policies + * are <i>not</i> inherited from the parent POA. If some policy type + * is missing in the array (or the zero size array is passed), the missing + * policies obtain the default values from the table, specified + * in the {@link POA} documentation header. + * + * @return an newly created POA. The POA will be intially in the holding + * state and must be activated to start processing requests. + * + * @throws AdapterAlreadyExists if the child with the given child_name + * already exists for the current POA. + * @throws InvalidPolicy if the policies conflict with each other or are + * otherwise inappropriate. + * + * @see POA for the list of required policies. + * @see #the_children() + */ + POA create_POA(String child_name, POAManager manager, Policy[] policies) + throws AdapterAlreadyExists, InvalidPolicy; + + /** + * Find and optionally activate the child POA with the given name. + * + * @param poa_name the name of the POA to find. + * @param activate_it if the child with the specified name is not found + * or inactive and this parameter is true, the target POA activator is + * invoked to activate that child. If this succeeds, that child POA + * is returned. + * + * @throws AdapterNonExistent if no active child with the given name + * is found and one of the following is true: + * a) the target POA has no associated + * {@link AdapterActivator}. b) that activator fails to activate the + * child POA. c) <code>activate_id</code> = false. + */ + POA find_POA(String poa_name, boolean activate_it) + throws AdapterNonExistent; + + /** + * Generate the Object Id for the given servant and add the servant to + * the Active Object Map using this Id a a key. If the servant + * activator is set, its incarnate method will be called. In this case, + * the passed servant in this method can be null; in this case, the servant, + * returned by {@link ServantActivatorOperations#incarnate} will + * be used. + * + * @param a_servant a servant that would serve the object with the + * returned Object Id. + * + * @return the generated objert Id for the given servant. + * + * @throws ServantAlreadyActive if this servant is already in the + * Active Object Map and the UNIQUE_ID policy applies. + * + * @throws WrongPolicy if the required policies SYSTEM_ID and RETAIN + * do not apply to this POA. + */ + byte[] activate_object(Servant a_servant) + throws ServantAlreadyActive, WrongPolicy; + + /** + * Add the given servant to the Active Object Map as a servant for the + * object with the provided Object Id. If the servant activator is + * set, its incarnate method will be called. In this case, + * the passed servant in this method can be null; in this case, the servant, + * returned by {@link ServantActivatorOperations#incarnate} will + * be used. + * + * @param an_Object_Id an object id for the given object. + * @param a_servant a servant that will serve the object with the given + * Object Id. + * + * @throws ObjectAlreadyActive if the given object id is already in the + * Active Object Map. + * @throws WrongPolicy if the required RETAIN policy does not apply to + * this POA. + * @throws BAD_PARAM if the passed object id is invalid due any reason. + */ + void activate_object_with_id(byte[] an_Object_Id, Servant a_servant) + throws ServantAlreadyActive, ObjectAlreadyActive, + WrongPolicy; + + /** + * <p>Deactivate object with the given id. Client, trying to call + * method on the deactivated object will either receive the remote + * exception ({@link org.omg.CORBA.OBJECT_NOT_EXIST}, minor 0x535503ec), + * incomplete) or the object will be reactivated and serve the request. + * The object can be reactivated only if the implicit activation + * policy applies and the servant activator is set.</p><p> + * The deactivated object will continue to process requests that arrived + * before decativation. + * If this POA has the associated servant manager, a + * {@link ServantActivatorOperations#etherealize} is <i>immediately</i> + * invoked on the passed id. The deactivated object can be reactivated + * by {@link #activate_object_with_id}.</p> + * <p>The deactivation will not release thread, port or memory resources, + * taken by that object. This is due requirement to make the + * object reactivation possible at any time. To release the resources, + * you must destroy the POA. + * </p> + * + * @throws WrongPolicy if the required RETAIN policy does not apply to + * this POA. + */ + void deactivate_object(byte[] the_Object_Id) + throws ObjectNotActive, WrongPolicy; + + /** + * Create the object reference, encapsulating the given repository Id and + * the Object Id, generated by this POA. The returned object will not be + * activated by default and may be activated on the first invocation by + * the servant manager (if it is set and if policies are applicable). + * The returned object can also be narrowed by helper and used locally. + * In this case, the servant will be activated on the first local call of + * any method. The methods on returned object can also be invoked by + * name, using {@link org.omg.CORBA.Request}. + * + * @param a_repository_id the repository id for the given object. When + * narrowing the returned object with some helper, it will be checked for + * equality with value, returned by the the helper id(). + * + * @throws WrongPolicy if the required SYSTEM_ID policy does not apply to + * this POA. + */ + org.omg.CORBA.Object create_reference(String a_repository_id) + throws WrongPolicy; + + /** + * <p> Create the object reference, encapsulating the given repository Id and + * the given Object Id. The returned object will not be + * activated by default and may be activated on the first invocation by + * the servant manager (if it is set and if policies are applicable). + * </p><p> + * The returned object can also be narrowed by helper and used locally. + * In this case, the servant will be activated on the first local call of + * any method. The methods on returned object can also be invoked by + * name, using {@link org.omg.CORBA.Request}. + * </p> + * + * @param an_object_id the object id for the object being created. + * If the POA uses the SYSTEM_ID policy, the portable application + * must only supply ids, generated by that POA. + * + * @param a_repository_id the repository id for the given object. When + * narrowing the returned object with some helper, it will be checked for + * equality with value, returned by the the helper id(). + */ + org.omg.CORBA.Object create_reference_with_id(byte[] an_object_id, + String a_repository_id + ); + + /** + * Returns a default servant for this POA. + * + * @return a servant that will be used for requests for + * which no servant is found in the Active Object Map. + * + * @throws NoServant if there is no default servant associated with this POA. + * @throws WrongPolicy if the USE_DEFAULT_SERVANT policy is not active. + */ + Servant get_servant() + throws NoServant, WrongPolicy; + + /** + * Sets the default servant for this POA. + * + * @param a_servant a servant that will be used for requests for + * which no servant is found in the Active Object Map. + * + * @throws WrongPolicy if the USE_DEFAULT_SERVANT policy is not active. + */ + void set_servant(Servant a_servant) + throws WrongPolicy; + + /** + * Set a servant manager for this POA. + * + * @param a_manager servant manager being set. If the RETAIN policy applies, the + * manager must implement a {@link ServantActivator}. If the NON_RETAIN + * policy applies, the manager must implement a {@link ServantLocator}. + * + * @throws WrongPolicy if the required USE_SERVANT_MANAGER policy does not + * apply to this POA. + * + * @throws OBJ_ADAPTER minor code 4 if the passed manager does not + * implement the required interface ({@link ServantActivator}, + * {@link ServantLocator}). + * + * @throws BAD_INV_ORDER minor code 6 if the method is called more than once + * on the same POA. The manager can be set only once. + */ + void set_servant_manager(ServantManager a_manager) + throws WrongPolicy; + + /** + * Get the servant manager, associated with this POA. + * + * @return the associated servant manager or null if it has + * been previously set. + * + * @throws WrongPolicy if the required USE_SERVANT_MANAGER policy does not + * apply to this POA. + */ + ServantManager get_servant_manager() + throws WrongPolicy; + + /** + * Get the unique Id of the POA in the process in which it is created. + * This Id is needed by portable interceptors. The id is unique + * for the life span of the POA in the process. For persistent + * POAs, if a POA is created in the same path with the same name as + * another POA, these POAs are identical have the same id. All transient + * POAs are assumed unique. + */ + byte[] id(); + + /** + * Returns the reference to the active object with the given Id. + * + * @param the_Object_Id the object id. + * + * @throws ObjectNotActive if there is no active object with such Id. + * @throws WrongPolicy if the required RETAIN policy does not apply to + * this POA. + */ + org.omg.CORBA.Object id_to_reference(byte[] the_Object_Id) + throws ObjectNotActive, WrongPolicy; + + /** + * Returns the servant that serves the active object with the given Id. + * + * @param the_Object_Id the object id. + * + * @throws ObjectNotActive if there is no active object with such Id. + * @throws WrongPolicy This method requires either RETAIN or + * USE_DEFAULT_SERVANT policies and reaises the WrongPolicy if none of them + * apply to this POA. + */ + Servant id_to_servant(byte[] the_Object_Id) + throws ObjectNotActive, WrongPolicy; + + /** + * Returns the Object Id, encapsulated in the given object reference. + * + * @param the_Object the object that has been previously created with this + * POA. It need not be active. + * + * @throws WrongAdapter if the passed object has not been previously created + * with this POA. + * @throws WrongPolicy never (declared for the future extensions only). + */ + byte[] reference_to_id(org.omg.CORBA.Object the_Object) + throws WrongAdapter, WrongPolicy; + + /** + * Returns the servant that is serving this object. + * + * @return if the RETAIN policy applies and the object is in the Active + * Object Map, the method returns the servant, associated with this object. + * Otherwise, if the USE_DEFAULT_SERVANT policy applies, the method returns + * the default servant (if one was set). + * + * @throws ObjectNotActive if none of the conditions above are satisfied. + * @throws WrongAdapter if the object reference was not created with this POA. + * @throws WrongPolicy This method requires either RETAIN or + * USE_DEFAULT_SERVANT policies and reaises the WrongPolicy if none of them + * apply to this POA. + */ + Servant reference_to_servant(org.omg.CORBA.Object the_Object) + throws ObjectNotActive, WrongPolicy, WrongAdapter; + + /** + * Returns the id of the object, served by the given servant. The id is found + * in one of the following ways. + * <ul> + * <li>If the POA has both the RETAIN and the UNIQUE_ID policy and + * the specified servant is active, the method return the Object Id associated + * with that servant. + * </li><li> + * If the POA has both the RETAIN and the IMPLICIT_ACTIVATION policy and + * either the POA has the MULTIPLE_ID policy or the specified servant is + * inactive, the method activates the servant using a POA-generated Object Id + * and the Interface Id associated with the servant, and returns that + * Object Id. + * </li> + * <li>If the POA has the USE_DEFAULT_SERVANT policy, the servant specified + * is the default servant, and the method is being invoked in the context o + * f executing a request on the default servant, the method returns the + * ObjectId associated with the current invocation. + * </li> + * </ul> + * @throws ServantNotActive in all cases, not listed in the list above. + * @throws WrongPolicy The method requres USE_DEFAULT_SERVANT policy or + * a combination of the RETAIN policy and either the UNIQUE_ID or + * IMPLICIT_ACTIVATION policies and throws the WrongPolicy if these conditions + * are not satisfied. + */ + byte[] servant_to_id(Servant the_Servant) + throws ServantNotActive, WrongPolicy; + + /** + * <p>Converts the given servant to the object reference. + * The servant will serve all methods, invoked on the returned object. + * The returned object reference can be passed to the remote client, + * enabling remote invocations. + * </p><p> + * If the specified servant already serves some active object, that + * object is returned. Otherwise, + * if the POA has the IMPLICIT_ACTIVATION policy the method activates + * the servant, creating an new object with the POA-generated Object Id. + * In this case, if the servant activator is set, the + * {@link ServantActivatorOperations#incarnate} method will be called. + * </p> + * + * @throws ServantNotActive if the servant is inactive and no + * IMPLICIT_ACTIVATION policy applies. + * @throws WrongPolicy This method needs the RETAIN policy and either the + * UNIQUE_ID or IMPLICIT_ACTIVATION policies. + * + * @return the object, exposing the given servant in the context of this POA. + */ + org.omg.CORBA.Object servant_to_reference(Servant the_Servant) + throws ServantNotActive, WrongPolicy; + + /** + * Return the POA manager, associated with this POA. + * + * @return the associated POA manager (always available). + */ + POAManager the_POAManager(); + + /** + * Returns the adapter activator, associated with this POA. + * The newly created POA has no activator (null would be + * returned). The ORB root POA also initially has no activator. + * + * @return tha adapter activator or null if this POA has no + * associated adapter activator. + */ + AdapterActivator the_activator(); + + /** + * Set the adapter activator for this POA. + * + * @param activator the activator being set. + */ + void the_activator(AdapterActivator activator); + + /** + * The children of this POA. + * + * @return the array of all childs for this POA. + */ + POA[] the_children(); + + /** + * Return the name of this POA. + * + * @return the name of POA, relative to its parent. + */ + String the_name(); + + /** + * Return the parent of this POA. + * + * @return the parent POA or <code>null</code> if this is a root POA. + */ + POA the_parent(); + + /** + * <p> Destroy this POA and all descendant POAs. The destroyed POAs can be + * later re-created via {@link AdapterActivator} or by invoking + * {@link #create_POA}. + * This differs from {@link POAManagerOperations#deactivate} that does + * not allow recreation of the deactivated POAs. After deactivation, + * recreation is only possible if the POAs were later destroyed. + * </p><p> + * The remote invocation on the target, belonging to the POA that is + * currently destroyed return the remote exception ({@link TRANSIENT}, + * minor code 4). + * </p> + * @param etherealize_objects if true, and POA has RETAIN policy, and the + * servant manager is available, the servant manager method + * {@link ServantActivatorOperations#etherealize} is called for each + * <i>active</i> object in the Active Object Map. This method should not + * try to access POA being destroyed. If <code>destroy</code> is called + * multiple times before the destruction completes, + * the etherialization should be invoked only once. + * + * @param wait_for_completion if true, the method waits till the POA being + * destroyed completes all current requests and etherialization. If false, + * the method returns immediately. + */ + void destroy(boolean etherealize_objects, boolean wait_for_completion); + + /** + * Create the IdUniquenessPolicy policy. + * + * @param a_value states which one Id uniqueness policy will apply. + * + * @return the created policy. + */ + IdUniquenessPolicy create_id_uniqueness_policy(IdUniquenessPolicyValue a_value); + + /** + * Create the ImplicitActivationPolicy policy. + * + * @param a_value states which one activation policy will apply. + * + * @return the created policy. + */ + ImplicitActivationPolicy create_implicit_activation_policy(ImplicitActivationPolicyValue a_value); + + /** + * Create the LifespanPolicy policy. + * + * @param a_value states which one object lifespan policy will apply. + * + * @return the created policy. + */ + LifespanPolicy create_lifespan_policy(LifespanPolicyValue a_value); + + /** + * Create the RequestProcessingPolicy policy. + * + * @param a_value states which one request processing policy will apply. + * + * @return the created policy. + */ + RequestProcessingPolicy create_request_processing_policy(RequestProcessingPolicyValue a_value); + + /** + * Create the ServantRetentionPolicy policy. + * + * @param a_value states which one servant retention policy will apply. + * + * @return the created policy. + */ + ServantRetentionPolicy create_servant_retention_policy(ServantRetentionPolicyValue a_value); + + /** + * Create the ThreadPolicy policy. + * + * @param a_value states which one thread policy will apply. + * + * @return the created policy. + */ + ThreadPolicy create_thread_policy(ThreadPolicyValue a_value); + + /** + * Create the ID assignment policy with the given value. + * + * @param value states which one ID assignment policy will apply. + * + * @return the created policy. + */ + IdAssignmentPolicy create_id_assignment_policy(IdAssignmentPolicyValue value); + +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExists.java b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExists.java new file mode 100644 index 000000000..602ce1dba --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExists.java @@ -0,0 +1,79 @@ +/* AdapterAlreadyExists.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised if the target POA already has a child POA with the specified name + * (during creation of the new POA as a child of the target POA). + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class AdapterAlreadyExists + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -2678288222917790041L; + + /** + * Create AdapterAlreadyExists with no explaining + * message. + */ + public AdapterAlreadyExists() + { + } + + /** + * Create the AdapterAlreadyExists with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public AdapterAlreadyExists(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java new file mode 100644 index 000000000..ccb3fa584 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.java @@ -0,0 +1,152 @@ +/* AdapterAlreadyExistsHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link AdapterAlreadyExists}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class AdapterAlreadyExistsHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the AdapterAlreadyExists typecode (emtpy structure, + * named "AdapterAlreadyExists"). + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + typeCode = + orb.create_exception_tc(id(), "AdapterAlreadyExists", members); + } + return typeCode; + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the AdapterAlreadyExists into the given Any. + * + * @param any the Any to insert into. + * @param that the AdapterAlreadyExists to insert. + */ + public static void insert(Any any, AdapterAlreadyExists that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the AdapterAlreadyExists from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain AdapterAlreadyExists. + */ + public static AdapterAlreadyExists extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (AdapterAlreadyExists) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("AdapterAlreadyExists expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the AdapterAlreadyExists repository id. + * + * @return "IDL:omg.org/PortableServer/POA/AdapterAlreadyExists:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA/AdapterAlreadyExists:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static AdapterAlreadyExists read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + AdapterAlreadyExists value = new AdapterAlreadyExists(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, AdapterAlreadyExists value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistent.java b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistent.java new file mode 100644 index 000000000..c7f87bccf --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistent.java @@ -0,0 +1,79 @@ +/* AdapterNonExistent.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * The AdapterNonExistent is thrown if the parent POA cannot locate + * the required child POA. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class AdapterNonExistent + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -9166706041988650696L; + + /** + * Create AdapterNonExistent with no explaining + * message. + */ + public AdapterNonExistent() + { + } + + /** + * Create the AdapterNonExistent with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public AdapterNonExistent(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java new file mode 100644 index 000000000..65842b756 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.java @@ -0,0 +1,151 @@ +/* AdapterNonExistentHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link AdapterNonExistent}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class AdapterNonExistentHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the AdapterNonExistent typecode (empty structure, + * named "AdapterNonExistent"). + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + typeCode = orb.create_exception_tc(id(), "AdapterNonExistent", members); + } + return typeCode; + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the AdapterNonExistent into the given Any. + * + * @param any the Any to insert into. + * @param that the AdapterNonExistent to insert. + */ + public static void insert(Any any, AdapterNonExistent that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the AdapterNonExistent from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain AdapterNonExistent. + */ + public static AdapterNonExistent extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (AdapterNonExistent) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("AdapterNonExistent expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the AdapterNonExistent repository id. + * + * @return "IDL:omg.org/PortableServer/POA/AdapterNonExistent:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA/AdapterNonExistent:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static AdapterNonExistent read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + AdapterNonExistent value = new AdapterNonExistent(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, AdapterNonExistent value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicy.java b/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicy.java new file mode 100644 index 000000000..43ea544d3 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicy.java @@ -0,0 +1,109 @@ +/* InvalidPolicy.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised if any of the policy objects specified is not supported by this + * ORB implementation, if conflicting policy objects are specified, + * or if any of the specified policy objects require prior administrative + * action that has not been performed. + * + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class InvalidPolicy + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 3204212102282117205L; + + /** + * The index in the policies parameter value of the first offending + * policy object. + */ + public short index; + + /** + * Create InvalidPolicy with no explaining + * message and leaving {@link #index} with default 0 value. + */ + public InvalidPolicy() + { + } + + /** + * Create the InvalidPolicy with explaining + * message and initialisintg {@link #index} to the passed value. + * + * @param why a string, explaining, why this exception has been thrown. + * @param a_index a value for index. + */ + public InvalidPolicy(String why, short a_index) + { + super(why); + this.index = a_index; + } + + /** + * Create the InvalidPolicy without explaining + * message and initialisintg {@link #index} to the passed value. + * + * @param a_index a value for index. + */ + public InvalidPolicy(short a_index) + { + this.index = a_index; + } + + /** + * Adds {@link #index} to the super.getMessage(). + */ + public String getMessage() + { + return super.getMessage() + " at index " + index; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.java new file mode 100644 index 000000000..64cdaadbf --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.java @@ -0,0 +1,158 @@ +/* InvalidPolicyHelper.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; +import gnu.CORBA.Poa.InvalidPolicyHolder; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link InvalidPolicy}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class InvalidPolicyHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the InvalidPolicy typecode (emtpy structure, + * named "InvalidPolicy"). + * The typecode states that the structure contains the + * single field, named "index". + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 1 ]; + + TypeCode field; + + field = orb.get_primitive_tc(TCKind.tk_ushort); + members [ 0 ] = new StructMember("index", field, null); + typeCode = orb.create_exception_tc(id(), "InvalidPolicy", members); + } + return typeCode; + } + + /** + * Insert the InvalidPolicy into the given Any. + * This method uses the InvalidPolicyHolder. + * + * @param any the Any to insert into. + * @param that the InvalidPolicy to insert. + */ + public static void insert(Any any, InvalidPolicy that) + { + any.insert_Streamable(new InvalidPolicyHolder(that)); + } + + /** + * Extract the InvalidPolicy from given Any. + * This method uses the InvalidPolicyHolder. + * + * @throws BAD_OPERATION if the passed Any does not contain InvalidPolicy. + */ + public static InvalidPolicy extract(Any any) + { + try + { + return ((InvalidPolicyHolder) any.extract_Streamable()).value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("InvalidPolicy expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the InvalidPolicy repository id. + * + * @return "IDL:omg.org/PortableServer/POA/InvalidPolicy:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA/InvalidPolicy:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static InvalidPolicy read(InputStream input) + { + // Read the exception repository id. + input.read_string(); + InvalidPolicy value = new InvalidPolicy(); + + value.index = input.read_short(); + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, InvalidPolicy value) + { + // Write the exception repository id. + output.write_string(id()); + output.write_short(value.index); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/NoServant.java b/libjava/classpath/org/omg/PortableServer/POAPackage/NoServant.java new file mode 100644 index 000000000..a3d7b0437 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/NoServant.java @@ -0,0 +1,79 @@ +/* NoServant.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised when trying to get the default servant, when no default servant + * has been associated with POA. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class NoServant + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -5893773687270266061L; + + /** + * Create NoServant with no explaining + * message. + */ + public NoServant() + { + } + + /** + * Create the NoServant with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public NoServant(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java new file mode 100644 index 000000000..cfb63ed26 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java @@ -0,0 +1,151 @@ +/* NoServantHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link NoServant}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class NoServantHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the NoServant typecode (empty structure, + * named "NoServant"). + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + typeCode = orb.create_exception_tc(id(), "NoServant", members); + } + return typeCode; + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the NoServant into the given Any. + * + * @param any the Any to insert into. + * @param that the NoServant to insert. + */ + public static void insert(Any any, NoServant that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the NoServant from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain NoServant. + */ + public static NoServant extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (NoServant) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("NoServant expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the NoServant repository id. + * + * @return "IDL:omg.org/PortableServer/POA/NoServant:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA/NoServant:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static NoServant read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + NoServant value = new NoServant(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, NoServant value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActive.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActive.java new file mode 100644 index 000000000..9a80b95f8 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActive.java @@ -0,0 +1,78 @@ +/* ObjectAlreadyActive.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised in response to activate the already active object. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ObjectAlreadyActive + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -2919308871345098101L; + + /** + * Create ObjectAlreadyActive with no explaining + * message. + */ + public ObjectAlreadyActive() + { + } + + /** + * Create the ObjectAlreadyActive with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public ObjectAlreadyActive(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java new file mode 100644 index 000000000..48070eade --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.java @@ -0,0 +1,152 @@ +/* ObjectAlreadyActiveHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link ObjectAlreadyActive}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectAlreadyActiveHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the ObjectAlreadyActive typecode (empty structure, + * named "ObjectAlreadyActive"). + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + typeCode = + orb.create_exception_tc(id(), "ObjectAlreadyActive", members); + } + return typeCode; + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the ObjectAlreadyActive into the given Any. + * + * @param any the Any to insert into. + * @param that the ObjectAlreadyActive to insert. + */ + public static void insert(Any any, ObjectAlreadyActive that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the ObjectAlreadyActive from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain ObjectAlreadyActive. + */ + public static ObjectAlreadyActive extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (ObjectAlreadyActive) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("ObjectAlreadyActive expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the ObjectAlreadyActive repository id. + * + * @return "IDL:omg.org/PortableServer/POA/ObjectAlreadyActive:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA/ObjectAlreadyActive:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static ObjectAlreadyActive read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + ObjectAlreadyActive value = new ObjectAlreadyActive(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, ObjectAlreadyActive value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActive.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActive.java new file mode 100644 index 000000000..e8f0bc6bb --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActive.java @@ -0,0 +1,79 @@ +/* ObjectNotActive.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised in several cases when the operation would be applicable to the + * activated object, but the current object is not active. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ObjectNotActive + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 2269559915073532416L; + + /** + * Create ObjectNotActive with no explaining + * message. + */ + public ObjectNotActive() + { + } + + /** + * Create the ObjectNotActive with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public ObjectNotActive(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java new file mode 100644 index 000000000..492040dd2 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.java @@ -0,0 +1,151 @@ +/* ObjectNotActiveHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link ObjectNotActive}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ObjectNotActiveHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the ObjectNotActive typecode (empty structure, + * named "ObjectNotActive"). + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + typeCode = orb.create_exception_tc(id(), "ObjectNotActive", members); + } + return typeCode; + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the ObjectNotActive into the given Any. + * + * @param any the Any to insert into. + * @param that the ObjectNotActive to insert. + */ + public static void insert(Any any, ObjectNotActive that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the ObjectNotActive from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain ObjectNotActive. + */ + public static ObjectNotActive extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (ObjectNotActive) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("ObjectNotActive expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the ObjectNotActive repository id. + * + * @return "IDL:omg.org/PortableServer/POA/ObjectNotActive:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA/ObjectNotActive:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static ObjectNotActive read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + ObjectNotActive value = new ObjectNotActive(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, ObjectNotActive value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActive.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActive.java new file mode 100644 index 000000000..a6fd5da24 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActive.java @@ -0,0 +1,83 @@ +/* ServantAlreadyActive.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised in response to activate the already active object when + * the UNIQUE_ID (single ID per object, default) policy is active. If the + * UNIQUE_ID policy is inactive, the object can be activated several + * times, each time obtaining a newly generated Id to the same object. + * + * @see org.omg.PortableServer.IdUniquenessPolicyValue + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ServantAlreadyActive + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 780130793809887260L; + + /** + * Create ServantAlreadyActive with no explaining + * message. + */ + public ServantAlreadyActive() + { + } + + /** + * Create the ServantAlreadyActive with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public ServantAlreadyActive(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java new file mode 100644 index 000000000..8fdb1ec15 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.java @@ -0,0 +1,152 @@ +/* ServantAlreadyActiveHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the exception {@link ServantAlreadyActive}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class ServantAlreadyActiveHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the ServantAlreadyActive typecode (structure, + * named "ServantAlreadyActive"). + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + typeCode = + orb.create_exception_tc(id(), "ServantAlreadyActive", members); + } + return typeCode; + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the ServantAlreadyActive into the given Any. + * + * @param any the Any to insert into. + * @param that the ServantAlreadyActive to insert. + */ + public static void insert(Any any, ServantAlreadyActive that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the ServantAlreadyActive from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain ServantAlreadyActive. + */ + public static ServantAlreadyActive extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (ServantAlreadyActive) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("ServantAlreadyActive expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the ServantAlreadyActive repository id. + * + * @return "IDL:omg.org/PortableServer/POA/ServantAlreadyActive:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA/ServantAlreadyActive:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static ServantAlreadyActive read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + ServantAlreadyActive value = new ServantAlreadyActive(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, ServantAlreadyActive value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActive.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActive.java new file mode 100644 index 000000000..584459939 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActive.java @@ -0,0 +1,79 @@ +/* ServantNotActive.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised in several cases when the operation would be applicable to the + * activated servant, but the current object is not active. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class ServantNotActive + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -7806868032412803953L; + + /** + * Create ServantNotActive with no explaining + * message. + */ + public ServantNotActive() + { + } + + /** + * Create the ServantNotActive with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public ServantNotActive(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java new file mode 100644 index 000000000..99110e511 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.java @@ -0,0 +1,151 @@ +/* ServantNotActiveHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link ServantNotActive}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ServantNotActiveHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the ServantNotActive typecode (empty structure, + * named "ServantNotActive"). + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + typeCode = orb.create_exception_tc(id(), "ServantNotActive", members); + } + return typeCode; + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the ServantNotActive into the given Any. + * + * @param any the Any to insert into. + * @param that the ServantNotActive to insert. + */ + public static void insert(Any any, ServantNotActive that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the ServantNotActive from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain ServantNotActive. + */ + public static ServantNotActive extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (ServantNotActive) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("ServantNotActive expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the ServantNotActive repository id. + * + * @return "IDL:omg.org/PortableServer/POA/ServantNotActive:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA/ServantNotActive:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static ServantNotActive read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + ServantNotActive value = new ServantNotActive(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, ServantNotActive value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapter.java b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapter.java new file mode 100644 index 000000000..8e28e8430 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapter.java @@ -0,0 +1,80 @@ +/* WrongAdapter.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised when invoking POA operations, requiring that the target + * object would be created by this POA, if this condition is not + * satisfied. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class WrongAdapter + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 7505320179916389200L; + + /** + * Create WrongAdapter with no explaining + * message. + */ + public WrongAdapter() + { + } + + /** + * Create the WrongAdapter with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public WrongAdapter(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java new file mode 100644 index 000000000..69ffda747 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongAdapterHelper.java @@ -0,0 +1,151 @@ +/* WrongAdapterHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link WrongAdapter}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class WrongAdapterHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the WrongAdapter typecode (empty structure, + * named "WrongAdapter"). + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + typeCode = orb.create_exception_tc(id(), "WrongAdapter", members); + } + return typeCode; + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the WrongAdapter into the given Any. + * + * @param any the Any to insert into. + * @param that the WrongAdapter to insert. + */ + public static void insert(Any any, WrongAdapter that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the WrongAdapter from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain WrongAdapter. + */ + public static WrongAdapter extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (WrongAdapter) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("WrongAdapter expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the WrongAdapter repository id. + * + * @return "IDL:omg.org/PortableServer/POA/WrongAdapter:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA/WrongAdapter:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static WrongAdapter read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + WrongAdapter value = new WrongAdapter(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, WrongAdapter value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicy.java b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicy.java new file mode 100644 index 000000000..e0dbc9902 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicy.java @@ -0,0 +1,79 @@ +/* WrongPolicy.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import org.omg.CORBA.UserException; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Raised when invoking the operation that is not allowed by the current + * combination of the used policies. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class WrongPolicy + extends UserException + implements IDLEntity, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = 1949765652955335195L; + + /** + * Create WrongPolicy with no explaining + * message. + */ + public WrongPolicy() + { + } + + /** + * Create the WrongPolicy with explaining + * message. + * + * @param why a string, explaining, why this exception has been thrown. + */ + public WrongPolicy(String why) + { + super(why); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java new file mode 100644 index 000000000..9122b06e4 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/WrongPolicyHelper.java @@ -0,0 +1,151 @@ +/* WrongPolicyHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.POAPackage; + +import gnu.CORBA.EmptyExceptionHolder; +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.ORB; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** + * The helper operations for the exception {@link WrongPolicy}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class WrongPolicyHelper +{ + /** + * The cached typecode value, computed only once. + */ + private static TypeCode typeCode; + + /** + * Create the WrongPolicy typecode (empty structure, + * named "WrongPolicy"). + */ + public static TypeCode type() + { + if (typeCode == null) + { + ORB orb = OrbRestricted.Singleton; + StructMember[] members = new StructMember[ 0 ]; + typeCode = orb.create_exception_tc(id(), "WrongPolicy", members); + } + return typeCode; + } + + /* Every user exception with no user defined + fields can use EmptyExceptionHolder */ + + /** + * Insert the WrongPolicy into the given Any. + * + * @param any the Any to insert into. + * @param that the WrongPolicy to insert. + */ + public static void insert(Any any, WrongPolicy that) + { + any.insert_Streamable(new EmptyExceptionHolder(that, type())); + } + + /** + * Extract the WrongPolicy from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain WrongPolicy. + */ + public static WrongPolicy extract(Any any) + { + try + { + EmptyExceptionHolder h = + (EmptyExceptionHolder) any.extract_Streamable(); + return (WrongPolicy) h.value; + } + catch (ClassCastException cex) + { + BAD_OPERATION bad = new BAD_OPERATION("WrongPolicy expected"); + bad.minor = Minor.Any; + bad.initCause(cex); + throw bad; + } + } + + /** + * Get the WrongPolicy repository id. + * + * @return "IDL:omg.org/PortableServer/POA/WrongPolicy:1.0", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/POA/WrongPolicy:1.0"; + } + + /** + * Read the exception from the CDR intput stream. + * + * @param input a org.omg.CORBA.portable stream to read from. + */ + public static WrongPolicy read(InputStream input) + { + // Read the exception repository id. + String id = input.read_string(); + WrongPolicy value = new WrongPolicy(id); + + return value; + } + + /** + * Write the exception to the CDR output stream. + * + * @param output a org.omg.CORBA.portable stream stream to write into. + * @param value a value to write. + */ + public static void write(OutputStream output, WrongPolicy value) + { + // Write the exception repository id. + output.write_string(id()); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/POAPackage/package.html b/libjava/classpath/org/omg/PortableServer/POAPackage/package.html new file mode 100644 index 000000000..e95dd68ec --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/POAPackage/package.html @@ -0,0 +1,49 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - describes classes in org.omg.PortableServer.POAPackage package + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. --> + +<html> +<head><title>GNU Classpath - org.omg.PortableServer.POAPackage</title></head> + +<body> +<p>Contains exceptions that may be thrown by various POA operations. +Also provides helpers that are used to transfer these exceptions if they +are thrown on remote side.</p> + +@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +</body> +</html> diff --git a/libjava/classpath/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.java b/libjava/classpath/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.java new file mode 100644 index 000000000..f71f101cd --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.java @@ -0,0 +1,52 @@ +/* REQUEST_PROCESSING_POLICY_ID.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + + /** + * Holds an integer {@link RequestProcessingPolicy} identifier. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface REQUEST_PROCESSING_POLICY_ID +{ + /** + * Specifies the REQUEST_PROCESSING_POLICY_ID value, 22. + */ + int value = 22; +} diff --git a/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicy.java b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicy.java new file mode 100644 index 000000000..9d3237d7d --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicy.java @@ -0,0 +1,59 @@ +/* RequestProcessingPolicy.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.portable.IDLEntity; + +/** + * Specifies the behaviour in the case when the + * requested object is not found in the Active Object Map or that map + * is not in use. + * + * The policy can return its current value, as defined. + * in {@link RequestProcessingPolicyOperations}. + * + * @see RequestProcessingPolicyValue for the possible values of this policy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface RequestProcessingPolicy + extends Policy, RequestProcessingPolicyOperations, IDLEntity +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyOperations.java new file mode 100644 index 000000000..5a8963b30 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyOperations.java @@ -0,0 +1,55 @@ +/* RequestProcessingPolicyOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.PolicyOperations; + +/** + * Defines the operations, applicable to the RequestProcessingPolicy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface RequestProcessingPolicyOperations + extends PolicyOperations +{ + /** + * Return the value of this policy type, stated by the current instance. + */ + RequestProcessingPolicyValue value(); +} diff --git a/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java new file mode 100644 index 000000000..e946d5cf6 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/RequestProcessingPolicyValue.java @@ -0,0 +1,181 @@ +/* RequestProcessingPolicyValue.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** +* Specifies the behaviour in the case when the +* requested object is not found in the Active Object Map or that map +* is not in use. The map is not in use when the +* {@link ServantRetentionPolicyValue#NON_RETAIN} policy is active. +* <ul> +* <li>USE_ACTIVE_OBJECT_MAP_ONLY Raise an {@link org.omg.CORBA.OBJECT_NOT_EXIST} +* with the minor code 2. {@link ServantRetentionPolicyValue#RETAIN} policy is +* also required. +* </li> +* <li>USE_DEFAULT_SERVANT Dispatch request to the default servant. If no such +* exists, raise {@link org.omg.CORBA.OBJ_ADAPTER} with minor code 3. +* {@link IdUniquenessPolicyValue#MULTIPLE_ID} is also required. +* </li> +* <li>USE_SERVANT_MANAGER Dispatch request to the servant manager. If no such +* exists, raise {@link org.omg.CORBA.OBJ_ADAPTER} with the minor code 4.</li> +* </ul> +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public class RequestProcessingPolicyValue + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID (V1.4) for interoperability. + */ + private static final long serialVersionUID = 7646563512329907695L; + + /** + * The value field for the current instance. + */ + private final int _value; + + /** + * The possible value of this enumeration (USE_ACTIVE_OBJECT_MAP_ONLY). + */ + public static final int _USE_ACTIVE_OBJECT_MAP_ONLY = 0; + + /** + * An instance of RequestProcessingPolicyValue, initialized to USE_ACTIVE_OBJECT_MAP_ONLY. + */ + public static final RequestProcessingPolicyValue USE_ACTIVE_OBJECT_MAP_ONLY = + new RequestProcessingPolicyValue(_USE_ACTIVE_OBJECT_MAP_ONLY); + + /** + * The possible value of this enumeration (USE_DEFAULT_SERVANT). + */ + public static final int _USE_DEFAULT_SERVANT = 1; + + /** + * An instance of RequestProcessingPolicyValue, initialized to USE_DEFAULT_SERVANT. + */ + public static final RequestProcessingPolicyValue USE_DEFAULT_SERVANT = + new RequestProcessingPolicyValue(_USE_DEFAULT_SERVANT); + + /** + * The possible value of this enumeration (USE_SERVANT_MANAGER). + */ + public static final int _USE_SERVANT_MANAGER = 2; + + /** + * An instance of RequestProcessingPolicyValue, initialized to USE_SERVANT_MANAGER. + */ + public static final RequestProcessingPolicyValue USE_SERVANT_MANAGER = + new RequestProcessingPolicyValue(_USE_SERVANT_MANAGER); + + /** + * The private array that maps integer codes to the enumeration + * values. + */ + private static final RequestProcessingPolicyValue[] enume = + new RequestProcessingPolicyValue[] + { + USE_ACTIVE_OBJECT_MAP_ONLY, USE_DEFAULT_SERVANT, USE_SERVANT_MANAGER + }; + + /** + * The private array of state names. + */ + private static final String[] state_names = + new String[] + { + "USE_ACTIVE_OBJECT_MAP_ONLY", "USE_DEFAULT_SERVANT", "USE_SERVANT_MANAGER" + }; + + /** + * Normally, no new instances are required, so the constructor is protected. + */ + protected RequestProcessingPolicyValue(int a_value) + { + _value = a_value; + } + + /** + * Returns the RequestProcessingPolicyValue, matching the given integer constant. + * + * @param code one of _USE_ACTIVE_OBJECT_MAP_ONLY, _USE_DEFAULT_SERVANT, _USE_SERVANT_MANAGER. + * @return one of USE_ACTIVE_OBJECT_MAP_ONLY, USE_DEFAULT_SERVANT, USE_SERVANT_MANAGER. + * @throws BAD_PARAM if the parameter is not one of the valid values. + */ + public static RequestProcessingPolicyValue from_int(int code) + { + try + { + return enume [ code ]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; + } + } + + /** + * Returns a short string representation. + * @return the name of the current enumeration value. + */ + public String toString() + { + return state_names [ _value ]; + } + + /** + * Returns the integer code of the policy value. + * @return one of _USE_ACTIVE_OBJECT_MAP_ONLY, + * _USE_DEFAULT_SERVANT, _USE_SERVANT_MANAGER. + */ + public int value() + { + return _value; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.java b/libjava/classpath/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.java new file mode 100644 index 000000000..89813b921 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.java @@ -0,0 +1,52 @@ +/* SERVANT_RETENTION_POLICY_ID.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + + /** + * Holds an integer {@link ServantRetentionPolicy} identifier. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface SERVANT_RETENTION_POLICY_ID +{ + /** + * Specifies the SERVANT_RETENTION_POLICY_ID value, 21. + */ + int value = 21; +} diff --git a/libjava/classpath/org/omg/PortableServer/Servant.java b/libjava/classpath/org/omg/PortableServer/Servant.java new file mode 100644 index 000000000..53b05f1e5 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/Servant.java @@ -0,0 +1,296 @@ +/* Servant.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.ORB; +import org.omg.PortableServer.POAPackage.ServantNotActive; +import org.omg.PortableServer.POAPackage.WrongPolicy; +import org.omg.PortableServer.portable.Delegate; + +import gnu.CORBA.Minor; +import gnu.CORBA.Poa.ORB_1_4; +import gnu.CORBA.Poa.gnuPOA; + +/** + * <p> + * The servant is responsible for handling the method invocation on the + * target object. It can be one servant per object, or the same servant can + * support several (possibly all) objects, associated with the given POA. + * </p> <p> + * Till JDK 1.3 inclusive, a typical IDL to java compiler generates an + * implementation base (name pattern _*ImplBase.java) that is derived from the + * {@link org.omg.CORBA.portable.ObjectImpl}. Since JDK 1.4 the implementation + * base is derived from the Servant, also having a different name pattern + * (*POA.java). This suffix may be confusing, as the servant itself is + * <i>not</i> POA nor it is derived from it. + * </p><p> + * In both cases, the implementation base also inherits an interface, containing + * definitions of the application specific methods. The application programmer + * writes a child of the implementation base, implementing these methods + * for the application-specific functionality. The ObjectImpl is connected + * directly to the ORB. The Servant is connected to POA that can be obtained + * from the ORB. + * </p><p> + * If the servant is connected to more than one object, the exact object + * being currently served can be identified with {@link #_object_id}. + * </p><p> + * The derivativ of Servant, being directly connected to serve requests, + * must inherit either from {@link org.omg.CORBA.portable.InvokeHandler} + * or from {@link org.omg.PortableServer.DynamicImplementation}). + * </p><p> + * The Servant type is a CORBA <code>native</code> type. + * </p> + * + * @see POA#servant_to_reference(Servant) + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class Servant +{ + /** + * The delegate, where calls to some Servant methods are forwarded. + */ + private Delegate delegate; + + /** + * Get the repository ids of all interfaces, supported by the + * CORBA object, identified by the passed Id. In the typical code the + * passed parameters are ignored, returning an array of repository ids, + * supported by the servant implementation. + * + * @param poa a POA of the given object. + * @param object_ID the object Id of the given object. + * + * @return an array, containing the repository ids. + */ + public abstract String[] _all_interfaces(POA poa, byte[] object_ID); + + /** + * Get the delegate, where calls to some Servant methods are forwarded. + */ + public final Delegate _get_delegate() + { + if (delegate == null) { + throw new BAD_INV_ORDER + ("The Servant has not been associated with an ORBinstance"); + } + return delegate; + } + + /** + * Get the interface repository definition <code>InterfaceDef</code> for this + * Object. By default, forwards request to the delegate. + * + * @specnote The interface repository is officially not implemented up till + * JDK 1.5 inclusive. The delegate throws NO_IMPLEMENT, always. + */ + public org.omg.CORBA.Object _get_interface_def() + { + throw new NO_IMPLEMENT(); + } + + /** + * Checks if the passed servant is an instance of the given CORBA IDL type. + * By default, forwards the requet to the delegate. + * + * @param repository_id a repository ID, representing an IDL type for that the + * servant must be checked. + * + * @return true if the servant is an instance of the given type, false + * otherwise. + */ + public boolean _is_a(String repository_id) + { + return delegate.is_a(this, repository_id); + } + + /** + * Determines if the server object for this reference has already + * been destroyed. By default, forwards request to the delegate. + * + * @return true if the object has been destroyed, false otherwise. + */ + public boolean _non_existent() + { + return delegate.non_existent(this); + } + + /** + * Returns the ORB that is directly associated with the given servant. + * In this implementation, the method is overridden to return + */ + public final ORB _orb() + { + return delegate.orb(this); + } + + /** + * Returns the root POA of the ORB instance, associated with this servant. + * It is the same POA that would be returned by resolving the initial + * reference "RootPOA" for that orb. By default, forwards request to the + * delegate. + * + * @see ORB#resolve_initial_references + */ + public POA _default_POA() + { + return delegate == null ? null : delegate.default_POA(this); + } + + /** + * Return the invocation target object identifier as a byte array. + * This is typically used when the same servant serves multiple objects, + * and the object id can encapsulated the whole description of the + * object. + * + * This method returns correct values even when the same + * servant serves several objects in parallel threads. The ORB maintains the + * thread to invocation data map for all calls that are currently being + * processed. + */ + public final byte[] _object_id() + { + if (delegate != null) + return delegate.object_id(this); + else + throw new OBJECT_NOT_EXIST(); + } + + /** + * Get POA that is directly associated with the given servant. + * By default, forwards request to the delegate. + */ + public final POA _poa() + { + return delegate.poa(this); + } + + /** + * Set the delegate for this servant. + */ + public final void _set_delegate(Delegate a_delegate) + { + delegate = a_delegate; + } + + /** + * Obtains the CORBA object reference that is a current invocation target for + * the given servant. This is important when the same servant serves + * multiple objects. If the servant is not yet connected to the passed + * orb, the method will try to connect it to that orb on POA, returned + * by the method {@link #_default_POA}. That method can be overridden to + * get poa where the object must be automatically connected when + * calling this method. + * + * @param an_orb the ORB with relate to that the object is requested. + */ + public final org.omg.CORBA.Object _this_object(ORB an_orb) + { + if (delegate != null) + return delegate.this_object(this); + else + { + if (an_orb instanceof ORB_1_4) + { + ORB_1_4 m_orb = (ORB_1_4) an_orb; + + gnuPOA dp = (gnuPOA) _default_POA(); + if (dp == null) + dp = m_orb.rootPOA; + + try + { + return dp.servant_to_reference(this); + } + catch (WrongPolicy unexp) + { + BAD_OPERATION bad = new BAD_OPERATION(); + bad.minor = Minor.Policy; + bad.initCause(unexp); + throw bad; + } + catch (ServantNotActive ex) + { + try + { + return dp.id_to_reference(dp.activate_object(this)); + } + catch (Exception unexp) + { + unexp.initCause(ex); + + BAD_OPERATION bad = new BAD_OPERATION(); + bad.minor = Minor.Activation; + bad.initCause(unexp); + throw bad; + } + } + } + } + throw new OBJECT_NOT_EXIST(); + } + + /** + * Obtains the CORBA object reference that is a current invocation target for + * the given servant. This is important when the same servant serves + * multiple objects. This method required the servant to be connected + * to a single orb, and a delegate set. + * + * This method returns correct values even when the same + * servant serves several objects in parallel threads. The ORB maintains the + * thread to invocation data map for all calls that are currently being + * processed. + */ + public final org.omg.CORBA.Object _this_object() + { + if (delegate != null) + return _this_object(_orb()); + else + { + POA def = _default_POA(); + if (def instanceof gnuPOA) + return _this_object(((gnuPOA) def).orb()); + } + throw new OBJECT_NOT_EXIST(); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantActivator.java b/libjava/classpath/org/omg/PortableServer/ServantActivator.java new file mode 100644 index 000000000..82cfbda0d --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantActivator.java @@ -0,0 +1,59 @@ +/* ServantActivator.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * The POA, that has the RETAIN policy uses servant managers that are + * ServantActivators. The operations, that must be supported by these + * managers, are defined separately in {@link ServantActivatorOperations}. + * + * @see ServantLocator + * @see ServantRetentionPolicyValue + * @see ServantManager + * @see POAOperations#set_servant_manager + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantActivator + extends ServantManager, ServantActivatorOperations, IDLEntity, + org.omg.CORBA.Object +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java b/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java new file mode 100644 index 000000000..d0fe8732c --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantActivatorHelper.java @@ -0,0 +1,170 @@ +/* ServantActivatorHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the CORBA object {@link ServantActivator}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class ServantActivatorHelper +{ + /** + * Get the type code of the {@link ServantActivator}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_interface_tc(id(), "ServantActivator"); + } + + /** + * Insert the ServantActivator into the given Any. + * + * @param any the Any to insert into. + * @param that the ServantActivator to insert. + */ + public static void insert(Any any, ServantActivator that) + { + any.insert_Object(that); + } + + /** + * Extract the ServantActivator from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain ServantActivator. + */ + public static ServantActivator extract(Any any) + { + return narrow(any.extract_Object()); + } + + /** + * Get the ServantActivator repository id. + * + * @return "IDL:omg.org/PortableServer/ServantActivator:2.3", always. + */ + public static String id() + { + return "IDL:omg.org/PortableServer/ServantActivator:2.3"; + } + + /** + * Casts the passed object into the ServantActivator. + * + * @param obj the object to cast. + * @return casted instance. + * @throws BAD_PARAM if the passed object is not a ServantActivator. + */ + public static ServantActivator narrow(org.omg.CORBA.Object obj) + { + try + { + return (ServantActivator) obj; + } + catch (ClassCastException ex) + { + BAD_PARAM bad = new BAD_PARAM(); + bad.initCause(ex); + throw bad; + } + } + + /** + * Narrow the given object to the ServantActivator. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted ServantActivator. + * + * @since 1.5 + */ + public static ServantActivator unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + + /** + * This should read the servant activator, but it cannot be transferred + * this way as its operations cannot be remote. The operations cannot + * be remote because one of the method parameters, POA, is required to be + * always a local object (both by 1.5 API and 3.0.3 OMG). + * + * @throws MARSHAL, always. + * + * @specnote Same as Sun. + */ + public static ServantActivator read(InputStream input) + { + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; + } + + /** + * This should write the servant activator, but it cannot be transferred + * this way as its operations cannot be remote. The operations cannot + * be remote because one of the method parameters, POA, is required to be + * always a local object (both by 1.5 API and 3.0.3 OMG). + * + * @throws MARSHAL, always. + * + * @specnote Same as Sun. + */ + public static void write(OutputStream output, ServantActivator value) + { + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantActivatorOperations.java b/libjava/classpath/org/omg/PortableServer/ServantActivatorOperations.java new file mode 100644 index 000000000..22fba9d9e --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantActivatorOperations.java @@ -0,0 +1,94 @@ +/* ServantActivatorOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + + +/** + * Defines the operations, applicable to the {@link ServantActivator}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantActivatorOperations + extends ServantManagerOperations +{ + /** + * This method is invoked whenever a servant for an object is deactivated, + * assuming the POA has the USE_SERVANT_MANAGER and RETAIN policies. + * + * @param Object_Id the Id of the object being deactivated. + * + * @param poa the POA in those scope the object was active. + * + * @param servant the servant, serving the object being deactivated. + * + * @param cleanup_in_progress if true, this method was called from due + * deactivation or destruction operation. False indicates that the method + * was called due other reasons. + * + * @param remaining_activations if true, at the invocation moment the + * passed servant is also associated with other objects in the active + * object map of the given POA. + */ + void etherealize(byte[] Object_Id, POA poa, Servant servant, + boolean cleanup_in_progress, boolean remaining_activations + ); + + /** + * This method is invoked whenever the POA receives a request for an + * object that is not currently active, assuming the POA has the + * USE_SERVANT_MANAGER and RETAIN policies. The user-supplied servant + * manager is responsible for locating or creating an appropriate servant + * that corresponds to the ObjectId value. The subsequent requests with + * the same ObjectId value will be delivered directly to that servant + * without invoking the servant manager. + * + * @param Object_Id the ObjectId value associated with the incoming request. + * @param poa the POA in which the object is being activated. + * + * @return a servant that will be used to process the incoming request. + * + * @throws ForwardRequest if the activator decides to forward the request + * to another object. The exception contains the object that should + * handle this request. This object is usually remote, but can also + * be local. The throws exception will forward all subsequent requests + * till the new activation. + */ + Servant incarnate(byte[] Object_Id, POA poa) + throws ForwardRequest; +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantActivatorPOA.java b/libjava/classpath/org/omg/PortableServer/ServantActivatorPOA.java new file mode 100644 index 000000000..a6460fa14 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantActivatorPOA.java @@ -0,0 +1,137 @@ +/* ServantActivatorPOA.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Poa.gnuServantObject; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.ORB; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.InvokeHandler; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.ResponseHandler; + +/** + * <p>This ServantActivator stub is an optional base for the + * servant activators. This stub cannot serve remote invocations, as + * methods in {@link ServantActivatorOperations} take POA as one of parameters. + * Both JDK 1.5 API and OMG specifies that POA is a local object that must not + * be transferred to the remote invocation target. + * </p><p> + * You do not need to derive your servant activator from this stub, + * it is enough to implement the {@link ServantActivator} interface. + * But you may choose to do this if you need the functional + * {@link #_all_interfaces(POA, byte[])} method or want to keep default + * behavior during the incarnation or etherialization. + * </p> + */ +public abstract class ServantActivatorPOA + extends Servant + implements InvokeHandler, ServantActivatorOperations +{ + /** + * Used to access the outer class in the nested delegator class. + */ + final ServantActivatorPOA THIS = this; + + /** + * This class is used to support _this. + */ + class delegator + extends gnuServantObject + implements ServantActivator + { + delegator(Servant s) + { + super(s, new byte[ 0 ], null, null); + } + + public Servant incarnate(byte[] key, POA poa) + throws org.omg.PortableServer.ForwardRequest + { + return THIS.incarnate(key, poa); + } + + public void etherealize(byte[] key, POA poa, Servant servant, + boolean cleanup, boolean remains + ) + { + THIS.etherealize(key, poa, servant, cleanup, remains); + } + } + + /** + * Our implementation will not call this method. After setting your + * manager to POA, it will call incarnate and etherialize directly. + */ + public OutputStream _invoke(String method, InputStream input, + ResponseHandler handler + ) + throws SystemException + { + throw new NO_IMPLEMENT(); + } + + /** + * Returns an array of interfaces, supported by the servant activator. + */ + public String[] _all_interfaces(POA poa, byte[] Object_Id) + { + return new _ServantActivatorStub()._ids(); + } + + /** + * Return the complete instance of the servant activator, based on + * the current class (ServantActivatorPOA or derived). + */ + public ServantActivator _this() + { + return new delegator(this); + } + + /** + * Return the complete instance of the servant activator, based on + * the current class (ServantActivatorPOA or derived). + */ + public ServantActivator _this(ORB orb) + { + return new delegator(this); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocator.java b/libjava/classpath/org/omg/PortableServer/ServantLocator.java new file mode 100644 index 000000000..564048d45 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantLocator.java @@ -0,0 +1,59 @@ +/* ServantLocator.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * When the POA has the NON_RETAIN policy it uses servant managers that are + * ServantLoacators. The operations, that must be supported by these managers, + * are defined separately in {@link ServantLocatorOperations}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + * + * @see ServantActivator + * @see ServantRetentionPolicyValue + * @see ServantManager + * @see POAOperations#set_servant_manager + */ +public interface ServantLocator + extends ServantManager, ServantLocatorOperations, IDLEntity, + org.omg.CORBA.Object +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java b/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java new file mode 100644 index 000000000..f22fff9eb --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorHelper.java @@ -0,0 +1,170 @@ +/* ServantLocatorHelper.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; +import gnu.CORBA.OrbRestricted; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +/** +* The helper operations for the CORBA object {@link ServantLocator}. +* +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public abstract class ServantLocatorHelper +{ + /** + * Get the type code of the {@link ServantLocator}. + */ + public static TypeCode type() + { + return OrbRestricted.Singleton.create_interface_tc(id(), "ServantLocator"); + } + + /** + * Insert the ServantLocator into the given Any. + * + * @param any the Any to insert into. + * @param that the ServantLocator to insert. + */ + public static void insert(Any any, ServantLocator that) + { + any.insert_Object(that); + } + + /** + * Extract the ServantLocator from given Any. + * + * @throws BAD_OPERATION if the passed Any does not contain ServantLocator. + */ + public static ServantLocator extract(Any any) + { + return narrow(any.extract_Object()); + } + + /** + * Get the ServantLocator repository id. + * + * @return "org.omg.PortableServer.ServantLocatorOperations", always. + */ + public static String id() + { + return "org.omg.PortableServer.ServantLocatorOperations"; + } + + /** + * Cast the passed object into the ServantLocator. + * + * @param obj the object to narrow. + * @return narrowed instance. + * @throws BAD_PARAM if the passed object is not a ServantLocator. + */ + public static ServantLocator narrow(org.omg.CORBA.Object obj) + { + try + { + return (ServantLocator) obj; + } + catch (ClassCastException ex) + { + BAD_OPERATION bad = new BAD_OPERATION(); + bad.minor = Minor.ClassCast; + bad.initCause(ex); + throw bad; + } + } + + /** + * Narrow the given object to the ServantLocator. For the objects that are + * always local, this operation does not differ from the ordinary + * {@link #narrow} (ClassCastException will be thrown if narrowing something + * different). See OMG issue 4158. + * + * @param obj the object to cast. + * + * @return the casted ServantLocator. + * + * @since 1.5 + */ + public static ServantLocator unchecked_narrow(org.omg.CORBA.Object obj) + { + return narrow(obj); + } + + /** + * This should read the servant locator, but it cannot be transferred + * this way as its operations cannot be remote. The operations cannot + * be remote because one of the method parameters, POA, is required to be + * always a local object (both by 1.5 API and 3.0.3 OMG). + * + * @throws MARSHAL, always. + * + * @specnote Same as Sun. + */ + public static ServantLocator read(InputStream input) + { + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; + } + + /** + * This should write the servant activator, but it cannot be transferred + * this way as its operations cannot be remote. The operations cannot + * be remote because one of the method parameters, POA, is required to be + * always a local object (both by 1.5 API and 3.0.3 OMG). + * + * @throws MARSHAL, always. + * + * @specnote Same as Sun. + */ + public static void write(OutputStream output, ServantLocator value) + { + MARSHAL m = new MARSHAL("Inappropriate"); + m.minor = Minor.Inappropriate; + throw m; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java b/libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java new file mode 100644 index 000000000..4f357576a --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorOperations.java @@ -0,0 +1,96 @@ +/* ServantLocatorOperations.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; + +/** + * Defines the operations, applicable to the {@link ServantLocator}. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantLocatorOperations + extends ServantManagerOperations +{ + /** + * If the POA has the USE_SERVANT_MANAGER and NON_RETAIN policies, it + * invokes this method whenever the object being requested that is not + * inactive. This method has access to all details of the received + * request and can use them to choose between servaral alternative servants. + * It can also forward the request to another server. + * + * @param Object_Id the id of the object, on which the request was called. + * @param poa the POA in those scope the object is active. + * @param operation the name of the method or operation being invoked. + * @param cookie_holder the holder where the servant manager can store + * an arbitrary java.lang.Object. This object will be later passed as a + * <code>cookie</code> parameter for {@link #postinvoke}, to create tie + * between preinvoke and postinvoke. The application should <i>not</i> + * suppose that each call of preinvoke is followed by the subsequent + * postinvoke for the same invocation; under multi threaded policy these + * calls may be intermixed. + * + * @return a servant that will serve the incoming request. + * + * @throws ForwardRequest if the locator decides to forward the request + * to another object. The exception contains the object that should + * handle this request. This object is usually remote, but can also + * be local. As <code>preinvoke</code> is called on each method + * invocation, the thrown exception will forward only this current request. + */ + Servant preinvoke(byte[] Object_Id, POA poa, String operation, + CookieHolder cookie_holder + ) + throws ForwardRequest; + + /** + * If the POA has the USE_SERVANT_MANAGER and NON_RETAIN policies, it + * invokes this method whenever a servant completes a request. + * + * @param Object_Id the id of the object, on which the request was called. + * @param poa the POA in those scope the object is active. + * @param operation the name of the method or operation that was invoked. + * @param cookie the object that has been previously set by preinvoke in + * the <code>cookie_holder</code> parameter. + * @param servant the servant, associated with the object. + */ + void postinvoke(byte[] Object_Id, POA poa, String operation, + java.lang.Object cookie, Servant servant + ); +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorPOA.java b/libjava/classpath/org/omg/PortableServer/ServantLocatorPOA.java new file mode 100644 index 000000000..c598aa8bd --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorPOA.java @@ -0,0 +1,146 @@ +/* ServantLocatorPOA.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Poa.gnuServantObject; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.ORB; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.InvokeHandler; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.ResponseHandler; +import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; + +/** + * <p>The ServantLocator stub is an optional base for the + * servant locators. It cannot serve remote invocations, as + * methods in {@link ServantLocatorOperations} take POA as one of parameters. + * Both JDK 1.5 API and OMG specifies that POA is a local object that must not + * be transferred to the remote invocation target. + * </p><p> + * You do not need to derive your servant locator from this stub, + * it is enough to implement the {@link ServantLocator} interface. + * But you may choose to do this if you need its functional + * {@link org.omg.PortableServer.ServantActivatorPOA.delegator#_ids()} + * method or want to keep default behaviour during pre- or post- invokcations. + * </p> + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public abstract class ServantLocatorPOA + extends Servant + implements ServantLocatorOperations, InvokeHandler +{ + /** + * Used to access the outer class in the nested classes. + */ + final ServantLocatorPOA THIS = this; + + /** + * Our implementation will not call this method. After setting your + * manager to POA, it will call incarnate and etherialize directly. + */ + public OutputStream _invoke(String method, InputStream input, + ResponseHandler handler + ) + throws SystemException + { + throw new NO_IMPLEMENT(); + } + + /** + * Returns an array of interfaces, supported by the servant locator. + */ + public String[] _all_interfaces(POA poa, byte[] Object_Id) + { + return new _ServantLocatorStub()._ids(); + } + + /** + * Return the complete instance of the servant activator, based on + * the current class (ServantActivatorPOA or derived). + */ + public ServantLocator _this() + { + return new delegator(this); + } + + /** + * Return the complete instance of the servant activator, based on + * the current class (ServantActivatorPOA or derived). + */ + public ServantLocator _this(ORB orb) + { + return new delegator(this); + } + + /** + * This class is used to support _this. + */ + class delegator + extends gnuServantObject + implements ServantLocator + { + delegator(Servant s) + { + super(s, new byte[ 0 ], null, null); + } + + public Servant preinvoke(byte[] Object_Id, POA poa, String method, + CookieHolder cookie_holder + ) + throws org.omg.PortableServer.ForwardRequest + { + return THIS.preinvoke(Object_Id, poa, method, cookie_holder); + } + + public void postinvoke(byte[] Object_Id, POA poa, String method, + java.lang.Object cookie, Servant servant + ) + { + THIS.postinvoke(Object_Id, poa, method, cookie, servant); + } + + public String[] _ids() + { + return THIS._all_interfaces(null, null); + } + } +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.java b/libjava/classpath/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.java new file mode 100644 index 000000000..ff23e7fd1 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.java @@ -0,0 +1,114 @@ +/* CookieHolder.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.ServantLocatorPackage; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.Streamable; + +/** + * The CookieHolder is used together with the + * {@link org.omg.PortableServer.ServantLocator}, allowing the + * {@link org.omg.PortableServer.ServantLocatorOperations#preinvoke} + * to return an arbitrary java.lang.Object that will be later passed to + * {@link org.omg.PortableServer.ServantLocatorOperations#postinvoke}. + * + * @see org.omg.PortableServer.ServantLocatorOperations + * @see org.omg.PortableServer.ServantManager + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public final class CookieHolder + implements Streamable +{ + /** + * The wrapped java.lang.Object. + */ + public java.lang.Object value; + + /** + * Create the unitialised instance of this holder. + */ + public CookieHolder() + { + } + + /** + * Create the instance, intialising the {@link #value} field to the passed + * value. + */ + public CookieHolder(java.lang.Object initial) + { + value = initial; + } + + /** + * java.lang.Object is outside the scope of the CORBA standards and the read + * operation cannot be supported in a language-neutral way. + * + * @throws NO_IMPLEMENT always. + */ + public void _read(InputStream input) + { + throw new NO_IMPLEMENT(); + } + + /** + * There is no CORBA typecode that would specifically match a java.lang.Object. + * + * @throws NO_IMPLEMENT always. + */ + public TypeCode _type() + { + throw new NO_IMPLEMENT(); + } + + /** + * java.lang.Object is outside the scope of the CORBA standards and the write + * operation cannot be supported in a language-neutral way. + * + * @throws NO_IMPLEMENT always. + */ + public void _write(OutputStream output) + { + throw new NO_IMPLEMENT(); + } +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantLocatorPackage/package.html b/libjava/classpath/org/omg/PortableServer/ServantLocatorPackage/package.html new file mode 100644 index 000000000..58106e25f --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantLocatorPackage/package.html @@ -0,0 +1,49 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. --> + +<html> +<head><title>GNU Classpath - org.omg.PortableServer.ServantLocatorPackage</title> +</head> + +<body> +<p>Contains a holder, transferring the data between subsequent + calls of the Servant Manager methods.</p> + +@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +</body> +</html> diff --git a/libjava/classpath/org/omg/PortableServer/ServantManager.java b/libjava/classpath/org/omg/PortableServer/ServantManager.java new file mode 100644 index 000000000..f361f0430 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantManager.java @@ -0,0 +1,56 @@ +/* ServantManager.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * A servant manager is associated with POA and provide possibility + * to activate objects on demand. A servant manager interface itself + * is empty, but it is inherited by other two interfaces, + * {@link ServantActivator} and {@link ServantLocator}. + * + * @see POAOperations#set_servant_manager + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantManager + extends ServantManagerOperations, IDLEntity, org.omg.CORBA.Object +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantManagerOperations.java b/libjava/classpath/org/omg/PortableServer/ServantManagerOperations.java new file mode 100644 index 000000000..374b791a1 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantManagerOperations.java @@ -0,0 +1,54 @@ +/* ServantManagerOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +/** + * This interface would define the operations, applicable to + * the ServantManager. A servant manager interface itself + * is empty, but it is inherited by other two interfaces, + * {@link ServantActivator} and {@link ServantLocator}. + * + * @see ServantActivatorOperations + * @see ServantLocatorOperations + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantManagerOperations +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicy.java b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicy.java new file mode 100644 index 000000000..3da47d3d8 --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicy.java @@ -0,0 +1,58 @@ +/* ServantRetentionPolicy.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.portable.IDLEntity; + +/** + * Specifies if the active servants should be retained in the + * Active Object Map. + * + * The policy can return its current value, as defined. + * in {@link ServantRetentionPolicyOperations}. + * + * @see ServantRetentionPolicyValue for the possible values of this policy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantRetentionPolicy + extends Policy, ServantRetentionPolicyOperations, IDLEntity +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyOperations.java new file mode 100644 index 000000000..3a9ee0a7c --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyOperations.java @@ -0,0 +1,55 @@ +/* ServantRetentionPolicyOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.PolicyOperations; + +/** + * Defines the operations, applicable to the ServantRetentionPolicy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ServantRetentionPolicyOperations + extends PolicyOperations +{ + /** + * Return the value of this policy type, stated by the current instance. + */ + ServantRetentionPolicyValue value(); +} diff --git a/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java new file mode 100644 index 000000000..4dffe7d7f --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ServantRetentionPolicyValue.java @@ -0,0 +1,155 @@ +/* ServantRetentionPolicyValue.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** +* Specifies the servant retention policy. +* +* This enumeration can obtain the following values: +* <ul> +* <li>RETAIN The POA retains active servants in its Active Object Map.</li> +* <li>NON_RETAIN The servants are not retained.</li> +* </ul> +* @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +*/ +public class ServantRetentionPolicyValue + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID (V1.4) for interoperability. + */ + private static final long serialVersionUID = -7476100336036943822L; + + /** + * The value field for the current instance. + */ + private final int _value; + + /** + * The possible value of this enumeration (RETAIN). + */ + public static final int _RETAIN = 0; + + /** + * An instance of ServantRetentionPolicyValue, indicating that + * the POA retains active servants in its Active Object Map. + */ + public static final ServantRetentionPolicyValue RETAIN = + new ServantRetentionPolicyValue(_RETAIN); + + /** + * The possible value of this enumeration (NON_RETAIN). + */ + public static final int _NON_RETAIN = 1; + + /** + * An instance of ServantRetentionPolicyValue, indicating that + * the POA does not use the Active Object Map. + */ + public static final ServantRetentionPolicyValue NON_RETAIN = + new ServantRetentionPolicyValue(_NON_RETAIN); + + /** + * The private array that maps integer codes to the enumeration + * values. + */ + private static final ServantRetentionPolicyValue[] enume = + new ServantRetentionPolicyValue[] { RETAIN, NON_RETAIN }; + + /** + * The private array of state names. + */ + private static final String[] state_names = + new String[] { "RETAIN", "NON_RETAIN" }; + + /** + * Normally, no new instances are required, so the constructor is protected. + */ + protected ServantRetentionPolicyValue(int a_value) + { + _value = a_value; + } + + /** + * Returns the ServantRetentionPolicyValue, matching the given integer constant. + * + * @param code one of _RETAIN, _NON_RETAIN. + * @return one of RETAIN, NON_RETAIN. + * @throws BAD_PARAM if the parameter is not one of the valid values. + */ + public static ServantRetentionPolicyValue from_int(int code) + { + try + { + return enume [ code ]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; + } + } + + /** + * Returns a short string representation. + * @return the name of the current enumeration value. + */ + public String toString() + { + return state_names [ _value ]; + } + + /** + * Returns the integer code of the policy value. + * @return _RETAIN or _NON_RETAIN. + */ + public int value() + { + return _value; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/THREAD_POLICY_ID.java b/libjava/classpath/org/omg/PortableServer/THREAD_POLICY_ID.java new file mode 100644 index 000000000..ef0427dde --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/THREAD_POLICY_ID.java @@ -0,0 +1,52 @@ +/* THREAD_POLICY_ID.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + + /** + * Holds an integer {@link ThreadPolicy} identifier. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface THREAD_POLICY_ID +{ + /** + * Specifies the THREAD_POLICY_ID value, 16. + */ + int value = 16; +} diff --git a/libjava/classpath/org/omg/PortableServer/ThreadPolicy.java b/libjava/classpath/org/omg/PortableServer/ThreadPolicy.java new file mode 100644 index 000000000..77fe0a67c --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ThreadPolicy.java @@ -0,0 +1,57 @@ +/* ThreadPolicy.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.portable.IDLEntity; + +/** + * Defines the POA thread policy. + * + * The policy can return its current value, as defined. + * in {@link ThreadPolicyOperations}. + * + * @see ThreadPolicyValue for the possible values of this policy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ThreadPolicy + extends Policy, ThreadPolicyOperations, IDLEntity +{ +} diff --git a/libjava/classpath/org/omg/PortableServer/ThreadPolicyOperations.java b/libjava/classpath/org/omg/PortableServer/ThreadPolicyOperations.java new file mode 100644 index 000000000..09835614f --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ThreadPolicyOperations.java @@ -0,0 +1,55 @@ +/* ThreadPolicyOperations.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.PolicyOperations; + +/** + * Defines the operations, applicable to the ThreadPolicy. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface ThreadPolicyOperations + extends PolicyOperations +{ + /** + * Return the value of this policy type, stated by the current instance. + */ + ThreadPolicyValue value(); +} diff --git a/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java b/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java new file mode 100644 index 000000000..4e1422dcd --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/ThreadPolicyValue.java @@ -0,0 +1,168 @@ +/* ThreadPolicyValue.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import gnu.CORBA.Minor; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.portable.IDLEntity; + +import java.io.Serializable; + +/** + * Defines the possible values for the POA thread policy. + * + * This enumeration can obtain the following values: + * <ul> + * <li>ORB_CTRL_MODEL Each object in POA has a separate serving thread + * and a separate server socket, listening on the objects individual + * port. Additionally, when the request is accepted, it is also + * served in a separate thread, so several requests to the same + * object can be processed in parallel. The servant can always get + * the Id and POA of the object it is currently serving by + * invoking {@link Servant#_object_id()} and {@link Servant#_poa}. + * These two methods use thread to data map and must work correctly + * even then the servant code is executed in several parallel threads. + * </li> + * <li>SINGLE_THREAD_MODEL All objects in POA share the same server + * socket and are served in the same thread. This model is applicable + * when the number of objects is greater than the number of threads + * and (or) ports, supported by the system.</li> + * </ul> + * OMG also defines a MAIN_THREAD_MODEL, currently not supported by + * the java API. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class ThreadPolicyValue + implements Serializable, IDLEntity +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -8874988828297141512L; + + /** + * The value field for the current instance. + */ + private final int _value; + + /** + * The possible value of this enumeration (ORB_CTRL_MODEL). + */ + public static final int _ORB_CTRL_MODEL = 0; + + /** + * An instance of ThreadPolicyValue, initialized to ORB_CTRL_MODEL. + */ + public static final ThreadPolicyValue ORB_CTRL_MODEL = + new ThreadPolicyValue(_ORB_CTRL_MODEL); + + /** + * The possible value of this enumeration (SINGLE_THREAD_MODEL). + */ + public static final int _SINGLE_THREAD_MODEL = 1; + + /** + * An instance of ThreadPolicyValue, initialized to SINGLE_THREAD_MODEL. + */ + public static final ThreadPolicyValue SINGLE_THREAD_MODEL = + new ThreadPolicyValue(_SINGLE_THREAD_MODEL); + + /** + * The private array that maps integer codes to the enumeration + * values. + */ + private static final ThreadPolicyValue[] enume = + new ThreadPolicyValue[] { ORB_CTRL_MODEL, SINGLE_THREAD_MODEL }; + + /** + * The private array of state names. + */ + private static final String[] state_names = + new String[] { "ORB_CTRL_MODEL", "SINGLE_THREAD_MODEL" }; + + /** + * Normally, no new instances are required, so the constructor is protected. + */ + protected ThreadPolicyValue(int a_value) + { + _value = a_value; + } + + /** + * Returns the ThreadPolicyValue, matching the given integer constant. + * + * @param code one of _ORB_CTRL_MODEL, _SINGLE_THREAD_MODEL. + * @return one of ORB_CTRL_MODEL, SINGLE_THREAD_MODEL. + * @throws BAD_PARAM if the parameter is not one of the valid values. + */ + public static ThreadPolicyValue from_int(int code) + { + try + { + return enume [ code ]; + } + catch (ArrayIndexOutOfBoundsException ex) + { + BAD_OPERATION bad = new BAD_OPERATION("Invalid policy code " + code); + bad.minor = Minor.PolicyType; + throw bad; + } + } + + /** + * Returns a short string representation. + * @return the name of the current enumeration value. + */ + public String toString() + { + return state_names [ _value ]; + } + + /** + * Returns the integer code of the enumeration value. + * @return one of ORB_CTRL_MODEL, SINGLE_THREAD_MODEL. + */ + public int value() + { + return _value; + } +} diff --git a/libjava/classpath/org/omg/PortableServer/_ServantActivatorStub.java b/libjava/classpath/org/omg/PortableServer/_ServantActivatorStub.java new file mode 100644 index 000000000..658ac683c --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/_ServantActivatorStub.java @@ -0,0 +1,124 @@ +/* _ServantActivatorStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import java.io.Serializable; + +import org.omg.CORBA.portable.ObjectImpl; + +/** + * <p>This ServantActivator stub is an optional base for the + * servant activators. This stub cannot accept remote invocations, as + * methods in {@link ServantActivatorOperations} take POA as one of parameters. + * Both JDK 1.5 API and OMG specifies that POA is a local object that must not + * be transferred to the remote invocation target. + * </p><p> + * You do not need to derive your servant activator from this stub, + * it is enough to implement the {@link ServantActivator} interface. + * But you may choose to do this if you need the functional + * {@link #_ids()} method or want to keep default behavior during + * the incarnation or etherialization. + * </p> + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class _ServantActivatorStub + extends ObjectImpl + implements ServantActivator, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -685959979577281419L; + + /** + * This the purpose of this field is undocumented up till 1.5 java API + * inclusive. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public static final Class _opsClass = ServantActivatorOperations.class; + + /** + * Return the array of repository ids for this object. + * + * @return { "IDL:omg.org/PortableServer/ServantActivator:2.3", + * "IDL:omg.org/PortableServer/ServantManager:1.0" }, always. + */ + public String[] _ids() + { + return new String[] + { + "IDL:omg.org/PortableServer/ServantActivator:2.3", + "IDL:omg.org/PortableServer/ServantManager:1.0" + }; + } + + /** + * It is your responsibility to handle the incarnation event and + * supply the servant. Override this method if using the class. + * The default method instructs POA that the servant cannot be + * provided by activator. The OBJ_ADAPTER exception will be + * thrown by POA, unless the servant is provided as one of the + * parameters in the activation method. + * + * @see ServantActivatorOperations#incarnate + * + * @specnote in GNU Classpath, returning null means that the + * activator does not supply the servant. + * + * @throws ForwardRequest + */ + public Servant incarnate(byte[] Object_id, POA poa) + throws ForwardRequest + { + return null; + } + + /** + * It is your responsibility to handle the etherialization event. + * Override this method if using the class. The default method + * does nothing. + * + * @see ServantActivatorOperations#incarnate + */ + public void etherealize(byte[] Object_id, POA poa, Servant servant, + boolean cleanup, boolean remaining + ) + { + } +} diff --git a/libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java b/libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java new file mode 100644 index 000000000..039140ebc --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/_ServantLocatorStub.java @@ -0,0 +1,133 @@ +/* _ServantLocatorStub.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer; + +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; + +import java.io.Serializable; + +/** + * <p>The ServantLocator stub is an optional base for the + * servant locators. This stub cannot accept remote invocations, as + * methods in {@link ServantLocatorOperations} take POA as one of parameters. + * Both JDK 1.5 API and OMG specifies that POA is a local object that must not + * be transferred to the remote invocation target. + * </p><p> + * You do not need to derive your servant locator from this stub, + * it is enough to implement the {@link ServantLocator} interface. + * But you may choose to do this if you need its functional + * {@link #_ids()} method or want to keep default behavior during per- + * or post- invokcations. + * </p> + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public class _ServantLocatorStub + extends ObjectImpl + implements ServantLocator, Serializable +{ + /** + * Use serialVersionUID (v1.4) for interoperability. + */ + private static final long serialVersionUID = -2374963516905770111L; + + /** + * This the purpose of this field is undocumented up till 1.5 java API + * inclusive. + */ + @SuppressWarnings("unchecked") // Needed for API compatibility + public static final Class _opsClass = ServantLocatorOperations.class; + + /** + * The package private string, used as a parameter for + * the throws NullPointerExceptions in both servant locator and activator + * stubs. + */ + static final String OVERRIDE = "Override this method to get functionality."; + + /** + * Return the array of repository ids for this object, stating that it is + * both Servant locator and Servant manager. + * + * @return { "IDL:omg.org/PortableServer/ServantLocator:1.0", + * "IDL:omg.org/PortableServer/ServantManager:1.0" }, always. + */ + public String[] _ids() + { + return new String[] + { + "IDL:omg.org/PortableServer/ServantLocator:1.0", + "IDL:omg.org/PortableServer/ServantManager:1.0" + }; + } + + /** + * It is your responsibility to take the preinvoke actions, if any, + * and also supply an appropriate servant for the current invocation. + * + * The default method instructs POA that the servant cannot be + * provided by locator. The OBJ_ADAPTER exception will be + * thrown by POA, unless it uses the available default servant for all + * invocations. + * + * @specnote in GNU Classpath, returning null means that the + * locator does not supply the servant. + * + * @see ServantLocatorOperations#preinvoke + */ + public Servant preinvoke(byte[] Object_id, POA poa, String method, + CookieHolder cookie + ) + throws ForwardRequest + { + return null; + } + + /** + * It is your responsibility to take the postinvoke actions, if any, + * by overriding this method. The default method does nothing. + * + * @see ServantLocatorOperations#postinvoke + */ + public void postinvoke(byte[] Object_id, POA poa, String method, + Object cookie, Servant servant + ) + { + } +} diff --git a/libjava/classpath/org/omg/PortableServer/package.html b/libjava/classpath/org/omg/PortableServer/package.html new file mode 100644 index 000000000..e4a74ef1a --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/package.html @@ -0,0 +1,231 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - describes classes in org.omg.PortableServer package + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. --> + +<html> +<head><title>GNU Classpath - The Portable Object Adapter package</title></head> +<body> +<p> +The Portable Object Adapter (POA) provides more control on the request +processing than it is possible when connecting objects directly to the +ORB. The POA model defines a tree structure of POAs, the root POA being +connected directly to the ORB. Any branch of this tree can be temporary or +permanently inactivated using {@link org.omg.PortableServer.POAManager}. +The same manager can control several branches in the POA tree. Also, +any branch in this tree can have different processing options (policies). +</p><p> +The newly created POA is in holding state, just queuing requests. To start +processing requests, it must be turned into the active state by its +{@link org.omg.PortableServer.POAManagerOperations#activate}. +</p><p> +The previously monolite object implementation is now divided into object +(that implements {@link org.omg.CORBA.Object}) +and servant (that implements either {@link org.omg.CORBA.portable.InvokeHandler} +or {@link org.omg.PortableServer.DynamicImplementation}). +Frequently each object has its own servant, but it can also be a single servant +per multiple objects and also default servant for POA +(see {@link org.omg.PortableServer.POAOperations#set_servant}). Each object +has its own Object Id, unique in the scope of the POA, where the object is +connected. These Ids need not be different for objects belonging +to different POAs, even if these POAs are connected to the same ORB. +Under the USER_ID is assignment policy this Id can be a specified by user in +{@link org.omg.PortableServer.POAOperations#activate_object_with_id}, +encapsulating some meaningful information about the object. The Id of the +object being currently served can be identified with +{@link org.omg.PortableServer.Servant#_object_id}. This approach is used in cases +when it is possible to encapsulate all object-related data into the +Object Id. Such system only needs one servant, one server socket and one +socket port per POA that can handle thounsands of objects. +</p><p> +Instead of being connected directly to the ORB, objects are now connected +to one of the ORBs POAs. Since JDK 1.4 the application specific implementation +base is derived from the {@link org.omg.PortableServer.Servant}, having a +different name pattern (<code>*POA.java</code> instead of the previous +<code>_*ImplBase.java</code>). This <code>*POA</code> suffix does <i>not</i> +mean that these servants implement or are derived from POA. They are different +classes that can be connected to one of the POAs, by instance, using +{@link org.omg.PortableServer.POAOperations#servant_to_reference}. +The implementation base also inherits an *Operations interface, containing +definitions of the application specific methods. The application programmer +writes a descendent of the implementation base, implementing these methods +for the application - specific functionality. +</p><p> +The POA objects support the method invocation by name, using +{@link org.omg.CORBA.Request}. This alternative method works without the +service-specific classes that may not be available at run time. +</p><p> +The objects in POA can also be activated and inactivated independently. It +is possible to set a listener ({@link org.omg.PortableServer.ServantActivator}) +that would register the object activations ("incarnations") and deactivations +("etherializations"). The servant need not be specifyed when creating an +object. Under the IMPLICIT_ACTIVATION +{@link org.omg.PortableServer.ImplicitActivationPolicy} +the {@link org.omg.PortableServer.ServantActivator} can provide the servant +in response to the first (local or remote) call of any method on the +previously incative object. +</p><p> +The root POA is obtained by resolving the initial reference "RootPOA" +for the orb. In the simpliest case the objects can be connected directly +to that root POA without creating the POA tree. The policies, used by +the root POA, are defined by OMG as following: +<table border="1"> +<tr><th>Policy type</th><th>Accepted policy</th></tr> +<tr><td>{@link org.omg.PortableServer.IdAssignmentPolicy} </td><td>SYSTEM_ID +(Ids are created by POA)</td></tr> +<tr><td>{@link org.omg.PortableServer.IdUniquenessPolicy}</td><td>UNIQUE_ID + (single object (and Id) per servant) +</td></tr> +<tr><td>{@link org.omg.PortableServer.ImplicitActivationPolicy} </td><td> +IMPLICIT_ACTIVATION (if inactive, activate)</td></tr> +<tr><td>{@link org.omg.PortableServer.LifespanPolicy} </td><td>TRANSIENT +(the POA objects cannot outlive POA)</td></tr> +<tr><td>{@link org.omg.PortableServer.RequestProcessingPolicy} </td><td> +USE_ACTIVE_OBJECT_MAP_ONLY (the servant is provided during activation)</td></tr> +<tr><td>{@link org.omg.PortableServer.ServantRetentionPolicy} </td><td> +RETAIN (retain servants for subsequent invocations)</td></tr> +<tr><td>{@link org.omg.PortableServer.ThreadPolicy} </td><td>ORB_CTRL_MODEL +(single thread per request and single server socket per object)</td></tr> +</table> +These values are also default for the child POAs The policies are +<i>never</i> inherited from the parent POA. +</p><p> +This set of policies means that each object will have a separate serving +thread, separate network socket port and usually a separate servant. It +is appropriate when the expected number of objects is not too large. +If the expected number of objects is larger than the supportable number +of threads and socket ports, the SINGLE_THREAD_MODEL +{@link org.omg.PortableServer.ThreadPolicy} is +used. Then all objects in POA with this policy are served in a single +thread, using the same server socket, connected to a single port. If the +request processing policy is additionally set to USE_DEFAULT_SERVANT, +all objects of this POA share the same (default) servant. +</p><p> +The operations, supported by POA are defined +separately in {@link org.omg.PortableServer.POAOperations}. +</p><p> +<h3>The typical POA usage scenarios</h3> +<h4>POA converts servant to the object reference</h4> +In the simpliest case, the servant implementation is connected to POA by +{@link org.omg.PortableServer.POAOperations#servant_to_reference}, the +returned object being a target of remote and local invocations. +It may be converted into the stringified reference, registered with +the naming service, used locally or, when serving or invoking local or remote +method, passed as a parameter or return value having the CORBA Object type. +The object obtains Id from POA and is activated due default implicit +activation policy. This scenario is supported by the default policy set +and is used in the most of the "hello world" examples. +<h4>Servant provides to the object reference</h4> +The servant can be connected to an ORB by +{@link org.omg.PortableServer.Servant#_this_object(org.omg.CORBA.ORB)}, +obtaining the object reference. The overridable +{@link org.omg.PortableServer.Servant#_default_POA()} +specifies POA to that the servant will be connected. The default method +connects to the root poa. IDL compilers frequently generate the +<code>_this(ORB)</code> metod for servants for getting the object reference +that is already narrowed to the exact object type. +<h4>Explicit activation with POA assigned ids</h4> +The objects are activated by calling the +{@link org.omg.PortableServer.POAOperations#activate_object} on the +POA with the object in question. The POA allocates, assigns, and +returns a unique identity value for the object. This scenario requires the +SYSTEM_ID {@link org.omg.PortableServer.IdAssignmentPolicy}. +<h4>Explicit Activation with User-assigned Ids</h4> +The POA supports an explicit activation operation, +{@link org.omg.PortableServer.POAOperations#activate_object_with_id}, +that associates a servant with the user-defined Object Id. +This scenario requires the USER_ID +{@link org.omg.PortableServer.IdAssignmentPolicy}. The servant manager +may be or may not be used. +<h4>References before activation</h4> +It may be useful to create references for objects before activating them. +Such reference can be created using +{@link org.omg.PortableServer.POAOperations#create_reference} or +{@link org.omg.PortableServer.POAOperations#create_reference_with_id}, both +methods also requiring to give the object repository id. Such object may +be later activated either by +{@link org.omg.PortableServer.POAOperations#activate_object_with_id} or +automatically, if the IMPLICIT_ACTIVATION policy applies. +<h4>Multiple Ids per servant</h4> +If the MULTIPLE_ID policy applies, the servant may be activated many times. +Under this policy, +{@link org.omg.PortableServer.POAOperations#servant_to_reference} +and {@link org.omg.PortableServer.POAOperations#servant_to_id} +during each call create a new object and object reference for the +used servant. +<h4>One servant for all objects</h4> +If the USE_DEFAULT_SERVANT policy applies, that default servant serves all +objects, belonging this POA. This approach is used when there is +very little data associated with each object, so little that the data can be +encoded in the Object Id. Also, it may be needed when a very large +number of objects is expected. If the RETAIN applies, it is possible to +activate an object explicitly setting the servant other than default. +If NO_RETAIN applies, the default servant will serve all known an +unknown objects for that POA. +<h4>Single Servant, Many Objects and Types</h4> +Combining USER_ID, USE_DEFAULT_SERVANT and RETAIN, it is possible to +create and serve objects "on the fly". The servant must determine the +object type (for instance, from the value of the agreed attribute, +shared by all supported types, or from the Object Id) and be able to +handle the method, named in request. If the names and parameter lists +of the object methods are also created "on the fly", the requests +to such object can still be submitted using {@link org.omg.CORBA.Request}. +This method is used when the created object represents some +entity in the complex database. +<h4>The ServantLocator finds a servant for each call</h4> +The {@link org.omg.PortableServer.ServantLocator} is used by POAs that +combinine NON_RETAIN and USE_SERVANT_MANAGER policies. It provides +a new or reused servant every time the invocation is made. The servant +locator must provide a servant in response of calling +{@link org.omg.PortableServer.ServantLocatorOperations#preinvoke}. +This method has access the the Id of the object being served and +the name of the method being called. It must return the appropriate +instance of the servant or throw an exception, forwarding the request +to another object (usually in another server). After the invocation, +a {@link org.omg.PortableServer.ServantLocatorOperations#postinvoke} +is called. It should be not assumed that the call of <code>preinvoke</code> +will be followed by the call of the <code>postinvoke</code>; in +multithreaded environment these calls are not serialized in this way. If +the <code>preinvoke</code> has to tell something this-call-specific to +the <code>postinvoke</code>, it must use the provided cookie holder. +The <code>preinvoke/postinoke</code> are also called to provide a servant +during each local invocation on the objects, belonging to the described POA. +</p><p> +All these scenarios must work with the current GNU Classpath release. + +@author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) +</body> +</html> diff --git a/libjava/classpath/org/omg/PortableServer/portable/Delegate.java b/libjava/classpath/org/omg/PortableServer/portable/Delegate.java new file mode 100644 index 000000000..32697fdfb --- /dev/null +++ b/libjava/classpath/org/omg/PortableServer/portable/Delegate.java @@ -0,0 +1,112 @@ +/* DelegateOperations.java -- + Copyright (C) 2005, 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package org.omg.PortableServer.portable; + +import org.omg.CORBA.ORB; +import org.omg.PortableServer.POA; +import org.omg.PortableServer.Servant; + +/** + * Each {@link Servant} has an associated delegate, where the most of the calls + * are forwarded. The delegate is responsible for providing the actual + * functionality. This class is required to supports a conceptions of + * the CORBA 2.3.1 Servant. + * + * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org) + */ +public interface Delegate +{ + /** + * Returns the root POA of the ORB instance, associated with this servant. + * It is the same POA that would be returned by resolving the initial + * reference "RootPOA" for that orb. The default {@link Servant#_default_POA()} + * method forwards call to the delegate can be overridden to + * obtain the alternative default POA. + * + * @see ORB#resolve_initial_references + */ + POA default_POA(Servant a_servant); + + /** + * Get the interface repository defintion + * <code>InterfaceDef</code> for this Object. + */ + org.omg.CORBA.Object get_interface_def(Servant a_servant); + + /** + * Checks if the passed servant is an instance of the given CORBA IDL type. + * + * @param a_servant a servant to check. + * @param an_id a repository ID, representing an IDL type for that the + * servant must be checked. + * + * @return true if the servant is an instance of the given type, false + * otherwise. + */ + boolean is_a(Servant a_servant, String an_id); + + /** + * Determines if the server object for this reference has already + * been destroyed. + * + * @return true if the object has been destroyed, false otherwise. + */ + boolean non_existent(Servant a_servant); + + /** + * Return the invocation target object identifier as a byte array. + */ + byte[] object_id(Servant a_servant); + + /** + * Returns the ORB that is directly associated with the given servant. + */ + ORB orb(Servant a_servant); + + /** + * Get POA that is directly associated with the given servant. + */ + POA poa(Servant a_servant); + + /** + * Obtains the CORBA object reference that is an invocation target for the + * given servant. + */ + org.omg.CORBA.Object this_object(Servant a_servant); +} |