Class JCoConnectionImpl

    • Field Detail

      • properties

        protected java.util.Properties properties
        Properties filled by spring definition in constructor.
      • destroyed

        protected boolean destroyed
        Indicator that connections has already been destroyed.
    • Method Detail

      • setConnectionParameters

        public void setConnectionParameters​(JCoConnectionParameters connectionParameters)
        Setter for connection parameters.
        Parameters:
        connectionParameters - connection parameters.
      • setJcoManagedConnectionContainer

        public void setJcoManagedConnectionContainer​(JCoManagedConnectionContainer jcoManagedConnectionContainer)
        Setter for JCo Managed Connection Container.
        Parameters:
        jcoManagedConnectionContainer - JCo Managed Connection Container
      • init

        public void init()
                  throws BackendException
        Init method called by spring init method definition.
        Throws:
        BackendException - Exception in case of failure.
      • setDestroyed

        public void setDestroyed()
        Destroy method which cleans up the object.
      • getFunction

        public com.sap.conn.jco.JCoFunction getFunction​(java.lang.String functionName)
                                                 throws BackendException
        Description copied from interface: JCoConnection
        Returns a JCoFunction object for the given function name.
        Specified by:
        getFunction in interface JCoConnection
        Parameters:
        functionName - name of remote callable function module on the SAP system
        Returns:
        JCoFunction
        Throws:
        BackendException - when something goes wrong while retrieving meta data
      • getReplacedFunctionModuleName

        protected java.lang.String getReplacedFunctionModuleName​(java.lang.String functionName)
        Replaces origin function name with function name defined in connection parameters.
        Parameters:
        functionName - origin function name
        Returns:
        replaced function name
      • execute

        public void execute​(com.sap.conn.jco.JCoFunction function)
                     throws BackendException
        Description copied from interface: JCoConnection
        This method is used to execute a JCoFunction on behalf of this connection.
        Specified by:
        execute in interface JCoConnection
        Parameters:
        function - a JCoFunction which should be executed
        Throws:
        BackendException - thrown if something goes wrong in the EAI layer or if an JCoException is thrown by the SAP Java Connector.
      • isFunctionCached

        protected boolean isFunctionCached​(JCoManagedFunction managedFunction)
        Checks if function result is cached.
        Parameters:
        managedFunction - requested function
        Returns:
        true, if result is cached
      • preProcessingExecute

        protected void preProcessingExecute​(JCoManagedFunction function)
        Called before JCO execution. Calls event listeners and tracing.
        This method is only called if parameters are defined for that function.
        Parameters:
        function - function which is called.
      • postProcessingExecute

        protected void postProcessingExecute​(JCoManagedFunction function)
        Called after JCO execution. Calls event listeners and tracing.
        This method is only called if parameters are defined for that function.
        Parameters:
        function - function which is called.
      • isFunctionAvailable

        public boolean isFunctionAvailable​(java.lang.String functionName)
                                    throws BackendException
        Description copied from interface: JCoConnection
        Returns true if the JCo Function is available on the SAP system the connection is connected to.
        Specified by:
        isFunctionAvailable in interface JCoConnection
        Parameters:
        functionName - function name
        Returns:
        true if the JCo Function is available, otherwise false
        Throws:
        BackendException - BackendException
      • isStateful

        protected boolean isStateful()
                              throws BackendException
        Check if the destination is stateful.
        Returns:
        true if stateful, false otherwise.
        Throws:
        BackendException - BackendException
      • getDestination

        protected com.sap.conn.jco.JCoCustomDestination getDestination()
        Getter for destination.
        Returns:
        the destination
      • checkInternalStatus

        protected void checkInternalStatus()
                                    throws BackendException
        Checks internal status of the connection.
        After the object is destroyed the destination is set to null. No more function execution is possible. Throws BackendRuntimeException in case of object was already destroyed.
        Throws:
        BackendException - BackendException
      • setCallerId

        public void setCallerId​(java.lang.String callerID)
        Description copied from interface: JCoConnection
        Sets the caller id.
        Specified by:
        setCallerId in interface JCoConnection
        Parameters:
        callerID - caller id.
      • getCallerId

        public java.lang.String getCallerId()
        Getter for caller id.
        Returns:
        caller id
      • getScopeType

        public java.lang.String getScopeType()
        Getter for scope type.
        Returns:
        the scopeType
      • setScopeType

        public void setScopeType​(java.lang.String scopeType)
        Setter for scope type.
        Parameters:
        scopeType - the scopeType to set
      • handleCommunicationExceptionAndDestroyConnection

        protected void handleCommunicationExceptionAndDestroyConnection​(java.lang.Exception e)
        Handles the Communication JCoException and destroy Stateful connection.
        Parameters:
        e - JCoException
      • getRFCDestination

        protected RFCDestination getRFCDestination​(java.lang.String destinationName)
        Returns the RFC Destination for the requested name.
        Parameters:
        destinationName - destination name
        Returns:
        RFCDestination