com.sap.conn.jco
Class JCo

java.lang.Object
  extended by com.sap.conn.jco.JCo

public abstract class JCo
extends java.lang.Object

The main factory class of JCo. With the methods in this class it is possible to create the instances of JCo classes, e.g. the data containers such as implementations of JCoStructure, JCoTable or JCoParameterList. Further you can create instances of metadata for implementing your own repository if you need to do so.


Method Summary
static void addTraceListener(JCoTraceListener listener)
          Adds a trace listener, that receives all trace events of JCo
static JCoAbapObject createAbapObject(JCoClassMetaData classMetaData, java.util.Map<java.lang.String,java.lang.Object> initialValues)
          This is a constructor for an instance of an ABAP class.
static JCoBackgroundUnitAttributes createBackgroundUnitAttributes()
          Creates an empty instance of function/request unit attributes.
static JCoClassMetaData createClassMetaData(JCoClassMetaData metaData)
          Returns a newly created instance of JCoClassMetaData, which is initially a copy of the passed JCoClassMetaData.
static JCoClassMetaData createClassMetaData(java.lang.String name)
          Returns a newly created and empty instance of JCoClassMetaData with the passed initial capacity for new field information.
static JCoClassMetaData createClassMetaData(java.lang.String name, java.lang.String[] parentClasses, java.lang.String[] implementedInterfaces, int capacity)
          Returns a newly created and empty instance of JCoClassMetaData with the passed initial capacity for new field information.
static JCoCustomRepository createCustomRepository(java.lang.String name)
          Returns a custom repository, which allows to add custom defined function templates and record metadata definitions
static JCoFunctionTemplate createFunctionTemplate(java.lang.String name, JCoListMetaData imports, JCoListMetaData exports, JCoListMetaData changing, JCoListMetaData tables, AbapException[] exceptions)
          This factory method allows to create a JCoFunctionTemplate that can be used in later function module executions.
static JCoFunctionTemplate createFunctionTemplate(java.lang.String name, JCoListMetaData imports, JCoListMetaData exports, JCoListMetaData changing, JCoListMetaData tables, AbapException[] exceptions, boolean supportsASXML)
          This factory method allows to create a JCoFunctionTemplate that can be used in later function module executions.
static JCoFunctionUnit createFunctionUnit(JCoBackgroundUnitAttributes unitAttributes)
          Creates a new (empty) unit of functions, which is used for bgRFC commuication in the function model.
static JCoFunctionUnit createFunctionUnit(java.lang.String unitID, JCoBackgroundUnitAttributes unitAttributes)
          Creates a new (empty) unit of functions, which is used for bgRFC commuication in the function model.
static JCoListMetaData createListMetaData(JCoListMetaData metaData)
          Returns a newly created instance of JCoListMetaData, which is initially a copy of the passed JCoListMetaData.
static JCoListMetaData createListMetaData(java.lang.String name)
          Returns a newly created and empty instance of JCoListMetaData.
static JCoListMetaData createListMetaData(java.lang.String name, int capacity)
          Returns a newly created and empty instance of JCoListMetaData with the passed initial capacity for new field information.
static JCoRecordMetaData createRecordMetaData(JCoRecordMetaData metaData)
          Returns a newly created instance of JCoRecordMetaData, which is initially a copy of the passed JCoRecordMetaData.
static JCoRecordMetaData createRecordMetaData(java.lang.String name)
          Returns a newly created and empty instance of JCoRecordMetaData.
static JCoRecordMetaData createRecordMetaData(java.lang.String name, int capacity)
          Returns a newly created and empty instance of JCoRecordMetaData with the passed initial capacity for new field information.
static JCoRequestUnit createRequestUnit(JCoBackgroundUnitAttributes unitAttributes)
          Creates a new (empty) unit of requests, which is used for bgRFC communication in the request/response model.
static JCoRequestUnit createRequestUnit(java.lang.String unitID, JCoBackgroundUnitAttributes unitAttributes)
          Creates a new (empty) unit of requests, which is used for bgRFC commuication in the request/response model.
static JCoStructure createStructure(JCoRecordMetaData metaData)
          Returns a newly created instance of JCoStructure with the passed metadata information.
static JCoStructure createStructure(JCoTable table, int row)
          Returns a newly created instance of JCoStructure with the metadata used for the given table instance.
