0N/A/*
157N/A * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
157N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
157N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
157N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
157N/A * or visit www.oracle.com if you need additional information or have any
157N/A * questions.
0N/A */
0N/Apackage org.omg.CORBA.portable;
0N/A
0N/Aimport org.omg.CORBA.Request;
0N/Aimport org.omg.CORBA.NamedValue;
0N/Aimport org.omg.CORBA.NVList;
0N/Aimport org.omg.CORBA.Context;
0N/Aimport org.omg.CORBA.ContextList;
0N/Aimport org.omg.CORBA.ExceptionList;
0N/Aimport org.omg.CORBA.TypeCode;
0N/Aimport org.omg.CORBA.SystemException;
0N/A
0N/A/**
0N/A * Specifies a portable API for ORB-vendor-specific
0N/A * implementation of the org.omg.CORBA.Object methods.
0N/A *
0N/A * Each stub (proxy) contains a delegate
0N/A * object, to which all org.omg.CORBA.Object methods are forwarded.
0N/A * This allows a stub generated by one vendor's ORB to work with the delegate
0N/A * from another vendor's ORB.
0N/A *
0N/A * @see org.omg.CORBA.Object
0N/A * @author OMG
0N/A */
0N/A
0N/Apublic abstract class Delegate {
0N/A
0N/A /**
0N/A * Return an InterfaceDef for the object reference provided.
0N/A * @param self The object reference whose InterfaceDef needs to be returned
0N/A * @return the InterfaceDef
0N/A */
0N/A public abstract org.omg.CORBA.Object get_interface_def(
0N/A org.omg.CORBA.Object self);
0N/A
0N/A /**
0N/A * Returns a duplicate of the object reference provided.
0N/A * @param obj The object reference whose duplicate needs to be returned
0N/A * @return the duplicate object reference
0N/A */
0N/A public abstract org.omg.CORBA.Object duplicate(org.omg.CORBA.Object obj);
0N/A
0N/A /**
0N/A * Releases resources associated with the object reference provided.
0N/A * @param obj The object reference whose resources need to be released
0N/A */
0N/A public abstract void release(org.omg.CORBA.Object obj);
0N/A
0N/A /**
0N/A * Checks if the object reference is an instance of the given interface.
0N/A * @param obj The object reference to be checked.
0N/A * @param repository_id The repository identifier of the interface
0N/A * to check against.
0N/A * @return true if the object reference supports the interface
0N/A */
0N/A public abstract boolean is_a(org.omg.CORBA.Object obj, String repository_id);
0N/A
0N/A /**
0N/A * Determines whether the server object for the object reference has been
0N/A * destroyed.
0N/A * @param obj The object reference which delegated to this delegate.
0N/A * @return true if the ORB knows authoritatively that the server object does
0N/A * not exist, false otherwise
0N/A */
0N/A public abstract boolean non_existent(org.omg.CORBA.Object obj);
0N/A
0N/A /**
0N/A * Determines if the two object references are equivalent.
0N/A * @param obj The object reference which delegated to this delegate.
0N/A * @param other The object reference to check equivalence against.
0N/A * @return true if the objects are CORBA-equivalent.
0N/A */
0N/A public abstract boolean is_equivalent(org.omg.CORBA.Object obj,
0N/A org.omg.CORBA.Object other);
0N/A
0N/A /**
0N/A * Returns an ORB-internal identifier (hashcode) for this object reference.
0N/A * @param obj The object reference which delegated to this delegate.
0N/A * @param max specifies an upper bound on the hash value returned by
0N/A * the ORB.
0N/A * @return ORB-internal hash identifier for object reference
0N/A */
0N/A public abstract int hash(org.omg.CORBA.Object obj, int max);
0N/A
0N/A /**
0N/A * Creates a Request instance for use in the Dynamic Invocation Interface.
0N/A * @param obj The object reference which delegated to this delegate.
0N/A * @param operation The name of the operation to be invoked using the
0N/A * Request instance.
0N/A * @return the created Request instance
0N/A */
0N/A public abstract Request request(org.omg.CORBA.Object obj, String operation);
0N/A
0N/A /**
0N/A * Creates a Request instance for use in the Dynamic Invocation Interface.
0N/A *
0N/A * @param obj The object reference which delegated to this delegate.
0N/A * @param ctx The context to be used.
0N/A * @param operation The name of the operation to be
0N/A * invoked.
0N/A * @param arg_list The arguments to the operation in the
0N/A * form of an NVList.
0N/A * @param result A container for the result as a NamedValue.
0N/A * @return The created Request object.
0N/A *
0N/A */
0N/A public abstract Request create_request(org.omg.CORBA.Object obj,
0N/A Context ctx,
0N/A String operation,
0N/A NVList arg_list,
0N/A NamedValue result);
0N/A
0N/A /**
0N/A * Creates a Request instance for use in the Dynamic Invocation Interface.
0N/A *
0N/A * @param obj The object reference which delegated to this delegate.
0N/A * @param ctx The context to be used.
0N/A * @param operation The name of the operation to be
0N/A * invoked.
0N/A * @param arg_list The arguments to the operation in the
0N/A * form of an NVList.
0N/A * @param result A container for the result as a NamedValue.
0N/A * @param exclist A list of possible exceptions the
0N/A * operation can throw.
0N/A * @param ctxlist A list of context strings that need
0N/A * to be resolved and sent with the
0N/A * Request.
0N/A * @return The created Request object.
0N/A */
0N/A public abstract Request create_request(org.omg.CORBA.Object obj,
0N/A Context ctx,
0N/A String operation,
0N/A NVList arg_list,
0N/A NamedValue result,
0N/A ExceptionList exclist,
0N/A ContextList ctxlist);
0N/A
0N/A /**
0N/A * Provides a reference to the orb associated with its parameter.
0N/A *
0N/A * @param obj the object reference which delegated to this delegate.
0N/A * @return the associated orb.
0N/A * @see <a href="package-summary.html#unimpl"><code>portable</code>
0N/A * package comments for unimplemented features</a>
0N/A */
0N/A public org.omg.CORBA.ORB orb(org.omg.CORBA.Object obj) {
0N/A throw new org.omg.CORBA.NO_IMPLEMENT();
0N/A }
0N/A
0N/A /**
0N/A * Returns the <code>Policy</code> object of the specified type
0N/A * which applies to this object.
0N/A *
0N/A * @param self The object reference which delegated to this delegate.
0N/A * @param policy_type The type of policy to be obtained.
0N/A * @return A <code>Policy</code> object of the type specified by
0N/A * the policy_type parameter.
0N/A * @exception org.omg.CORBA.BAD_PARAM raised when the value of policy type
0N/A * is not valid either because the specified type is not supported by this
0N/A * ORB or because a policy object of that type is not associated with this
0N/A * Object.
0N/A * @see <a href="package-summary.html#unimpl"><code>portable</code>
0N/A * package comments for unimplemented features</a>
0N/A */
0N/A public org.omg.CORBA.Policy get_policy(org.omg.CORBA.Object self,
0N/A int policy_type) {
0N/A throw new org.omg.CORBA.NO_IMPLEMENT();
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Retrieves the <code>DomainManagers</code> of this object.
0N/A * This allows administration services (and applications) to retrieve the
0N/A * domain managers, and hence the security and other policies applicable
0N/A * to individual objects that are members of the domain.
0N/A *
0N/A * @param self The object reference which delegated to this delegate.
0N/A * @return The list of immediately enclosing domain managers of this object.
0N/A * At least one domain manager is always returned in the list since by
0N/A * default each object is associated with at least one domain manager at
0N/A * creation.
0N/A * @see <a href="package-summary.html#unimpl"><code>portable</code>
0N/A * package comments for unimplemented features</a>
0N/A */
0N/A public org.omg.CORBA.DomainManager[] get_domain_managers(
0N/A org.omg.CORBA.Object
0N/A self) {
0N/A throw new org.omg.CORBA.NO_IMPLEMENT();
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Associates the policies passed in
0N/A * with a newly created object reference that it returns. Only certain
0N/A * policies that pertain to the invocation of an operation at the client
0N/A * end can be overridden using this operation. Attempts to override any
0N/A * other policy will result in the raising of the CORBA::NO_PERMISSION
0N/A * exception.
0N/A *
0N/A * @param self The object reference which delegated to this delegate.
0N/A * @param policies A sequence of references to Policy objects.
0N/A * @param set_add Indicates whether these policies should be added
0N/A * onto any otheroverrides that already exist (ADD_OVERRIDE) in
0N/A * the object reference, or they should be added to a clean
0N/A * override free object reference (SET_OVERRIDE).
0N/A * @return A new object reference with the new policies associated with it.
0N/A *
0N/A * @see <a href="package-summary.html#unimpl"><code>portable</code>
0N/A * package comments for unimplemented features</a>
0N/A */
0N/A public org.omg.CORBA.Object set_policy_override(org.omg.CORBA.Object self,
0N/A org.omg.CORBA.Policy[] policies,
0N/A org.omg.CORBA.SetOverrideType set_add) {
0N/A throw new org.omg.CORBA.NO_IMPLEMENT();
0N/A }
0N/A
0N/A
0N/A /**
0N/A * Returns true if this object is implemented by a local servant.
0N/A *
0N/A * @param self The object reference which delegated to this delegate.
0N/A * @return true only if the servant incarnating this object is located in
0N/A * this Java VM. Return false if the servant is not local or the ORB
0N/A * does not support local stubs for this particular servant. The default
0N/A * behavior of is_local() is to return false.
0N/A */
0N/A public boolean is_local(org.omg.CORBA.Object self) {
0N/A return false;
0N/A }
0N/A
0N/A /**
0N/A * Returns a Java reference to the servant which should be used for this
0N/A * request. servant_preinvoke() is invoked by a local stub.
0N/A * If a ServantObject object is returned, then its servant field
0N/A * has been set to an object of the expected type (Note: the object may
0N/A * or may not be the actual servant instance). The local stub may cast
0N/A * the servant field to the expected type, and then invoke the operation
0N/A * directly. The ServantRequest object is valid for only one invocation,
0N/A * and cannot be used for more than one invocation.
0N/A *
0N/A * @param self The object reference which delegated to this delegate.
0N/A *
0N/A * @param operation a string containing the operation name.
0N/A * The operation name corresponds to the operation name as it would be
0N/A * encoded in a GIOP request.
0N/A *
0N/A * @param expectedType a Class object representing the expected type of the servant.
0N/A * The expected type is the Class object associated with the operations
0N/A * class of the stub's interface (e.g. A stub for an interface Foo,
0N/A * would pass the Class object for the FooOperations interface).
0N/A *
0N/A * @return a ServantObject object.
0N/A * The method may return a null value if it does not wish to support
0N/A * this optimization (e.g. due to security, transactions, etc).
0N/A * The method must return null if the servant is not of the expected type.
0N/A */
0N/A public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
0N/A String operation,
0N/A Class expectedType) {
0N/A return null;
0N/A }
0N/A
0N/A /**
0N/A * servant_postinvoke() is invoked by the local stub after the operation
0N/A * has been invoked on the local servant.
0N/A * This method must be called if servant_preinvoke() returned a non-null
0N/A * value, even if an exception was thrown by the servant's method.
0N/A * For this reason, the call to servant_postinvoke() should be placed
0N/A * in a Java finally clause.
0N/A *
0N/A * @param self The object reference which delegated to this delegate.
0N/A *
0N/A * @param servant the instance of the ServantObject returned from
0N/A * the servant_preinvoke() method.
0N/A */
0N/A public void servant_postinvoke(org.omg.CORBA.Object self,
0N/A ServantObject servant) {
0N/A }
0N/A
0N/A /**
0N/A * request is called by a stub to obtain an OutputStream for
0N/A * marshaling arguments. The stub must supply the operation name,
0N/A * and indicate if a response is expected (i.e is this a oneway
0N/A * call).
0N/A *
0N/A * @param self The object reference which delegated to this delegate.
0N/A * @param operation a string containing the operation name.
0N/A * The operation name corresponds to the operation name as it would be
0N/A * encoded in a GIOP request.
0N/A * @param responseExpected false if the operation is a one way operation,
0N/A * and true otherwise.
0N/A * @return OutputStream the OutputStream into which request arguments
0N/A * can be marshaled.
0N/A * @see <a href="package-summary.html#unimpl"><code>portable</code>
0N/A * package comments for unimplemented features</a>
0N/A */
0N/A public OutputStream request(org.omg.CORBA.Object self,
0N/A String operation,
0N/A boolean responseExpected) {
0N/A throw new org.omg.CORBA.NO_IMPLEMENT();
0N/A }
0N/A
0N/A /**
0N/A * invoke is called by a stub to invoke an operation. The stub provides an
0N/A * OutputStream that was previously returned by a request()
0N/A * call. invoke returns an InputStream which contains the
0N/A * marshaled reply. If an exception occurs, invoke may throw an
0N/A * ApplicationException object which contains an InputStream from
0N/A * which the user exception state may be unmarshaled.
0N/A *
0N/A * @param self The object reference which delegated to this delegate.
0N/A * @param output the OutputStream which contains marshaled arguments
0N/A * @return input the InputStream from which reply parameters can be
0N/A * unmarshaled.
0N/A * @throws ApplicationException thrown when implementation throws
0N/A * (upon invocation) an exception defined as part of its remote method
0N/A * definition.
0N/A * @throws RemarshalException thrown when remarshalling fails.
0N/A * @see <a href="package-summary.html#unimpl"><code>portable</code>
0N/A * package comments for unimplemented features</a>
0N/A */
0N/A public InputStream invoke(org.omg.CORBA.Object self,
0N/A OutputStream output)
0N/A throws ApplicationException, RemarshalException {
0N/A throw new org.omg.CORBA.NO_IMPLEMENT();
0N/A }
0N/A
0N/A /**
0N/A * releaseReply may optionally be called by a stub to release a
0N/A * reply stream back to the ORB when the unmarshaling has
0N/A * completed. The stub passes the InputStream returned by
0N/A * invoke() or ApplicationException.getInputStream(). A null
0N/A * value may also be passed to releaseReply, in which case the
0N/A * method is a noop.
0N/A *
0N/A * @param self The object reference which delegated to this delegate.
0N/A * @param input the InputStream returned from invoke().
0N/A * @see <a href="package-summary.html#unimpl"><code>portable</code>
0N/A * package comments for unimplemented features</a>
0N/A */
0N/A public void releaseReply(org.omg.CORBA.Object self,
0N/A InputStream input) {
0N/A throw new org.omg.CORBA.NO_IMPLEMENT();
0N/A }
0N/A
0N/A /**
0N/A * Provides the implementation to override the toString() method
0N/A * of the delegating CORBA object.
0N/A *
0N/A * @param self the object reference that delegated to this delegate
0N/A * @return a <code>String</code> object that represents the object
0N/A * reference that delegated to this <code>Delegate</code>
0N/A * object
0N/A */
0N/A
0N/A public String toString(org.omg.CORBA.Object self) {
0N/A return self.getClass().getName() + ":" + this.toString();
0N/A }
0N/A
0N/A /**
0N/A * Provides the implementation to override the hashCode() method
0N/A * of the delegating CORBA object.
0N/A *
0N/A * @param self the object reference that delegated to this delegate
0N/A * @return an <code>int</code> that represents the hashcode for the
0N/A * object reference that delegated to this <code>Delegate</code>
0N/A * object
0N/A */
0N/A public int hashCode(org.omg.CORBA.Object self) {
0N/A return System.identityHashCode(self);
0N/A }
0N/A
0N/A /**
0N/A * Provides the implementation to override the equals(java.lang.Object obj)
0N/A * method of the delegating CORBA object.
0N/A *
0N/A * @param self the object reference that delegated to this delegate
0N/A * @param obj the <code>Object</code> with which to compare
0N/A * @return <code>true</code> if <code>obj</code> equals <code>self</code>;
0N/A * <code>false</code> otherwise
0N/A */
0N/A public boolean equals(org.omg.CORBA.Object self, java.lang.Object obj) {
0N/A return (self == obj);
0N/A }
0N/A}