LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.peer
Class LyConnection

java.lang.Object
  extended by leon.peer.LyConnection
Direct Known Subclasses:
LyFileConnection, LyJavaConnection, LySqlConnection, LyXmlConnection, W4BpmConnection

public abstract class LyConnection
extends java.lang.Object

This class represents the physical link with a data supplier. It implements means to 'send requests' and to 'receive responses' from the underlying physical connection.


Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LyConnection(LyApplication application)
          Constructs a new connection for the given application.
 
Method Summary
 void addValue(java.lang.Object key, java.lang.Object value)
          Adds a pair key-value to the session.
 void autoCommit(boolean status)
          To set the commit mode for this connection.
 boolean close()
          Close connection : close associated physical connection.
 void commit()
          To commit a pending transaction for this connection.
 void dump()
          Dump state of this connection.
 java.lang.String getError()
          Gets the last error message that occured on this connection.
 java.rmi.server.UID getUID()
          Gets the UID of this connection.
 java.lang.Object getValue(java.lang.Object key)
          Retrieves a value from a registered key.
 boolean isClosed()
          Checks close state.
 boolean isReserved()
          Checks reserved state.
 boolean prepareCommit()
          This method is called before a commit.
 void released()
          Method called when the connection is returned to the data provider.
 void reserved()
          Method called when the connection is reserved by the data provider.
 void rollback()
          To rollback a pending transaction for this connection.
 void setDataProvider(LyDataProvider provider)
          Sets the data provider of this connection.
 void setError(java.lang.String error)
          Sets the last error message that occured on this connection.
 void setUID(java.rmi.server.UID uid)
          Sets the UID of this connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyConnection

public LyConnection(LyApplication application)
Constructs a new connection for the given application.

Parameters:
application - Application for which the connection is constructed.
Method Detail

close

public boolean close()
Close connection : close associated physical connection.


prepareCommit

public boolean prepareCommit()
This method is called before a commit.

Returns:
true if the commi can be made, else returns false.

commit

public void commit()
To commit a pending transaction for this connection.


rollback

public void rollback()
To rollback a pending transaction for this connection.


reserved

public void reserved()
Method called when the connection is reserved by the data provider. This method may be overidden to reserve some resources.


released

public void released()
Method called when the connection is returned to the data provider. This method may be overidden to free some resources.


autoCommit

public void autoCommit(boolean status)
To set the commit mode for this connection. Default mode is auto commit.


dump

public void dump()
Dump state of this connection.


getError

public java.lang.String getError()
Gets the last error message that occured on this connection.

Returns:
Last error message (may be null if no error occured).

isClosed

public boolean isClosed()
Checks close state.


isReserved

public final boolean isReserved()
Checks reserved state.


getUID

public java.rmi.server.UID getUID()
Gets the UID of this connection.

Returns:
The UID of this connection.

setError

public void setError(java.lang.String error)
Sets the last error message that occured on this connection.

Parameters:
error - Error message (null means no error).

setUID

public void setUID(java.rmi.server.UID uid)
Sets the UID of this connection.

Parameters:
uid - the UID to set

setDataProvider

public void setDataProvider(LyDataProvider provider)
Sets the data provider of this connection.

Parameters:
provider - the data provider of this connection.

addValue

public void addValue(java.lang.Object key,
                     java.lang.Object value)
Adds a pair key-value to the session. May be used for example to store the login used to create the session.

Parameters:
key - The key that must be stored.
value - The value that must be stored with the key.
See Also:
getValue(java.lang.Object)

getValue

public java.lang.Object getValue(java.lang.Object key)
Retrieves a value from a registered key.

Parameters:
key - The key that must be used.
Returns:
The value stored with the key or null if the key is not registered.
See Also:
addValue(java.lang.Object, java.lang.Object)

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com