static JCoTable createTable(JCoRecordMetaData metaData)
          Returns a newly created instance of JCoTable with the passed metadata information.
static JCoThroughput createThroughput()
          Returns a newly created instance of JCoThroughput.
static JCoUnitIdentifier createUnitIdentifier(java.lang.String unitID, JCoUnitIdentifier.Type unitType)
          Creates a new unit identifier.
static JCoConnectionMonitor getConnectionMonitor()
          Returns the connection monitor for all currently available connections.
static java.util.List<java.lang.String> getCustomDestinationIDs(java.lang.String destinationID)
          Creates and returns a list with IDs of all custom destinations created by the destination with the given destinationID.
static java.util.List<java.lang.String> getDestinationIDs()
          Creates and returns a list containing IDs of all available cached destinations.
static JCoDestinationManager getDestinationManager()
          Deprecated. Reserved for internal use - visibility might be reduced in future versions without further notice. Use the static methods in JCoDestinationManager instead.
static JCoDestinationMonitor getDestinationMonitor(java.lang.String destinationID)
          Retrieves a monitoring object for a specific destination identified by the given ID.
static java.lang.String getMiddlewareProperty(java.lang.String key)
          Returns the current value for the given middleware property or null, if there is no value set.
static java.lang.String getProperty(java.lang.String key)
          Returns the current value for the given JCo property or null, if there is no value set.
static JCoRepository getRepository(java.lang.String repositoryID)
          Returns the repository instance corresponding to the given repository ID or null if the repository isn't available
static java.lang.String getRepositoryDestinationID(java.lang.String destinationID)
          Returns the destination ID used by repository instances internally.
static JCoDestinationMonitor getRepositoryDestinationMonitor(java.lang.String destinationID)
          Retrieves a monitoring object for a specific repository destination of the destination identified by the given ID.
static java.util.List<java.lang.String> getRepositoryIDs()
          Returns a list containing IDs of all repository instances that are kept internally.
static java.util.List<java.lang.String> getServerIDs()
          Returns a list containing IDs of all available server instances.
static JCoServerMonitor getServerMonitor(java.lang.String serverID)
          Returns a server monitor for the given server ID
static int getTraceLevel()
          Returns the current trace level.
static java.lang.String getTracePath()
          Returns the current trace path.
static java.lang.String getVersion()
          Returns the version of the JCo implementation
static JCoRepositoryQueryResult queryMetaDataSet(JCoRepository repository, java.util.List<java.lang.String> functions, java.util.List<java.lang.String> types, java.util.List<java.lang.String> classes)
          Queries the meta data for function, type and class lists.
static void removeTraceListener(JCoTraceListener listener)
          Removes the given trace listener from the list of JCoTraceListeners
static void setMiddlewareProperty(java.lang.String key, java.lang.String value)
          Sets a value for the given middleware property.
static void setProperty(java.lang.String key, java.lang.String value)
          Sets a value for the given JCo property.
static void setTrace(int level, java.lang.String path)
          Turns on the JCo trace.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getVersion

public static java.lang.String getVersion()
Returns the version of the JCo implementation

Returns:
the version of the JCo implementation

getDestinationManager

public static JCoDestinationManager getDestinationManager()
Deprecated. Reserved for internal use - visibility might be reduced in future versions without further notice. Use the static methods in JCoDestinationManager instead.


createCustomRepository

public static JCoCustomRepository createCustomRepository(java.lang.String name)
Returns a custom repository, which allows to add custom defined function templates and record metadata definitions

Parameters:
name - The name of the repository to create.
Returns:
a newly created custom repository

createRecordMetaData

public static JCoRecordMetaData createRecordMetaData(java.lang.String name)
Returns a newly created and empty instance of JCoRecordMetaData.

Parameters:
name - The name of the record metadata.
Returns:
a newly created JCoRecordMetaData

createRecordMetaData

public static JCoRecordMetaData createRecordMetaData(java.lang.String name,
                                                     int capacity)
Returns a newly created and empty instance of JCoRecordMetaData with the passed initial capacity for new field information. This factory method should be used, if you know how many fields the record metadata will have to avoid incremental adjustments of the internal data containers.

Parameters:
name - The name of the record metadata.
capacity - The initial capacity for this metadata object.
Returns:
a newly created JCoRecordMetaData

createRecordMetaData

public static JCoRecordMetaData createRecordMetaData(JCoRecordMetaData metaData)
Returns a newly created instance of JCoRecordMetaData, which is initially a copy of the passed JCoRecordMetaData. Use this factory method in order to create similar metadata objects to minimize the code.

Parameters:
metaData - the JCoRecordMetaData object to copy from
Returns:
a newly created JCoRecordMetaData
See Also:
JCoMetaData.setName(String)

createListMetaData

public static JCoListMetaData createListMetaData(java.lang.String name)
Returns a newly created and empty instance of JCoListMetaData.

Parameters:
name - The name of the list metadata.
Returns:
a newly created JCoListMetaData

createListMetaData

public static JCoListMetaData createListMetaData(java.lang.String name,
                                                 int capacity)
Returns a newly created and empty instance of JCoListMetaData with the passed initial capacity for new field information. This factory method should be used, if you know how many fields the record metadata will have to avoid incremental adjustments of the internal data containers.

Parameters:
name - The name of the list metadata.
capacity - The initial capacity for this metadata object.
Returns:
a newly created JCoListMetaData

createListMetaData

public static JCoListMetaData createListMetaData(JCoListMetaData metaData)
Returns a newly created instance of JCoListMetaData, which is initially a copy of the passed JCoListMetaData. Use this factory method in order to create similar metadata objects to minimize the code.

Parameters:
metaData - the JCoListMetaData object to copy from
Returns:
a newly created JCoListMetaData

createClassMetaData

public static JCoClassMetaData createClassMetaData(java.lang.String name,
                                                   java.lang.String[] parentClasses,
                                                   java.lang.String[] implementedInterfaces,
                                                   int capacity)
Returns a newly created and empty instance of JCoClassMetaData with the passed initial capacity for new field information. If you know how many fields the class metadata will have, you may set capacity accordingly to avoid incremental adjustments of the internal data containers. Otherwise set capacity to '0'.

Parameters:
name - class type name
parentClasses - parent classes of the class type being created
implementedInterfaces - interfaces implemented by the class type being created
capacity - the number of preallocated field expected for that class metadata object
Returns:
a new instance of JCoClassMetaData fitting to the parameters

createClassMetaData

public static JCoClassMetaData createClassMetaData(java.lang.String name)
Returns a newly created and empty instance of JCoClassMetaData with the passed initial capacity for new field information. If you know how many fields the class metadata will have, you may set capacity accordingly to avoid incremental adjustments of the internal data containers. Otherwise set capacity to '0'.

Parameters:
name - class type name
Returns:
a new instance of JCoClassMetaData fitting to the parameter

createClassMetaData

public static JCoClassMetaData createClassMetaData(JCoClassMetaData metaData)
Returns a newly created instance of JCoClassMetaData, which is initially a copy of the passed JCoClassMetaData. Use this factory method in order to create similar metadata objects to minimize the code.

Parameters:
metaData - the JCoClassMetaData object to copy from
Returns:
a newly created JCoClassMetaData

createFunctionTemplate

public static JCoFunctionTemplate createFunctionTemplate(java.lang.String name,
                                                         JCoListMetaData imports,
                                                         JCoListMetaData exports,
                                                         JCoListMetaData changing,
                                                         JCoListMetaData tables,
                                                         AbapException[] exceptions)
This factory method allows to create a JCoFunctionTemplate that can be used in later function module executions. It is normally only used for hardcoded repositories or if you provide your own JCoRepository that uses a different location for the metadata. The metadata objects used here for the parameter lists have to be locked before to avoid inconsistencies.

Parameters:
name - the name of the function module which is represented by the function template definition
imports - the metadata for all import parameters of the represented function module
exports - the metadata for all export parameters of the represented function module
changing - the metadata for all changing parameters of the represented function module
tables - the metadata for all table parameters of the represented function module
exceptions - array of AbapExceptions, that belong to the represented function module
Returns:
a new instance of a JCoFunctionTemplate that consists of the passed metadata
Throws:
java.lang.IllegalArgumentException - in case a metadata object passed as parameter is not locked.

createFunctionTemplate

public static JCoFunctionTemplate createFunctionTemplate(java.lang.String name,
                                                         JCoListMetaData imports,
                                                         JCoListMetaData exports,
                                                         JCoListMetaData changing,
                                                         JCoListMetaData tables,
                                                         AbapException[] exceptions,
                                                         boolean supportsASXML)
