com.sap.mw.jco

Class JCO.Connection

java.lang.Object
  extended bycom.sap.mw.jco.JCO.Connection
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
JCO.Client, JCO.Server
Enclosing class:
JCO

public abstract static class JCO.Connection
extends Object
implements Cloneable

JCO Client object base class. This class will never be instantiated directly but serves as a base class for the JCO.Client and JCO.Server classes.

For com.sap.mw.jco.rfc.MiddlewareRFC, i.e. the default RFC layer, the additional properties supported by connection are:

jco.cpc.ignore_icons true, if codepage converter should ignore SAP icons

See Also:
JCO.Client, JCO.Server

Field Summary
protected  JCO.Attributes attributes
           
protected  long codepage_converter
           
protected  Object conn_object
           
protected  String conn_params
           
protected  int connection_cpc_mode
           
protected  com.sap.mw.jco.util.Dsr dsr_monitor
           
protected  com.sap.mw.jco.util.Jarm.Monitor jarm_monitor
           
protected  long last_active_timestamp
           
protected  long num_received_bytes
          Total no. of bytes received from the remote system by last call
protected  long num_sent_bytes
          Total no. of bytes send to the remote system by last call
protected  byte[] passport_bytes
          byte prasentation of dsr passport in net byte order (for JNI)
protected  JCO.Pool pool
           
protected  Properties properties
           
protected  long rfc_handle
           
protected  String rfm_name
          rfm name that is called or requested
protected  long start_time
          Time at that last call started
protected  byte state
           
protected  JCO.Throughput throughput
           
protected  long time_handle_request
          Time needed by the server's request handler for last call
protected  long time_middleware
          Time for calling native libRfc calls
protected  long time_total
          Total time for a last call
 
Constructor Summary
protected JCO.Connection()
          This class will never be instantiated directly
 
Method Summary
abstract  void abort(String message)
          Aborts the connection to the remote system, i.e.
protected abstract  void beginCall()
          Notify about begin of call processing
protected  void checkProperties()
          Checks for non rfc or connection related properties.
 Object clone()
          Returns a clone of this connection.
abstract  void disconnect()
          Closes the connection to the remote system.
protected abstract  void endCall()
          Notify about end of call processing
protected  void finalize()
          Called upon garbage collection
abstract  JCO.Attributes getAttributes()
          Returns the attributes of the RFC connection.
 long getConnectionHandle()
          Returns the handle of connection.
 Properties getProperties()
          Returns the current connection parameters as a property list
 String getProperty(String key)
          Returns the property for the given key or null if not found
 String[][] getPropertyInfo()
          Returns the property info for the connection.
protected  byte getState()
          Returns the state of the connection
 JCO.Throughput getThroughput()
          Returns the throughput object in which holds performance data.
 boolean getTrace()
          Returns whether trace is enabled or not.
protected  JCO.Connection hideConnection()
           
abstract  boolean isAlive()
          Checks whether this connection is alive
 boolean isValid()
          Checks whether this connection is valid
protected  void setProperty(String key, String value)
          Sets the property for the given key.
protected  void setState(byte state)
          Sets the state of the connection
 void setThroughput(JCO.Throughput throughput)
          Sets the throughput object in which performance data for the next will be stored.
 void setTrace(boolean trace)
          Enables/disables trace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn_params

protected String conn_params

conn_object

protected Object conn_object

properties

protected Properties properties

attributes

protected JCO.Attributes attributes

jarm_monitor

protected com.sap.mw.jco.util.Jarm.Monitor jarm_monitor

dsr_monitor

protected com.sap.mw.jco.util.Dsr dsr_monitor

passport_bytes

protected byte[] passport_bytes
byte prasentation of dsr passport in net byte order (for JNI)


rfc_handle

protected long rfc_handle

codepage_converter

protected long codepage_converter

connection_cpc_mode

protected int connection_cpc_mode

state

protected byte state

last_active_timestamp

protected long last_active_timestamp

throughput

protected JCO.Throughput throughput

start_time

protected long start_time
Time at that last call started


time_handle_request

protected long time_handle_request
Time needed by the server's request handler for last call


time_total

protected long time_total
Total time for a last call


num_sent_bytes

protected long num_sent_bytes
Total no. of bytes send to the remote system by last call


num_received_bytes

protected long num_received_bytes
Total no. of bytes received from the remote system by last call


time_middleware

protected long time_middleware
Time for calling native libRfc calls


rfm_name

protected String rfm_name
rfm name that is called or requested


pool

protected JCO.Pool pool
Constructor Detail

JCO.Connection

protected JCO.Connection()
This class will never be instantiated directly

Method Detail

getConnectionHandle

public long getConnectionHandle()
Returns the handle of connection. The handle is zero if connection isn't opened or already closed.

Returns:
the handle of connection

clone

public Object clone()
Returns a clone of this connection. The cloned connection however will not be opened !


hideConnection

protected JCO.Connection hideConnection()

finalize

protected void finalize()
                 throws Throwable
Called upon garbage collection

Throws:
Throwable

getProperties

public final Properties getProperties()
Returns the current connection parameters as a property list

Returns:
the current connection parameters as a property list

getPropertyInfo

public String[][] getPropertyInfo()
Returns the property info for the connection. The elements at [i][0] and [i][1] contain the name a brief description of the property, respectively.

Returns:
the property info

getProperty

public final String getProperty(String key)
Returns the property for the given key or null if not found

Returns:
the value of the property with the specified key or null if not found

setProperty

protected void setProperty(String key,
                           String value)
Sets the property for the given key. If the passed value is null the property will be removed from the property list.


isValid

public boolean isValid()
Checks whether this connection is valid

Returns:
true if the connection is valid, false otherwise

getState

protected byte getState()
Returns the state of the connection

Returns:
the state of the connection

setState

protected void setState(byte state)
Sets the state of the connection

Parameters:
state - the new state of the connection

getTrace

public boolean getTrace()
Returns whether trace is enabled or not.

Returns:
true if trace is enabled, false otherwise

setTrace

public void setTrace(boolean trace)
Enables/disables trace

Parameters:
trace - if true enables the trace and disables it otherwise.

getThroughput

public final JCO.Throughput getThroughput()
Returns the throughput object in which holds performance data.

Returns:
the throughput object or null
See Also:
JCO.Throughput

setThroughput

public final void setThroughput(JCO.Throughput throughput)
Sets the throughput object in which performance data for the next will be stored.

Parameters:
throughput - the thoughput object in which to store performance data or null if not interested in such information.
See Also:
JCO.Throughput

getAttributes

public abstract JCO.Attributes getAttributes()
Returns the attributes of the RFC connection. The attribute values depend on the current ABAP context and may vary from call to call.
Note:It only returns useful information, if called from within handleRequest(...).

Returns:
the attributes object for the server connection.
Throws:
JCO.Exception - thrown if the attributes could not be retrieved.
See Also:
JCO.Attributes

disconnect

public abstract void disconnect()
Closes the connection to the remote system.


abort

public abstract void abort(String message)
Aborts the connection to the remote system, i.e. tries to send a final message to the host before it disconnects.

Parameters:
message - the final message that will be sent to the remote system.

isAlive

public abstract boolean isAlive()
Checks whether this connection is alive

Returns:
true if the connection is alive, false otherwise

beginCall

protected abstract void beginCall()
Notify about begin of call processing


endCall

protected abstract void endCall()
Notify about end of call processing


checkProperties

protected void checkProperties()
Checks for non rfc or connection related properties. Will be called inside Client.connect() or Server.start()



Copyright 2006 SAP AG Complete Copyright Notice