gnu.CORBA

Class IorDelegate

Implemented Interfaces:
IorProvider

public class IorDelegate
extends SimpleDelegate

The Classpath implementation of the Delegate functionality in the case, when the object was constructed from an IOR object. The IOR can be constructed from the stringified object reference. There is an different instance of this delegate for each CORBA object.

Field Summary

Fields inherited from class gnu.CORBA.SimpleDelegate

ior, orb

Constructor Summary

IorDelegate(ORB an_orb, IOR an_ior)
Contructs an instance of object using the given IOR.

Method Summary

Request
create_request(Object target, Context context, String operation, NVList parameters, NamedValue returns)
Creates the request to invoke the method on this object.
Request
create_request(Object target, Context context, String operation, NVList parameters, NamedValue returns, ExceptionList exceptions, ContextList ctx_list)
Creates the request to invoke the method on this object.
protected gnuRequest
getRequestInstance(Object target)
Get the instance of request.
InputStream
invoke(Object target, OutputStream output)
Invoke operation on the given object, als handling temproray and permanent redirections.
boolean
is_local(Object self)
Checks if the ior is local so far it is easy.
void
release(Object target)
If there is an opened cache socket to access this object, close that socket.
Request
request(Object target, String operation)
Create a request to invoke the method of this CORBA object.
OutputStream
request(Object target, String operation, boolean response_expected)
Create a request to invoke the method of this CORBA object.
void
setIor(IOR an_ior)
Reset the remote_ior flag, forcing to check if the object is local on the next getRequestInstance call.

Methods inherited from class gnu.CORBA.SimpleDelegate

create_request, create_request, duplicate, equals, getIor, get_interface_def, hash, hashCode, is_a, is_equivalent, is_local, non_existent, orb, release, request, setIor

Methods inherited from class org.omg.CORBA.portable.Delegate

create_request, create_request, duplicate, equals, get_domain_managers, get_interface_def, get_policy, hash, hashCode, invoke, is_a, is_equivalent, is_local, non_existent, orb, release, releaseReply, request, request, servant_postinvoke, set_policy_override, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

IorDelegate

public IorDelegate(ORB an_orb,
                   IOR an_ior)
Contructs an instance of object using the given IOR.

Method Details

create_request

public Request create_request(Object target,
                              Context context,
                              String operation,
                              NVList parameters,
                              NamedValue returns)
Creates the request to invoke the method on this object.
Overrides:
create_request in interface SimpleDelegate
Parameters:
target - the object, for that the operation must be invoked.
context - context (null allowed)
operation - the method name
parameters - the method parameters
returns - the return value holder
Returns:
the created request.

create_request

public Request create_request(Object target,
                              Context context,
                              String operation,
                              NVList parameters,
                              NamedValue returns,
                              ExceptionList exceptions,
                              ContextList ctx_list)
Creates the request to invoke the method on this object.
Overrides:
create_request in interface SimpleDelegate
Parameters:
target - the object, for that the operation must be invoked.
context - context (null allowed)
operation - the method name
parameters - the method parameters
returns - the return value holder
Returns:
the created request.

getRequestInstance

protected gnuRequest getRequestInstance(Object target)
Get the instance of request.

invoke

public InputStream invoke(Object target,
                          OutputStream output)
            throws ApplicationException,
                   RemarshalException
Invoke operation on the given object, als handling temproray and permanent redirections. The ReplyHeader.LOCATION_FORWARD will cause to resend the request to the new direction. The ReplyHeader.LOCATION_FORWARD_PERM will cause additionally to remember the new location by this delegate, so subsequent calls will be immediately delivered to the new target.
Overrides:
invoke in interface Delegate
Parameters:
target - the target object.
output - the output stream, previously returned by request(Object,String,boolean).
Returns:
the input stream, to read the response from or null for a one-way request.
Throws:
ApplicationException - as specified.
RemarshalException - as specified.

is_local

public boolean is_local(Object self)
Checks if the ior is local so far it is easy.
Overrides:
is_local in interface SimpleDelegate

release

public void release(Object target)
If there is an opened cache socket to access this object, close that socket.
Overrides:
release in interface SimpleDelegate
Parameters:
target - The target is not used, this delegate requires a single instance per object.

request

public Request request(Object target,
                       String operation)
Create a request to invoke the method of this CORBA object.
Overrides:
request in interface SimpleDelegate
Parameters:
target - the CORBA object, to that this operation must be applied.
operation - the name of the method to invoke.
Returns:
the request.

request

public OutputStream request(Object target,
                            String operation,
                            boolean response_expected)
Create a request to invoke the method of this CORBA object.
Overrides:
request in interface Delegate
Parameters:
target - the CORBA object, to that this operation must be applied.
operation - the name of the method to invoke.
response_expected - specifies if this is one way message or the response to the message is expected.
Returns:
the stream where the method arguments should be written.

setIor

public void setIor(IOR an_ior)
Reset the remote_ior flag, forcing to check if the object is local on the next getRequestInstance call.
Overrides:
setIor in interface SimpleDelegate

gnuDelegate.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.