org.csc.phynixx.connection
Interface IPhynixxManagedConnection<C extends IPhynixxConnection>

All Superinterfaces:
ICloseable, IPhynixxConnection

public interface IPhynixxManagedConnection<C extends IPhynixxConnection>
extends IPhynixxConnection, ICloseable

a managed connection is managed by the phynixx system. it takes care of integrating the connection into the phynixx XA Implementation and/or provides persistent logger to store transaction data.

It decorates the origin Connection with one or more aspects an. You can declare new decorators by PhynixxManagedConnectionFactory

this IF combines the role of a core connection and the role of a connection proxy.

Impl. of this IF represents the access to the core connections in this FW h1. Thread Safeness When this connection is used in a pool (PooledPhynixxManagedConnectionFactory it is strongly recommend to synchronized the connection setSynchronized(boolean). When a connection is get from the pool or if it is released to it some functionality of the connection is used. It is no obvious if the pools implementation of GenericObjectPool is strictly thread safe.

Author:
christoph

Method Summary
 void addConnectionListener(IPhynixxManagedConnectionListener<C> listener)
           
 void commit(boolean onePhaseCommit)
           
 void free()
          marks a connection a freed.
 C getCoreConnection()
           
 long getManagedConnectionId()
           
 boolean hasCoreConnection()
           
 boolean hasTransactionalData()
           
 boolean isSynchronized()
           
 void recover()
           
 void removeConnectionListener(IPhynixxManagedConnectionListener<C> listener)
           
 void reopen()
          opens a connection that may have been reset.
 void setSynchronized(boolean state)
          set the thread safeness of the connection.
 C toConnection()
           
 
Methods inherited from interface org.csc.phynixx.connection.IPhynixxConnection
close, commit, prepare, reset, rollback
 
Methods inherited from interface org.csc.phynixx.connection.ICloseable
close, isClosed
 

Method Detail

setSynchronized

void setSynchronized(boolean state)
set the thread safeness of the connection.

Parameters:
state -

isSynchronized

boolean isSynchronized()
Returns:
shows if the connection is thread safe

getManagedConnectionId

long getManagedConnectionId()
Returns:
Id unique for the scope of the factory

getCoreConnection

C getCoreConnection()
Returns:
the managed Core Connection

hasTransactionalData

boolean hasTransactionalData()
Returns:
shows if the connection has transactional data

toConnection

C toConnection()
Returns:
current connection interpreted as core connection, but still managed

free

void free()
marks a connection a freed. This connection won't be used any more


hasCoreConnection

boolean hasCoreConnection()

recover

void recover()

commit

void commit(boolean onePhaseCommit)

reopen

void reopen()
opens a connection that may have been reset. After calling this method ICloseable.isClosed()==false and IPhynixxConnection.reset() is called on the physical connection.

Throws:
IllegalStateException - connection has transactional data

addConnectionListener

void addConnectionListener(IPhynixxManagedConnectionListener<C> listener)

removeConnectionListener

void removeConnectionListener(IPhynixxManagedConnectionListener<C> listener)


Copyright © 2015. All rights reserved.