This factory method allows to create a JCoFunctionTemplate that can be used in later function module executions. It is normally only used for hardcoded repositories or if you provide your own JCoRepository that uses a different location for the metadata. The metadata objects used here for the parameter lists have to be locked before to avoid inconsistencies.

Parameters:
name - the name of the function module which is represented by the function template definition
imports - the metadata for all import parameters of the represented function module
exports - the metadata for all export parameters of the represented function module
changing - the metadata for all changing parameters of the represented function module
tables - the metadata for all table parameters of the represented function module
exceptions - array of AbapExceptions, that belong to the represented function module
supportsASXML - flag indicating whether this function module supports the ASXML semantics for serialization in the RFC protocol
Returns:
a new instance of a JCoFunctionTemplate that consists of the passed metadata
Throws:
java.lang.IllegalArgumentException - in case a metadata object passed as parameter is not locked.

createStructure

public static JCoStructure createStructure(JCoRecordMetaData metaData)
Returns a newly created instance of JCoStructure with the passed metadata information. The metadata object has to be locked to prevent changes on it and thus inconsistencies in the structure.

Parameters:
metaData - the metadata instance.
Returns:
a newly created JCoStructure
Throws:
java.lang.IllegalArgumentException - if metaData is null or is not locked

createStructure

public static JCoStructure createStructure(JCoTable table,
                                           int row)
Returns a newly created instance of JCoStructure with the metadata used for the given table instance. The structure values are copied from the table line with the given row index.

Parameters:
table - the table is being used as template for the structure.
row - the table line index used to copy the values.
Returns:
a newly created JCoStructure
Throws:
java.lang.IllegalArgumentException - row is out of bounds or table is null

createTable

public static JCoTable createTable(JCoRecordMetaData metaData)
Returns a newly created instance of JCoTable with the passed metadata information. The metadata object has to be locked to prevent changes on it and thus inconsistencies in the table.

Parameters:
metaData - the metadata instance.
Returns:
a newly created JCoTable
Throws:
java.lang.IllegalArgumentException - if metaData is null or is not locked

createAbapObject

public static JCoAbapObject createAbapObject(JCoClassMetaData classMetaData,
                                             java.util.Map<java.lang.String,java.lang.Object> initialValues)
This is a constructor for an instance of an ABAP class. The passed map consists of the initial values that should be set in the instance on creation. This is especially required for read-only attributes, which can no longer be modified afterwards through the setValue() methods.

Parameters:
classMetaData - The metadata describing the ABAP object.
initialValues - A map whose entries will be used as initial values for the instance. Unknown fields will be ignored.
Returns:
The new instance fitting to the passed metadata instance and the initial values
Throws:
ConversionException - if one of the values could not be converted into the corresponding attribute type
Since:
JCo 3.0.3

createFunctionUnit

public static JCoFunctionUnit createFunctionUnit(java.lang.String unitID,
                                                 JCoBackgroundUnitAttributes unitAttributes)
Creates a new (empty) unit of functions, which is used for bgRFC commuication in the function model. The given id is assigned to the unit and cannot be changed. bgRFC supports IDs with length 32 chars as hex decimal representation of 16 bytes
Note: This API is for special cases only - especially for recovering after failure. Applications should use createFunctionUnit() to create a new unit instead of this API.

Parameters:
unitID - ID to be assigned to the function unit
Returns:
a newly created function unit
Since:
JCo 3.0.3

createFunctionUnit

public static JCoFunctionUnit createFunctionUnit(JCoBackgroundUnitAttributes unitAttributes)
Creates a new (empty) unit of functions, which is used for bgRFC commuication in the function model. A new unit identifier will be generated internally.

Returns:
a newly created function unit
Since:
JCo 3.0.3

createRequestUnit

public static JCoRequestUnit createRequestUnit(java.lang.String unitID,
                                               JCoBackgroundUnitAttributes unitAttributes)
Creates a new (empty) unit of requests, which is used for bgRFC commuication in the request/response model. The given id is assigned to the unit and cannot be changed. bgRFC supports IDs with length 32 chars as hex decimal representation of 16 bytes
Note: This API is for special cases only - especially for recovering after failure. Applications should use createRequestUnit() to create a new unit instead of this API.

