src/share/classes/com/sun/corba/se/spi/transport/CorbaConnection.java

Tue, 28 Dec 2010 15:52:36 -0800

author
ohair
date
Tue, 28 Dec 2010 15:52:36 -0800
changeset 240
f90b3e014e83
parent 226
e0f7ed041196
child 748
6845b95cba6b
permissions
-rw-r--r--

6962318: Update copyright year
Reviewed-by: xdono

duke@1 1 /*
ohair@240 2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
ohair@158 7 * published by the Free Software Foundation. Oracle designates this
duke@1 8 * particular file as subject to the "Classpath" exception as provided
ohair@158 9 * by Oracle in the LICENSE file that accompanied this code.
duke@1 10 *
duke@1 11 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 * accompanied this code).
duke@1 16 *
duke@1 17 * You should have received a copy of the GNU General Public License version
duke@1 18 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 *
ohair@158 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@158 22 * or visit www.oracle.com if you need additional information or have any
ohair@158 23 * questions.
duke@1 24 */
duke@1 25
duke@1 26 package com.sun.corba.se.spi.transport;
duke@1 27
duke@1 28 import java.io.IOException;
duke@1 29 import java.nio.ByteBuffer;
duke@1 30 import java.nio.channels.SocketChannel;
duke@1 31
duke@1 32 import org.omg.CORBA.SystemException;
duke@1 33
duke@1 34 import com.sun.org.omg.SendingContext.CodeBase;
duke@1 35
duke@1 36 import com.sun.corba.se.pept.encoding.InputObject;
duke@1 37 import com.sun.corba.se.pept.encoding.OutputObject;
duke@1 38 import com.sun.corba.se.pept.protocol.MessageMediator;
duke@1 39 import com.sun.corba.se.pept.transport.Connection;
duke@1 40 import com.sun.corba.se.pept.transport.ResponseWaitingRoom;
duke@1 41
duke@1 42 import com.sun.corba.se.spi.ior.IOR ;
duke@1 43 import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
duke@1 44 import com.sun.corba.se.spi.orb.ORB;
duke@1 45 import com.sun.corba.se.spi.protocol.CorbaMessageMediator;
duke@1 46
duke@1 47 import com.sun.corba.se.impl.encoding.CodeSetComponentInfo;
duke@1 48 import com.sun.corba.se.impl.logging.ORBUtilSystemException;
duke@1 49
duke@1 50 /**
duke@1 51 * @author Harold Carr
duke@1 52 */
duke@1 53 public interface CorbaConnection
duke@1 54 extends
duke@1 55 Connection,
duke@1 56 com.sun.corba.se.spi.legacy.connection.Connection
duke@1 57 {
duke@1 58 public boolean shouldUseDirectByteBuffers();
duke@1 59
duke@1 60 public boolean shouldReadGiopHeaderOnly();
duke@1 61
duke@1 62 public ByteBuffer read(int size, int offset, int length, long max_wait_time)
duke@1 63 throws IOException;
duke@1 64
duke@1 65 public ByteBuffer read(ByteBuffer byteBuffer, int offset,
duke@1 66 int length, long max_wait_time) throws IOException;
duke@1 67
duke@1 68 public void write(ByteBuffer byteBuffer)
duke@1 69 throws IOException;
duke@1 70
duke@1 71 public void dprint(String msg);
duke@1 72
duke@1 73 //
duke@1 74 // From iiop.Connection.java
duke@1 75 //
duke@1 76
duke@1 77 public int getNextRequestId();
duke@1 78 public ORB getBroker();
duke@1 79 public CodeSetComponentInfo.CodeSetContext getCodeSetContext();
duke@1 80 public void setCodeSetContext(CodeSetComponentInfo.CodeSetContext csc);
duke@1 81
duke@1 82 //
duke@1 83 // from iiop.IIOPConnection.java
duke@1 84 //
duke@1 85
duke@1 86 // Facade to ResponseWaitingRoom.
duke@1 87 public MessageMediator clientRequestMapGet(int requestId);
duke@1 88
duke@1 89 public void clientReply_1_1_Put(MessageMediator x);
duke@1 90 public MessageMediator clientReply_1_1_Get();
duke@1 91 public void clientReply_1_1_Remove();
duke@1 92
duke@1 93 public void serverRequest_1_1_Put(MessageMediator x);
duke@1 94 public MessageMediator serverRequest_1_1_Get();
duke@1 95 public void serverRequest_1_1_Remove();
duke@1 96
duke@1 97 public boolean isPostInitialContexts();
duke@1 98
duke@1 99 // Can never be unset...
duke@1 100 public void setPostInitialContexts();
duke@1 101
duke@1 102 public void purgeCalls(SystemException systemException,
duke@1 103 boolean die, boolean lockHeld);
duke@1 104
duke@1 105 //
duke@1 106 // Connection status
duke@1 107 //
duke@1 108 public static final int OPENING = 1;
duke@1 109 public static final int ESTABLISHED = 2;
duke@1 110 public static final int CLOSE_SENT = 3;
duke@1 111 public static final int CLOSE_RECVD = 4;
duke@1 112 public static final int ABORT = 5;
duke@1 113
duke@1 114 // Begin Code Base methods ---------------------------------------
duke@1 115 //
duke@1 116 // Set this connection's code base IOR. The IOR comes from the
duke@1 117 // SendingContext. This is an optional service context, but all
duke@1 118 // JavaSoft ORBs send it.
duke@1 119 //
duke@1 120 // The set and get methods don't need to be synchronized since the
duke@1 121 // first possible get would occur during reading a valuetype, and
duke@1 122 // that would be after the set.
duke@1 123
duke@1 124 // Sets this connection's code base IOR. This is done after
duke@1 125 // getting the IOR out of the SendingContext service context.
duke@1 126 // Our ORBs always send this, but it's optional in CORBA.
duke@1 127
duke@1 128 void setCodeBaseIOR(IOR ior);
duke@1 129
duke@1 130 IOR getCodeBaseIOR();
duke@1 131
duke@1 132 // Get a CodeBase stub to use in unmarshaling. The CachedCodeBase
duke@1 133 // won't connect to the remote codebase unless it's necessary.
duke@1 134 CodeBase getCodeBase();
duke@1 135
duke@1 136 // End Code Base methods -----------------------------------------
duke@1 137
duke@1 138 public void sendCloseConnection(GIOPVersion giopVersion)
duke@1 139 throws IOException;
duke@1 140
duke@1 141 public void sendMessageError(GIOPVersion giopVersion)
duke@1 142 throws IOException;
duke@1 143
duke@1 144 public void sendCancelRequest(GIOPVersion giopVersion, int requestId)
duke@1 145 throws
duke@1 146 IOException;
duke@1 147
duke@1 148 public void sendCancelRequestWithLock(GIOPVersion giopVersion,
duke@1 149 int requestId)
duke@1 150 throws
duke@1 151 IOException;
duke@1 152
duke@1 153 public ResponseWaitingRoom getResponseWaitingRoom();
duke@1 154
duke@1 155 public void serverRequestMapPut(int requestId,
duke@1 156 CorbaMessageMediator messageMediator);
duke@1 157 public CorbaMessageMediator serverRequestMapGet(int requestId);
duke@1 158 public void serverRequestMapRemove(int requestId);
duke@1 159
duke@1 160 // REVISIT: WRONG: should not expose sockets here.
duke@1 161 public SocketChannel getSocketChannel();
duke@1 162
duke@1 163 // REVISIT - MessageMediator parameter?
duke@1 164 public void serverRequestProcessingBegins();
duke@1 165 public void serverRequestProcessingEnds();
skoppar@226 166
skoppar@226 167 /** Clean up all connection resources. Used when shutting down an ORB.
skoppar@226 168 */
skoppar@226 169 public void closeConnectionResources();
duke@1 170 }
duke@1 171
duke@1 172 // End of file.

mercurial