src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientRequestImpl.sjava

changeset 519
6b5db99e194c
parent 518
0717fc6f2960
parent 496
d411c60a8c2f
child 520
9c75c61d97f8
     1.1 --- a/src/share/classes/com/sun/corba/se/impl/protocol/oldlocal/LocalClientRequestImpl.sjava	Fri Aug 09 14:24:17 2013 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,138 +0,0 @@
     1.4 -/*
     1.5 - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
     1.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 - *
     1.8 - * This code is free software; you can redistribute it and/or modify it
     1.9 - * under the terms of the GNU General Public License version 2 only, as
    1.10 - * published by the Free Software Foundation.  Oracle designates this
    1.11 - * particular file as subject to the "Classpath" exception as provided
    1.12 - * by Oracle in the LICENSE file that accompanied this code.
    1.13 - *
    1.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 - * version 2 for more details (a copy is included in the LICENSE file that
    1.18 - * accompanied this code).
    1.19 - *
    1.20 - * You should have received a copy of the GNU General Public License version
    1.21 - * 2 along with this work; if not, write to the Free Software Foundation,
    1.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 - *
    1.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 - * or visit www.oracle.com if you need additional information or have any
    1.26 - * questions.
    1.27 - */
    1.28 -
    1.29 -package com.sun.corba.se.impl.iiop;
    1.30 -
    1.31 -import com.sun.corba.se.impl.protocol.Request;
    1.32 -import com.sun.corba.se.impl.core.ClientRequest;
    1.33 -import com.sun.corba.se.impl.core.ServiceContext;
    1.34 -import com.sun.corba.se.impl.core.ServiceContexts;
    1.35 -import com.sun.corba.se.impl.core.ClientResponse;
    1.36 -import com.sun.corba.se.impl.core.ServerRequest;
    1.37 -import com.sun.corba.se.impl.core.ServerResponse;
    1.38 -import com.sun.corba.se.impl.corba.IOR;
    1.39 -import com.sun.corba.se.impl.corba.GIOPVersion;
    1.40 -import com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase;
    1.41 -import com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage;
    1.42 -import com.sun.corba.se.impl.orbutil.ORBConstants;
    1.43 -import com.sun.corba.se.impl.core.ORBVersion;
    1.44 -import com.sun.corba.se.impl.core.ORB;
    1.45 -import com.sun.corba.se.impl.orbutil.ORBUtility;
    1.46 -import com.sun.corba.se.impl.ior.ObjectKeyFactory ;
    1.47 -import com.sun.corba.se.impl.ior.ObjectKey ;
    1.48 -import com.sun.corba.se.impl.ior.ObjectKeyTemplate ;
    1.49 -import com.sun.corba.se.impl.ior.IIOPProfile;
    1.50 -
    1.51 -public class LocalClientRequestImpl extends IIOPOutputStream 
    1.52 -    implements ClientRequest 
    1.53 -{
    1.54 -    public LocalClientRequestImpl( GIOPVersion gv, 
    1.55 -	ORB orb, IOR ior, short addrDisposition, 
    1.56 -        String operationName, boolean oneway, ServiceContexts svc, 
    1.57 -	int requestId, byte streamFormatVersion)
    1.58 -    {
    1.59 -	super(gv, 
    1.60 -              orb, 
    1.61 -              null, 
    1.62 -              BufferManagerFactory.newBufferManagerWrite(BufferManagerFactory.GROW),
    1.63 -              streamFormatVersion);
    1.64 -
    1.65 -	this.isOneway = oneway;
    1.66 -	boolean responseExpected = !isOneway;
    1.67 -
    1.68 -        IIOPProfile iop = ior.getProfile();
    1.69 -	ObjectKey okey = iop.getObjectKey();
    1.70 -	ObjectKeyTemplate oktemp = okey.getTemplate() ;
    1.71 -	ORBVersion version = oktemp.getORBVersion() ;
    1.72 -	orb.setORBVersion( version ) ;
    1.73 -
    1.74 -        this.request = MessageBase.createRequest(orb, gv, requestId,
    1.75 -	    responseExpected, ior, addrDisposition, operationName, svc, null);
    1.76 -	setMessage(request);
    1.77 -	request.write(this);
    1.78 -
    1.79 -	// mark beginning of msg body for possible later use
    1.80 -	bodyBegin = getSize();
    1.81 -    }
    1.82 -
    1.83 -    public int getRequestId() {
    1.84 -	return request.getRequestId();
    1.85 -    }
    1.86 -    
    1.87 -    public boolean isOneWay() {
    1.88 -	return isOneway;
    1.89 -    }
    1.90 -
    1.91 -    public ServiceContexts getServiceContexts() {
    1.92 -	return request.getServiceContexts();
    1.93 -    }
    1.94 -
    1.95 -    public String getOperationName() {
    1.96 -	return request.getOperation();
    1.97 -    }
    1.98 -
    1.99 -    public ObjectKey getObjectKey() {
   1.100 -	return request.getObjectKey();
   1.101 -    }
   1.102 -
   1.103 -    public ServerRequest getServerRequest()
   1.104 -    {
   1.105 -	// Set the size of the marshalled data in the message header.
   1.106 -	getMessage().setSize( getByteBuffer(), getSize() ) ;
   1.107 -
   1.108 -	// Construct a new ServerRequest out of the buffer in this ClientRequest
   1.109 -	LocalServerRequestImpl serverRequest = new LocalServerRequestImpl(
   1.110 -	    (ORB)orb(), toByteArray(), request ) ;
   1.111 -
   1.112 -	// Skip over all of the GIOP header information.  This positions
   1.113 -	// the offset in the buffer so that the skeleton can correctly read
   1.114 -	// the marshalled arguments.
   1.115 -	serverRequest.setIndex( bodyBegin ) ;
   1.116 -
   1.117 -	return serverRequest ;
   1.118 -    }
   1.119 -    
   1.120 -    public ClientResponse invoke() 
   1.121 -    {	
   1.122 -	ORB myORB = (ORB)orb() ;
   1.123 -
   1.124 -	ServerResponse serverResponse = myORB.process( getServerRequest() ) ;
   1.125 -
   1.126 -	LocalServerResponseImpl lsr = (LocalServerResponseImpl)serverResponse ;
   1.127 -
   1.128 -	return lsr.getClientResponse() ;
   1.129 -    }
   1.130 -
   1.131 -    /**
   1.132 -     * Check to see if the request is local.
   1.133 -     */
   1.134 -    public boolean isLocal(){
   1.135 -        return true;
   1.136 -    }
   1.137 -
   1.138 -    private RequestMessage request;
   1.139 -    private int bodyBegin;
   1.140 -    private boolean isOneway;
   1.141 -}

mercurial