Parameters:
unitID - ID to be assigned to the request unit
Returns:
a newly created request unit
Since:
JCo 3.0.3

createRequestUnit

public static JCoRequestUnit createRequestUnit(JCoBackgroundUnitAttributes unitAttributes)
Creates a new (empty) unit of requests, which is used for bgRFC communication in the request/response model. A new unit identifier will be generated internally.

Returns:
a newly created request unit
Since:
JCo 3.0.3

createBackgroundUnitAttributes

public static JCoBackgroundUnitAttributes createBackgroundUnitAttributes()
Creates an empty instance of function/request unit attributes.

Returns:
instance of unit attributes
Since:
JCo 3.0.3

createUnitIdentifier

public static JCoUnitIdentifier createUnitIdentifier(java.lang.String unitID,
                                                     JCoUnitIdentifier.Type unitType)
Creates a new unit identifier. The unit identifier is created by a function/request unit instance automatically. This API can be used to create a unit identifier instance, if the unit ID and the unit type were saved to a database separately.

Returns:
instance of unit identifier
Since:
JCo 3.0.3

getRepositoryIDs

public static java.util.List<java.lang.String> getRepositoryIDs()
Returns a list containing IDs of all repository instances that are kept internally.

Returns:
list of repository IDs

getRepository

public static JCoRepository getRepository(java.lang.String repositoryID)
                                   throws JCoRuntimeException
Returns the repository instance corresponding to the given repository ID or null if the repository isn't available

Parameters:
repositoryID - ID of the requested repository
Returns:
the repository instance or null
Throws:
JCoRuntimeException - if an internal exception occurs, e.g. repositoryID is null

getDestinationIDs

public static java.util.List<java.lang.String> getDestinationIDs()
Creates and returns a list containing IDs of all available cached destinations. The IDs returned by this API can be used to obtain a destination monitor for a destination.

Returns:
a new list containing IDs for all (used) destinations

getCustomDestinationIDs

public static java.util.List<java.lang.String> getCustomDestinationIDs(java.lang.String destinationID)
                                                                throws JCoRuntimeException
Creates and returns a list with IDs of all custom destinations created by the destination with the given destinationID. The IDs returned by this API can be used to obtain a destination monitor for a custom destination.

Parameters:
destinationID - ID of the destination used for the creation of the custom destinations
Returns:
a list containing the IDs of existing custom destinations
Throws:
JCoRuntimeException

getRepositoryDestinationID

public static java.lang.String getRepositoryDestinationID(java.lang.String destinationID)
                                                   throws JCoRuntimeException
Returns the destination ID used by repository instances internally. In case the destination does not instantiate its own and uses the repository from another destination, null is returned.

Parameters:
destinationID - of the destination
Returns:
destination id or null
Throws:
JCoRuntimeException - is thrown if destination id null or the destination id does not exists

getDestinationMonitor

public static JCoDestinationMonitor getDestinationMonitor(java.lang.String destinationID)
                                                   throws JCoRuntimeException
Retrieves a monitoring object for a specific destination identified by the given ID. Thus, you can get runtime information about that destination.

Parameters:
destinationID - the unique destination ID for which the monitor should be returned
Returns:
the destination monitor instance for the destination
Throws:
JCoRuntimeException - in case of issues while getting and creating the destination monitor

getRepositoryDestinationMonitor

public static JCoDestinationMonitor getRepositoryDestinationMonitor(java.lang.String destinationID)
                                                             throws JCoRuntimeException
Retrieves a monitoring object for a specific repository destination of the destination identified by the given ID. This could be the monitor for the destination itslef or of some other destination that serves as repository destination - depending on the configuration. Thus, you can get runtime information about that destination.

Parameters:
destinationID - the unique destination ID for which the monitor for the repository destination should be returned
Returns:
the destination monitor instance for the repository destination
Throws:
JCoRuntimeException - in case of issues while getting and creating the destination monitor
Since:
JCo 3.0.7

getServerIDs

public static java.util.List<java.lang.String> getServerIDs()
Returns a list containing IDs of all available server instances. The IDs returned by this API can be used to obtain a server monitor for a server.

Returns:
a list containing IDs of all (used) servers

getServerMonitor

public static JCoServerMonitor getServerMonitor(java.lang.String serverID)
                                         throws JCoRuntimeException
Returns a server monitor for the given server ID

Parameters:
serverID - the server ID for which the monitor should be returned
Returns:
the server monitor for the server
Throws:
JCoRuntimeException - if an unexpected situation occurs while creating the monitor
java.lang.UnsupportedOperationException - if server monitoring is not supported in the current environment

getConnectionMonitor

public static JCoConnectionMonitor getConnectionMonitor()
Returns the connection monitor for all currently available connections.

Returns:
the connection monitor
Throws:
JCoRuntimeException - if an unexpected situation occurs while creating the monitor
java.lang.UnsupportedOperationException - if the monitor is not supported in the current environment

createThroughput

public static JCoThroughput createThroughput()
Returns a newly created instance of JCoThroughput. Throughput instances can be used to measure the performance of RFC calls. It automatically, sums up all the measured data for times and data amounts.

Returns:
a newly created JCoThroughput

getMiddlewareProperty

public static java.lang.String getMiddlewareProperty(java.lang.String key)
Returns the current value for the given middleware property or null, if there is no value set.

Parameters:
key - the name of the property for which you want to get the value
Returns:
the current value of the property

getProperty

public static java.lang.String getProperty(java.lang.String key)
Returns the current value for the given JCo property or null, if there is no value set.

Parameters:
key - the name of the property for which you want to get the value
Returns:
the current value of the property

setMiddlewareProperty

public static void setMiddlewareProperty(java.lang.String key,
                                         java.lang.String value)
Sets a value for the given middleware property. If the value is not applicaple to the given property, a JCoRuntimeException will be thrown. The supported properties are listed in the table below:
Property nameDescription
jco.middleware.max_startup_delayThe maximum time in seconds between restart tries for a JCoServer. Serves as default value, if there is no server specific one. Values below 60 seconds are not allowed. (Default: 3600)
jco.middleware.wait_for_request_timeSets the trace level for JCo. Alternative to JCo.setTrace(). Find details there.
jco.middleware.snc_libThe location of the SNC library. Serves as default value, if there is no server or destination specific configuration. (Default: "")
jrfc.client_connect_timeoutThe timeout for a logon try after having established the technical client connection to an ABAP server. Provide it in seconds (Default: 60s)

Parameters:
key - the name of the property for which you want to set the value
value - the new value, that the property should get
Throws:
JCoRuntimeException - if the value is not fitting to the property

setProperty

public static void setProperty(java.lang.String key,
                               java.lang.String value)
Sets a value for the given JCo property. If the value is not applicable to the given property, a JCoRuntimeException will be thrown. The supported properties are listed in the table below:

Property nameDescription
jco.trace_pathSets the location of the path for JCo trace files. Alternative to JCo.setTrace(). Find details there.
jco.trace_levelSets the trace level for JCo. Alternative to JCo.setTrace(). Find details there.
jco.jarmIf set to 1, turns on jarm performance monitoring. In that case the jarm libraries need to be in the classpath. (Default: 0)
jco.jdsrIf set to 1, turns on DSR. In that case the jdsr libraries need to be in the classpath. (Default: 0)
jco.jdsr.comp_nameThe component name to use when creating DSR records. (Default: SAP Java Connector)
jco.session_timeoutThe idle timeout for JCo session contexts in minutes. (Default: 10)
jco.session_timeout.check_intervalThe time interval for checking whether JCo session contexts have been expired in minutes. (Default: 5)
jco.cpic_maxconvThe maximum number of connections allowed by the CPIC layer. (Default: runtime environment dependent, min. 202)
jco.cpic_keep_alive_periodThe time a server connection has been idle, after which a keep alive ping event is sent, in seconds (Default: 300)
jco.cpic_keep_alive_timeoutTimeout for a ping in ms. After that time a connection is considered as broken. (Default: 10)
cpic.traceThe trace level for the CPIC layer. The valid value range is from 0 (trace is off) to 3 (most verbose trace) (Default: 0)
jrfc.traceIf set to 1, RFC trace is turned on for all connections within JCo. (Default: 0)
jco.delta_managementIf set to 0, delta management in RFC protocol is turned off in general. (Default: 1)
jco.use_repository_roundtrip_optimizationIf set to 1, the JCo repository tries to use the function module for roundtrip optimization for metadata lookups. (Default: 0)
See SAP note 1456826 regarding back-end prerequisites.

Note: The property jco.session_timeout specifies the timeout period since the last access to a session context after which the registered SessionReferenceProvider instance will be regularly called for checking, if the associated JCo session is still alive or not. Only if the method SessionReferenceProvider.isSessionAlive(sessionID) returns false for the specified sessionID, the associated JCo session context will be released, which means that also all still running RFC requests belonging to this context will be immediately canceled.

Most of the above properties can also be passed as a Java system property with the -D argument when starting the JVM. These are: jco.trace_path, jco.trace_level, jco.jarm, jco.jdsr, jco.session_timeout, jco.session_timeout.check_interval, jco.cpic_maxconv, jco.cpic_keep_alive_period, jco.cpic_keep_alive_timeout, cpic.trace, jrfc.trace, jco.delta_management and jco.use_repository_roundtrip_optimization.

Some other properties can only exclusively be passed as a Java system property with the -D argument when starting the JVM. That means they cannot be modified during runtime after the JCo framework initialization anymore. This applies to the following properties listed below:

Property nameDescription
jco.allow_non_abap_partnerIf set to 1 the RFC extern-to-extern communication is allowed. (Default: 0)
For further details see SAP note 1877907 regarding the SAP JCo standalone environment and SAP note 1729203 regarding the SAP NetWeaver AS Java environment.
jco.program_nameThe RFC caller program name. (Default: SAPJCo<VersionNumber> [e.g. SAPJCo30])

Caution: For security reasons SAP discourages to run extern-to-extern RFC communication scenarios. External or registered RFC server programs are not able to check and authenticate incoming RFC requests from external non-ABAP programs with regard to the pure RFC protocol data. Each of such external RFC requests must be regarded as insecure. It is highly recommended to secure such RFC communications with SNC (Secure Network Communication).

Parameters:
key - the name of the property for which a value should be set
value - the new value for the property
Throws:
JCoRuntimeException - if the value is not fitting to the property

addTraceListener

public static void addTraceListener(JCoTraceListener listener)
Adds a trace listener, that receives all trace events of JCo

Parameters:
listener - An instance of JCoTraceListener, that shall be added to the listener list

removeTraceListener

public static void removeTraceListener(JCoTraceListener listener)
Removes the given trace listener from the list of JCoTraceListeners

Parameters:
listener - An instance of JCoTraceListener, that shall be removed from the listener list

setTrace

public static void setTrace(int level,
                            java.lang.String path)
Turns on the JCo trace. Allowed levels are [0 .. 10]. The common ones used are: As path value null, stdout, stderr or an existing path are allowed. If path is equals null or stdout or stderr JCo will trace out to the standard output (error) stream. If at least one JCoTraceListener is registered, the trace output will be sent to the listener only. To redirect the JCo trace into a file, the path value has to be set to an existing directory.

Parameters:
level - [0 .. 10]
path - null, stdout, stderr or an existing path

getTraceLevel

public static int getTraceLevel()
Returns the current trace level.

Returns:
trace level [0..10]
See Also:
setTrace(int, String)

getTracePath

public static java.lang.String getTracePath()
Returns the current trace path.

Returns:
trace path
See Also:
setTrace(int, String)

queryMetaDataSet

public static JCoRepositoryQueryResult queryMetaDataSet(JCoRepository repository,
                                                        java.util.List<java.lang.String> functions,
                                                        java.util.List<java.lang.String> types,
                                                        java.util.List<java.lang.String> classes)
                                                 throws JCoException
Queries the meta data for function, type and class lists. All meta data are fetched using one roundtrip, the result is cached in repository cache.

Parameters:
repository - repository, that will be used for the query. Only repositories connected to the ABAP system are allowed
functions - list of functions to be queried or null
types - list of types to be queried or null
classes - list of classes to be queried or null
Returns:
JCoRepositoryQueryResult containing query status for requested elements
Throws:
JCoException - if a communication error will happen an JCoException with the key JCO_ERROR_COMMUNICATION will be thrown. If the specified repository instance is not connected to an ABAP system a JCoException with key JCO_ERROR_ILLEGAL_ARGUMENT will be thrown.


Copyright © 2008-2014 SAP AG. All Rights Reserved.