Class JCo
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addTraceListener
(JCoTraceListener listener) Adds a trace listener, that receives all trace events of JCo.static JCoAbapObject
createAbapObject
(JCoClassMetaData classMetaData, Map<String, Object> initialValues) This is a constructor for an instance of an ABAP class.static JCoBackgroundUnitAttributes
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
(String name) Returns a newly created and empty instance of JCoClassMetaData with the passed initial capacity for new field information.static JCoClassMetaData
createClassMetaData
(String name, String[] parentClasses, 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
(String name) Returns a custom repository, which allows to add custom defined function templates and record metadata definitions.static JCoFunctionTemplate
createFunctionTemplate
(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
(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 communication in the function model.static JCoFunctionUnit
createFunctionUnit
(String unitID, JCoBackgroundUnitAttributes unitAttributes) Creates a new (empty) unit of functions, which is used for bgRFC communication 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
(String name) Returns a newly created and empty instance of JCoListMetaData.static JCoListMetaData
createListMetaData
(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
(String name) Returns a newly created and empty instance of JCoRecordMetaData.static JCoRecordMetaData
createRecordMetaData
(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
(String unitID, JCoBackgroundUnitAttributes unitAttributes) Creates a new (empty) unit of requests, which is used for bgRFC communication 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
Returns a newly created instance of JCoThroughput.static JCoUnitIdentifier
createUnitIdentifier
(String unitID, JCoUnitIdentifier.Type unitType) Creates a new unit identifier.static JCoConnectionMonitor
Returns the connection monitor for all currently available connections.getCustomDestinationIDs
(String destinationID) Creates and returns a list with IDs of all custom destinations created by the destination with the given destinationID.Creates and returns a list containing IDs of all available cached destinations.static JCoDestinationMonitor
getDestinationMonitor
(String destinationID) Retrieves a monitoring object for a specific destination identified by the given ID.static String
Returns the current value for the given middleware property or null, if there is no value set.static String
getProperty
(String key) Returns the current value for the given JCo property or null, if there is no such property set.static JCoRepository
getRepository
(String repositoryID) Returns the repository instance corresponding to the given repository ID or null if the repository isn't available.static String
getRepositoryDestinationID
(String destinationID) Returns the destination ID used by repository instances internally.static JCoDestinationMonitor
getRepositoryDestinationMonitor
(String destinationID) Retrieves a monitoring object for a specific repository destination of the destination identified by the given ID.Returns a list containing IDs of all repository instances that are kept internally.static int
Returns the current trace level.static String
Returns the current trace path.static String
Returns the version of the JCo implementation.static JCoRepositoryQueryResult
queryMetaDataSet
(JCoRepository repository, List<String> functions, List<String> types, List<String> classes) Queries the metadata for function interfaces, types and classes.static void
removeTraceListener
(JCoTraceListener listener) Removes the given trace listener from the list of JCoTraceListeners.static void
setMiddlewareProperty
(String key, String value) Sets a value for the given middleware property.static void
setProperty
(String key, String value) Sets a value for the given JCo property.static void
Turns on the JCo trace.
-
Method Details
-
getVersion
Returns the version of the JCo implementation.- Returns:
- the version of the JCo implementation
-
createCustomRepository
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
Returns a newly created and empty instance of JCoRecordMetaData.- Parameters:
name
- The name of the record metadata.- Returns:
- a newly created JCoRecordMetaData
-
createRecordMetaData
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
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:
-
createListMetaData
Returns a newly created and empty instance of JCoListMetaData.- Parameters:
name
- The name of the list metadata.- Returns:
- a newly created JCoListMetaData
-
createListMetaData
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
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(String name, String[] parentClasses, 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 nameparentClasses
- parent classes of the class type being createdimplementedInterfaces
- interfaces implemented by the class type being createdcapacity
- the number of preallocated field expected for that class metadata object- Returns:
- a new instance of JCoClassMetaData fitting to the parameters
-
createClassMetaData
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
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(String name, JCoListMetaData imports, JCoListMetaData exports, JCoListMetaData changing, JCoListMetaData tables, AbapException[] exceptions) throws IllegalArgumentException 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 definitionimports
- the metadata for all import parameters of the represented function moduleexports
- the metadata for all export parameters of the represented function modulechanging
- the metadata for all changing parameters of the represented function moduletables
- the metadata for all table parameters of the represented function moduleexceptions
- array of AbapExceptions, that belong to the represented function module- Returns:
- a new instance of a JCoFunctionTemplate that consists of the passed metadata
- Throws:
IllegalArgumentException
- in case a metadata object passed as parameter is not locked.
-
createFunctionTemplate
public static JCoFunctionTemplate createFunctionTemplate(String name, JCoListMetaData imports, JCoListMetaData exports, JCoListMetaData changing, JCoListMetaData tables, AbapException[] exceptions, boolean supportsASXML) throws IllegalArgumentException 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 definitionimports
- the metadata for all import parameters of the represented function moduleexports
- the metadata for all export parameters of the represented function modulechanging
- the metadata for all changing parameters of the represented function moduletables
- the metadata for all table parameters of the represented function moduleexceptions
- array of AbapExceptions, that belong to the represented function modulesupportsASXML
- 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:
IllegalArgumentException
- in case a metadata object passed as parameter is not locked.
-
createStructure
public static JCoStructure createStructure(JCoRecordMetaData metaData) throws IllegalArgumentException 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:
IllegalArgumentException
- if metaData is null or is not locked
-
createStructure
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:
IllegalArgumentException
- row is out of bounds or table is null
-
createTable
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:
IllegalArgumentException
- if metaData is null or is not locked
-
createAbapObject
public static JCoAbapObject createAbapObject(JCoClassMetaData classMetaData, Map<String, Object> initialValues) throws ConversionExceptionThis 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 thesetValue()
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(String unitID, JCoBackgroundUnitAttributes unitAttributes) Creates a new (empty) unit of functions, which is used for bgRFC communication 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 unitunitAttributes
- attributes to be assigned to the function unit- Returns:
- a newly created function unit
- Since:
- JCo 3.0.3
-
createFunctionUnit
Creates a new (empty) unit of functions, which is used for bgRFC communication in the function model. A new unit identifier will be generated internally.- Parameters:
unitAttributes
- attributes to be assigned to the function unit- Returns:
- a newly created function unit
- Since:
- JCo 3.0.3
-
createRequestUnit
public static JCoRequestUnit createRequestUnit(String unitID, JCoBackgroundUnitAttributes unitAttributes) Creates a new (empty) unit of requests, which is used for bgRFC communication 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 unitunitAttributes
- attributes to be assigned to the request unit- Returns:
- a newly created request unit
- Since:
- JCo 3.0.3
-
createRequestUnit
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.- Parameters:
unitAttributes
- attributes to be assigned to the request unit- Returns:
- a newly created request unit
- Since:
- JCo 3.0.3
-
createBackgroundUnitAttributes
Creates an empty instance of function/request unit attributes.- Returns:
- a newly created instance of unit attributes
- Since:
- JCo 3.0.3
-
createUnitIdentifier
public static JCoUnitIdentifier createUnitIdentifier(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.- Parameters:
unitID
- 16-byte ID string in hexadecimal format to be set for the unit identifierunitType
- type to be set for the unit identifier- Returns:
- a newly created instance of a unit identifier
- Since:
- JCo 3.0.3
-
getRepositoryIDs
Returns a list containing IDs of all repository instances that are kept internally.- Returns:
- list of repository IDs
-
getRepository
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. the repository ID is null
-
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
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 new list containing the IDs of existing custom destinations
- Throws:
JCoRuntimeException
- if an internal exception occurs, e.g. the destination ID is null
-
getRepositoryDestinationID
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
- if the destination ID is null or the destination ID does not exist
-
getDestinationMonitor
public static JCoDestinationMonitor getDestinationMonitor(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(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 itself 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
-
getConnectionMonitor
Returns the connection monitor for all currently available connections.- Returns:
- the connection monitor
- Throws:
JCoRuntimeException
- if an unexpected situation occurs while creating the monitorUnsupportedOperationException
- if the monitor is not supported in the current environment
-
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
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
Returns the current value for the given JCo property or null, if there is no such property set.- Parameters:
key
- the name of the property for which the value should be returned- Returns:
- the current value of the property
-
setMiddlewareProperty
Sets a value for the given middleware property. If the value is not applicable to the given property or cannot be set for any reason, a JCoRuntimeException will be thrown.The following properties are supported:
Property name Description jco.middleware.max_startup_delay
The maximum time in seconds between two restart attempts of a JCoServer. Serves as default value if there is no server specific one. Values below 60 seconds are not allowed. (Default: 3600) jco.middleware.snc_lib
The location (path and filename) of the SNC library. Serves as default value if there is no destination or server specific configuration. (Default: "")
The usage of environment variables likeSNC_LIB
,SNC_LIB_32
, and/orSNC_LIB_64
specified on Operating System level should be preferred over setting this JCo property.- Parameters:
key
- the name of the property for which a value should be setvalue
- the new value for the property- Throws:
JCoRuntimeException
- if the value is not valid for the given property or cannot be set for any reason
-
setProperty
Sets a value for the given JCo property. If the value is not applicable to the given property or cannot be set for any reason, a JCoRuntimeException will be thrown.The following properties are supported:
Property name Description jco.trace_path
Sets the directory path for JCo trace files. Alternative to JCo.setTrace()
. Find details there.jco.trace_level
Sets the trace level for JCo. Alternative to JCo.setTrace()
. Find details there.jco.trace.format
Allows defining the trace format. Allowed values are "jco" and "log4j". (Default: "jco") jco.jarm
If set to 1, turns on jarm performance monitoring. In that case the jarm libraries need to be in the classpath. (Default: 0) jco.jdsr
If set to 1, turns on DSR. In that case the jdsr libraries need to be in the classpath. (Default: 0) jco.jdsr.comp_name
The component name to use when creating DSR records. (Default: "SAP Java Connector") jco.session_timeout
The idle timeout for JCo session contexts in minutes. (Default: 10) jco.session_timeout.check_interval
The time interval for checking whether JCo session contexts have been expired in minutes. (Default: 5) jco.cpic_maxconv
The maximum number of connections allowed by the CPIC layer. Limitations: Cannot be decreased at runtime and can only be increased if no CPIC connection is currently open or in use. (Default: runtime environment dependent; at least 202) jco.cpic_keep_alive_period
The idle time period of a CPIC server connection in seconds after which a keep alive ping packet is sent. Switching keep alive pinging from off [0] to on [greater than 10] and vice versa will only affect new RFC connections opened afterwards. (Default: 300, valid values are 0 [off] and a range from 10 [ten seconds] to 86400 [one day]) jco.cpic_keep_alive_timeout
The timeout for trying to send a CPIC keep alive ping packet in ms. If the keep alive ping packet cannot be sent within this timeout period, the connection is considered as broken. (Default: 100) jco.cpic_pong_timeout
The timeout for a CPIC keep alive ping reply packet in seconds. If no such so-called pong packet is received from the communication partner as a reply to a previously sent keep alive ping packet within this timeout period, the connection is considered as broken. Switching keep alive reply pinging from off [0] to on [greater than 10] and vice versa will only affect new RFC connections opened afterwards. (Default: 60, valid values are 0 [off] and a range from 10 [ten seconds] to 3600 [one hour]) jco.ws.ping_check_interval
Time interval in seconds after which a WebSocket client connection, that is currently not writing/reading any data, is checked for incoming ping messages and a response (pong) is sent accordingly right after that. This is the default global property for DestinationDataProvider.JCO_PING_CHECK_INTERVAL
. (Default: 90)
Note: If your communication partner is an ABAP system, this value should be less than the configured value of profile parametericm/WS/ping_interval
.jco.ws.ping_period
The idle time period of a WebSocket server connection in seconds after which a keep alive WebSocket ping packet is sent. Switching keep alive pinging from off [0] to on [greater than 10] and vice versa will only affect new RFC connections opened afterwards. This is the default global property for DestinationDataProvider.JCO_PING_PERIOD
andServerDataProvider.JCO_PING_PERIOD
. (Default: 300, valid values are 0 [off] and a range from 10 [ten seconds] to 86400 [one day])jco.ws.pong_timeout
The timeout for a WebSocket keep alive ping reply packet in seconds. If no such so-called pong packet is received from the communication partner as a reply to a previously sent WebSocket keep alive ping packet within this timeout period, the connection is considered as broken and will be closed. Switching a pong timeout from off [0] to on [greater than 10] and vice versa will only affect new RFC connections opened afterwards. Make sure to choose a value lower than jco.ws.ping_period
as it is only possible to have one ping active at a time. This is the default global property forDestinationDataProvider.JCO_PONG_TIMEOUT
andServerDataProvider.JCO_PONG_TIMEOUT
. (Default: 60, valid values are 0 [off] and a range from 10 [ten seconds] to 3600 [one hour])jco.ni.dnscache.ttl
Caching time (time to live) in seconds of host names and network services for successful DNS lookups (Default: value of Java security property networkaddress.cache.ttl
, valid range is 0 [off] to 86400 [one day])jco.ni.dnscache.negative.ttl
Caching time (time to live) in seconds of host names and network services for failed DNS lookups (Default: value of Java security property networkaddress.cache.negative.ttl
, valid range is 0 [off] to 86400 [one day])jco.ni.socket_buffer_size
The NI socket buffer in bytes for send and receive network operations. (Default: 32768) jrfc.client_connect_timeout
The timeout for a logon or a ping attempt in seconds. (Default: 60, valid range is 1 [one second] to 3600 [one hour]) jrfc.trace
If set to 1, RFC trace is turned on for all connections within JCo. (Default: 0) jrfc.trace_path
Sets the directory path for creating new RFC trace files. This property has no effect on already open RFC trace files. (Default: value of property jco.trace_path
)jrfc.logfile.maxsize
The maximum log file size for the RFC error log in MB. (Default: 8)
Ifjrfc.logfile.maxbackups
is not -1, note thatjrfc.logfile.maxsize
timesjrfc.logfile.maxbackups
must always be at least 20 MB.jrfc.logfile.maxbackups
The number of old files which should be kept when creating a new file. The files are stored in jco.trace_path
. (Default: -1 which means that all files are kept and none is deleted).
Ifjrfc.logfile.maxbackups
is not -1, note thatjrfc.logfile.maxsize
timesjrfc.logfile.maxbackups
must always be at least 20 MB.cpic.trace
The trace level for the CPIC layer. The valid value range is from 0 (trace is off) to 3 (most verbose trace) (Default: 0). cpic.trace.maxfilesize
The maximum file size for the CPIC layer traces in MB. One file will always be retained with the extension ' .old
' being appended to the file name. (Default: 1024 [1 GB])cpic.trace.accept_remote_activation
If set to 1, remote CPIC trace requests from RFC communication partners are accepted and will switch on local CPIC tracing. (Default: 0) jco.delta_management
If set to 0, delta management in RFC protocol is turned off in general. (Default: 1) jco.use_repository_roundtrip_optimization
If set to 1, the JCo repository tries to use the function module for roundtrip optimization for metadata lookups. (Default: 1)
See SAP note 1456826 regarding the back-end prerequisites.jco.logon_group.check_interval
The check interval in minutes how often the maintenance mode for pooled connections is checked for load balanced logon destinations. (Default: 5)
A connection is considered to be in maintenance mode, if the target application server is not registered in the destination's logon group anymore.Note: The property
jco.session_timeout
specifies the timeout period since the last access to a session context after which the registeredSessionReferenceProvider
instance will be regularly called for checking, if the associated JCo session is still alive or not. Only if the methodSessionReferenceProvider.isSessionAlive(sessionID)
returnsfalse
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.trace.format
,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
,jco.cpic_pong_timeout
,jco.ni.dnscache.ttl
,jco.ni.dnscache.negative.ttl
,jco.ni.socket_buffer_size
,jrfc.client_connect_timeout
,jrfc.trace
,jrfc.trace_path
,jrfc.logfile.maxsize
,jrfc.logfile.maxbackups
,cpic.trace
,cpic.trace.maxfilesize
,cpic.trace.accept_remote_activation
,jco.delta_management
,jco.use_repository_roundtrip_optimization
,jco.ws.ping_check_interval
,jco.ws.ping_period
andjco.ws.pong_timeout
.
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 name Description jco.allow_non_abap_partner
If set to 1, the CPIC-based 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.ni.local_address
The local IP address being used for outgoing JCo network traffic. The IP address cannot be an arbitrary one but must be chosen from all valid IP addresses that are configured in the operating system for the current host. (Default: The default IP address which is configured in the operating system.) jco.program_name
The RFC caller program name. (Default: SAPJCo<VersionNumber> [e.g. SAPJCo30
])Caution: For security reasons SAP discourages to run CPIC-based RFC extern-to-extern 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 CPIC-based RFC communications with SNC (Secure Network Communication) or to use WebSocket-based RFC instead, which is secured via TLS.
- Parameters:
key
- the name of the property for which a value should be setvalue
- the new value for the property- Throws:
JCoRuntimeException
- if the value is not valid for the given property or cannot be set for any reason
-
addTraceListener
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
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
Turns on the JCo trace. Allowed levels are [0 .. 10]. The common ones used are:- 0 - nothing
- 1 - errors
- 2 - errors and warnings
- 3 - info messages, errors and warnings
- 4 - execution path, info messages, errors and warnings
- 5 - verbose execution path, info messages, errors and warnings
- 6 - verbose execution path, limited data dumps, info messages, errors and warnings
- 7 - full execution path, data dumps with metadata, verbose info messages, errors and warnings
- 8 - full execution path, full data dumps with metadata, verbose info messages, errors and warnings
null
,stdout
,stderr
or an existing path are allowed. If path is equalsnull
orstdout
orstderr
JCo will trace out to the standard output (error) stream. If at least oneJCoTraceListener
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:
-
getTracePath
Returns the current trace path.- Returns:
- trace path
- See Also:
-
queryMetaDataSet
public static JCoRepositoryQueryResult queryMetaDataSet(JCoRepository repository, List<String> functions, List<String> types, List<String> classes) throws JCoException Queries the metadata for function interfaces, types and classes. All metadata are fetched using one roundtrip and the results will be added to the repository cache. Metadata which is already cached in the repository won't be queried once again.- Parameters:
repository
- repository which will be used for the query; only repositories connected to an ABAP system are allowedfunctions
- list of functions to be queried ornull
types
- list of types to be queried ornull
classes
- list of classes to be queried ornull
- Returns:
- JCoRepositoryQueryResult query status for the requested elements
- Throws:
JCoException
- if a communication error will happen a 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.
-