public final class ConnectionI extends EventHandler implements Connection, ResponseHandler, CancellationHandler
| Modifier and Type | Class and Description |
|---|---|
static interface |
ConnectionI.StartCallback |
| Modifier and Type | Field and Description |
|---|---|
static int |
CommunicatorDestroyed |
static int |
ObjectAdapterDeactivated |
_disabled, _hasMoreData, _key, _registeredserialVersionUID| Constructor and Description |
|---|
ConnectionI(Communicator communicator,
Instance instance,
ACMMonitor monitor,
Transceiver transceiver,
Connector connector,
EndpointI endpoint,
ObjectAdapterI adapter) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
_toString()
Return a description of the connection as human readable text,
suitable for logging or error messages.
|
void |
activate() |
void |
asyncRequestCanceled(OutgoingAsyncBase outAsync,
LocalException ex) |
AsyncResult |
begin_flushBatchRequests()
Flush any pending batch requests for this connection.
|
AsyncResult |
begin_flushBatchRequests(Callback_Connection_flushBatchRequests cb)
Flush any pending batch requests for this connection.
|
AsyncResult |
begin_flushBatchRequests(Callback cb)
Flush any pending batch requests for this connection.
|
AsyncResult |
begin_flushBatchRequests(Functional_VoidCallback __responseCb,
Functional_GenericCallback1<Exception> __exceptionCb,
Functional_BoolCallback __sentCb)
Flush any pending batch requests for this connection.
|
void |
close(boolean force)
Close a connection, either gracefully or forcefully.
|
Connector |
connector() |
ObjectPrx |
createProxy(Identity ident)
Create a special proxy that always uses this connection.
|
void |
destroy(int reason) |
protected void |
dispatch(ConnectionI.StartCallback startCB,
java.util.List<Ice.ConnectionI.OutgoingMessage> sentCBs,
Ice.ConnectionI.MessageInfo info) |
void |
end_flushBatchRequests(AsyncResult ir)
Flush any pending batch requests for this connection.
|
EndpointI |
endpoint() |
void |
exception(LocalException ex) |
java.nio.channels.SelectableChannel |
fd() |
protected void |
finalize() |
void |
finish(boolean close) |
void |
finished(ThreadPoolCurrent current,
boolean close) |
void |
flushBatchRequests()
Flush any pending batch requests for this connection.
|
ACM |
getACM()
Get the ACM parameters.
|
ObjectAdapter |
getAdapter()
Get the object adapter that dispatches requests for this
connection.
|
BatchRequestQueue |
getBatchRequestQueue() |
Endpoint |
getEndpoint()
Get the endpoint from which the connection was created.
|
ConnectionInfo |
getInfo()
Returns the connection information.
|
void |
hold() |
void |
invokeException(int requestId,
LocalException ex,
int invokeNum,
boolean amd) |
boolean |
isActiveOrHolding() |
boolean |
isFinished() |
void |
message(ThreadPoolCurrent current) |
void |
monitor(long now,
ACMConfig acm) |
int |
sendAsyncRequest(OutgoingAsyncBase out,
boolean compress,
boolean response,
int batchRequestNum) |
void |
sendNoResponse() |
void |
sendResponse(int requestId,
BasicStream os,
byte compressFlag,
boolean amd) |
void |
setACM(IntOptional timeout,
Optional<ACMClose> close,
Optional<ACMHeartbeat> heartbeat)
Set the active connection management parameters.
|
void |
setAdapter(ObjectAdapter adapter)
Explicitly set an object adapter that dispatches requests that
are received over this connection.
|
void |
setBufferSize(int rcvSize,
int sndSize)
Set the connectiion buffer receive/send size.
|
void |
setCallback(ConnectionCallback callback)
Set callback on the connection.
|
void |
start(ConnectionI.StartCallback callback) |
void |
startAndWait() |
boolean |
systemException(int requestId,
SystemException ex,
boolean amd) |
void |
throwException() |
void |
timedOut() |
int |
timeout()
Get the timeout for the connection.
|
java.lang.String |
toString() |
java.lang.String |
type()
Return the connection type.
|
void |
updateObserver() |
void |
waitUntilFinished() |
void |
waitUntilHolding() |
public static final int ObjectAdapterDeactivated
public static final int CommunicatorDestroyed
public ConnectionI(Communicator communicator, Instance instance, ACMMonitor monitor, Transceiver transceiver, Connector connector, EndpointI endpoint, ObjectAdapterI adapter)
public void start(ConnectionI.StartCallback callback)
public void startAndWait()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void activate()
public void hold()
public void destroy(int reason)
public void close(boolean force)
Connectionclose in interface Connectionforce - If true, close forcefully. Otherwise the
connection is closed gracefully.public boolean isActiveOrHolding()
public boolean isFinished()
public void throwException()
public void waitUntilHolding()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void waitUntilFinished()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void updateObserver()
public void monitor(long now,
ACMConfig acm)
public int sendAsyncRequest(OutgoingAsyncBase out, boolean compress, boolean response, int batchRequestNum) throws RetryException
RetryExceptionpublic BatchRequestQueue getBatchRequestQueue()
public void flushBatchRequests()
ConnectionflushBatchRequests in interface Connectionpublic AsyncResult begin_flushBatchRequests()
Connectionbegin_flushBatchRequests in interface Connectionpublic AsyncResult begin_flushBatchRequests(Callback cb)
Connectionbegin_flushBatchRequests in interface Connectioncb - A generic callback.public AsyncResult begin_flushBatchRequests(Callback_Connection_flushBatchRequests cb)
Connectionbegin_flushBatchRequests in interface Connectioncb - A typed callback.public AsyncResult begin_flushBatchRequests(Functional_VoidCallback __responseCb, Functional_GenericCallback1<Exception> __exceptionCb, Functional_BoolCallback __sentCb)
Connectionbegin_flushBatchRequests in interface Connection__responseCb - The response callback.__exceptionCb - The exception callback.__sentCb - The sent callback.public void end_flushBatchRequests(AsyncResult ir)
Connectionend_flushBatchRequests in interface Connectionir - The asynchronous result object.public void setCallback(ConnectionCallback callback)
ConnectionsetCallback in interface Connectioncallback - The connection callback object.public void setACM(IntOptional timeout, Optional<ACMClose> close, Optional<ACMHeartbeat> heartbeat)
ConnectionsetACM in interface Connectiontimeout - The timeout value in seconds.close - The close conditionheartbeat - The hertbeat conditionpublic ACM getACM()
ConnectiongetACM in interface Connectionpublic void asyncRequestCanceled(OutgoingAsyncBase outAsync, LocalException ex)
asyncRequestCanceled in interface CancellationHandlerpublic void sendResponse(int requestId,
BasicStream os,
byte compressFlag,
boolean amd)
sendResponse in interface ResponseHandlerpublic void sendNoResponse()
sendNoResponse in interface ResponseHandlerpublic boolean systemException(int requestId,
SystemException ex,
boolean amd)
systemException in interface ResponseHandlerpublic void invokeException(int requestId,
LocalException ex,
int invokeNum,
boolean amd)
invokeException in interface ResponseHandlerpublic EndpointI endpoint()
public Connector connector()
public void setAdapter(ObjectAdapter adapter)
ConnectionsetAdapter in interface Connectionadapter - The object adapter that should be used by this
connection to dispatch requests. The object adapter must be
activated. When the object adapter is deactivated, it is
automatically removed from the connection.Connection.createProxy(Ice.Identity),
Connection.setAdapter(Ice.ObjectAdapter)public ObjectAdapter getAdapter()
ConnectiongetAdapter in interface ConnectionConnection.setAdapter(Ice.ObjectAdapter)public Endpoint getEndpoint()
ConnectiongetEndpoint in interface Connectionpublic ObjectPrx createProxy(Identity ident)
ConnectioncreateProxy in interface Connectionident - The identity for which a proxy is to be created.Connection.setAdapter(Ice.ObjectAdapter)public void message(ThreadPoolCurrent current)
message in class EventHandlerprotected void dispatch(ConnectionI.StartCallback startCB, java.util.List<Ice.ConnectionI.OutgoingMessage> sentCBs, Ice.ConnectionI.MessageInfo info)
public void finished(ThreadPoolCurrent current, boolean close)
finished in class EventHandlerpublic void finish(boolean close)
public java.lang.String toString()
toString in class EventHandlerpublic java.nio.channels.SelectableChannel fd()
fd in class EventHandlerpublic void timedOut()
public java.lang.String type()
Connectiontype in interface Connectionpublic int timeout()
Connectiontimeout in interface Connectionpublic ConnectionInfo getInfo()
ConnectiongetInfo in interface Connectionpublic void setBufferSize(int rcvSize,
int sndSize)
ConnectionsetBufferSize in interface ConnectionrcvSize - The connection receive buffer size.sndSize - The connection send buffer size.public java.lang.String _toString()
Connection_toString in interface Connectionpublic void exception(LocalException ex)
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable